mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Grant Likely <grant.likely@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux-acpi@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Bryan Wu <cooloney@gmail.com>, Lee Jones <lee.jones@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>, Aaron Lu <aaron.lu@intel.com>,
	Darren Hart <dvhart@linux.intel.com>
Subject: Re: [RFC PATCH v2 01/16] ACPI: Add support for device specific properties
Date: Mon, 6 Oct 2014 17:32:48 +0300	[thread overview]
Message-ID: <20141006143248.GE1583@lahna.fi.intel.com> (raw)
In-Reply-To: <20141006135021.0EB04C43FBE@trevor.secretlab.ca>

On Mon, Oct 06, 2014 at 02:50:21PM +0100, Grant Likely wrote:
> On Tue, 16 Sep 2014 14:52:32 +0300
> , Mika Westerberg <mika.westerberg@linux.intel.com>
>  wrote:
> > Device Tree is used in many embedded systems to describe the system
> > configuration to the OS. It supports attaching properties or name-value
> > pairs to the devices it describe. With these properties one can pass
> > additional information to the drivers that would not be available
> > otherwise.
> > 
> > ACPI is another configuration mechanism (among other things) typically
> > seen, but not limited to, x86 machines. ACPI allows passing arbitrary
> > data from methods but there has not been mechanism equivalent to Device
> > Tree until the introduction of _DSD in the recent publication of the
> > ACPI 5.1 specification.
> > 
> > In order to facilitate ACPI usage in systems where Device Tree is
> > typically used, it would be beneficial to standardize a way to retrieve
> > Device Tree style properties from ACPI devices, which is what we do in
> > this patch.
> > 
> > If a given device described in ACPI namespace wants to export properties it
> > must implement _DSD method (Device Specific Data, introduced with ACPI 5.1)
> > that returns the properties in a package of packages. For example:
> > 
> > 	Name (_DSD, Package () {
> > 		ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
> > 		Package () {
> > 			Package () {"name1", <VALUE1>},
> > 			Package () {"name2", <VALUE2>},
> > 			...
> > 		}
> > 	})
> > 
> > The UUID reserved for properties is daffd814-6eba-4d8c-8a91-bc9bbf4aa301
> > and is documented in the ACPI 5.1 companion document called "_DSD
> > Implementation Guide" [1], [2].
> > 
> > We add several helper functions that can be used to extract these
> > properties and convert them to different Linux data types.
> > 
> > The ultimate goal is that we only have one device property API that
> > retrieves the requested properties from Device Tree or from ACPI
> > transparent to the caller.
> > 
> > [1] http://www.uefi.org/sites/default/files/resources/_DSD-implementation-guide-toplevel.htm
> > [2] http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf
> > 
> > Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
> > Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> > Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > ---
> >  drivers/acpi/Makefile   |   1 +
> >  drivers/acpi/internal.h |   6 +
> >  drivers/acpi/property.c | 364 ++++++++++++++++++++++++++++++++++++++++++++++++
> >  drivers/acpi/scan.c     |   2 +
> >  include/acpi/acpi_bus.h |   7 +
> >  include/linux/acpi.h    |  40 ++++++
> >  6 files changed, 420 insertions(+)
> >  create mode 100644 drivers/acpi/property.c
> > 
> > diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
> > index 505d4d79fe3e..ba2cafe18fe4 100644
> > --- a/drivers/acpi/Makefile
> > +++ b/drivers/acpi/Makefile
> > @@ -46,6 +46,7 @@ acpi-y				+= acpi_pnp.o
> >  acpi-y				+= power.o
> >  acpi-y				+= event.o
> >  acpi-y				+= sysfs.o
> > +acpi-y				+= property.o
> >  acpi-$(CONFIG_X86)		+= acpi_cmos_rtc.o
> >  acpi-$(CONFIG_DEBUG_FS)		+= debugfs.o
> >  acpi-$(CONFIG_ACPI_NUMA)	+= numa.o
> > diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
> > index 4c5cf77e7576..e34290c7af9f 100644
> > --- a/drivers/acpi/internal.h
> > +++ b/drivers/acpi/internal.h
> > @@ -181,4 +181,10 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev);
> >  bool acpi_osi_is_win8(void);
> >  #endif
> >  
> > +/*--------------------------------------------------------------------------
> > +				Device properties
> > +  -------------------------------------------------------------------------- */
> > +void acpi_init_properties(struct acpi_device *adev);
> > +void acpi_free_properties(struct acpi_device *adev);
> > +
> >  #endif /* _ACPI_INTERNAL_H_ */
> > diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> > new file mode 100644
> > index 000000000000..c4a3e800e82c
> > --- /dev/null
> > +++ b/drivers/acpi/property.c
> > @@ -0,0 +1,364 @@
> > +/*
> > + * ACPI device specific properties support.
> > + *
> > + * Copyright (C) 2014, Intel Corporation
> > + * All rights reserved.
> > + *
> > + * Authors: Mika Westerberg <mika.westerberg@linux.intel.com>
> > + *          Darren Hart <dvhart@linux.intel.com>
> > + *          Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + */
> > +
> > +#include <linux/acpi.h>
> > +#include <linux/device.h>
> > +#include <linux/export.h>
> > +
> > +#include "internal.h"
> > +
> > +/* ACPI _DSD device properties UUID: daffd814-6eba-4d8c-8a91-bc9bbf4aa301 */
> > +static const u8 prp_uuid[16] = {
> > +	0x14, 0xd8, 0xff, 0xda, 0xba, 0x6e, 0x8c, 0x4d,
> > +	0x8a, 0x91, 0xbc, 0x9b, 0xbf, 0x4a, 0xa3, 0x01
> > +};
> 
> ?
> 
> What is the encoding used here? I see the first 4 bytes for "daffd814"
> encoded in little endian (0x14 first), and then the remaining values
> encoded in big-endian for each number. Is this typical for UUID values?

The buffer format is explained in ACPI 5.1 spec, page 823.

I generated the above so that I compiled a _DSD with correct UUID using
iASL and then disassambled it with the same tool.

  reply	other threads:[~2014-10-06 14:32 UTC|newest]

Thread overview: 130+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16 11:52 [RFC PATCH v2 00/16] Add ACPI _DSD and unified device properties support Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 01/16] ACPI: Add support for device specific properties Mika Westerberg
2014-10-06 13:50   ` Grant Likely
2014-10-06 14:32     ` Mika Westerberg [this message]
2014-10-06 16:25       ` Darren Hart
2014-09-16 11:52 ` [RFC PATCH v2 02/16] Driver core: Unified device properties interface for platform firmware Mika Westerberg
2014-09-17 18:28   ` Greg Kroah-Hartman
2014-09-16 11:52 ` [RFC PATCH v2 03/16] ACPI: Allow drivers to match using Device Tree compatible property Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 04/16] ACPI: Document ACPI device specific properties Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 05/16] mfd: Add ACPI support Mika Westerberg
2014-09-16 21:54   ` Lee Jones
2014-09-24 12:00   ` Lee Jones
2014-09-16 11:52 ` [RFC PATCH v2 06/16] gpio / ACPI: Add support for _DSD device properties Mika Westerberg
2014-09-23 15:27   ` Linus Walleij
2014-09-16 11:52 ` [RFC PATCH v2 07/16] gpio: Add support for unified device properties interface Mika Westerberg
2014-09-23 15:25   ` Linus Walleij
2014-09-23 15:45     ` Arnd Bergmann
2014-09-23 15:52       ` Mika Westerberg
2014-09-23 16:17         ` Dmitry Torokhov
2014-09-23 20:31           ` Rafael J. Wysocki
2014-09-23 16:25       ` Rafael J. Wysocki
2014-09-23 16:26         ` Arnd Bergmann
2014-09-23 20:47           ` Rafael J. Wysocki
2014-09-24  7:55             ` Arnd Bergmann
2014-09-24 14:08               ` Rafael J. Wysocki
2014-09-23 21:15           ` Darren Hart
2014-09-24  9:12             ` Arnd Bergmann
2014-09-24  9:38               ` Mika Westerberg
2014-09-24 14:11                 ` Rafael J. Wysocki
2014-09-26  3:21               ` Darren Hart
2014-09-26  8:36                 ` Arnd Bergmann
2014-09-26 14:42                   ` Rafael J. Wysocki
2014-10-07 13:37                 ` Linus Walleij
2014-10-07 15:37                   ` Andy Shevchenko
2014-10-07 23:57                   ` Rafael J. Wysocki
2014-09-16 11:52 ` [RFC PATCH v2 08/16] gpio: sch: Consolidate core and resume banks Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 09/16] leds: leds-gpio: Add support for GPIO descriptors Mika Westerberg
2014-09-19  8:18   ` Alexandre Courbot
2014-09-24  7:55   ` Linus Walleij
2014-09-24  9:42     ` Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 10/16] leds: leds-gpio: Make use of device property API Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 11/16] leds: leds-gpio: Add ACPI probing support Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 12/16] input: gpio_keys_polled - Add support for GPIO descriptors Mika Westerberg
2014-09-19  8:22   ` Alexandre Courbot
2014-09-24  8:02   ` Linus Walleij
2014-09-16 11:52 ` [RFC PATCH v2 13/16] input: gpio_keys_polled - Make use of device property API Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 14/16] input: gpio_keys_polled - Add ACPI probing support Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 15/16] misc: at25: Make use of device property API Mika Westerberg
2014-09-16 11:52 ` [RFC PATCH v2 16/16] misc: at25: Add ACPI probing support Mika Westerberg
2014-09-21  0:26 ` [RFC PATCH v2 00/16] Add ACPI _DSD and unified device properties support Rafael J. Wysocki
2014-09-24  8:34   ` Lee Jones
2014-09-24  9:45     ` Mika Westerberg
2014-09-22 23:29 ` Bryan Wu
2014-10-01  2:08 ` [PATCH v3 00/15] " Rafael J. Wysocki
2014-10-01  2:08   ` [PATCH v3 01/15] ACPI: Add support for device specific properties Rafael J. Wysocki
2014-10-01  7:38     ` Arnd Bergmann
2014-10-01  2:10   ` [PATCH v3 02/15] Driver core: Unified device properties interface for platform firmware Rafael J. Wysocki
2014-10-01  7:47     ` Arnd Bergmann
2014-10-01 22:09       ` Rafael J. Wysocki
2014-10-01 23:01         ` Rafael J. Wysocki
2014-10-02  7:46         ` Arnd Bergmann
2014-10-02 16:50           ` Rafael J. Wysocki
2014-10-02  0:03     ` Greg Kroah-Hartman
2014-10-01  2:10   ` [PATCH v3 03/15] ACPI: Allow drivers to match using Device Tree compatible property Rafael J. Wysocki
2014-10-01  7:48     ` Arnd Bergmann
2014-10-03 13:43     ` Mark Rutland
2014-10-03 17:59       ` Dmitry Torokhov
2014-10-04  0:02         ` Rafael J. Wysocki
2014-10-01  2:11   ` [PATCH v3 04/15] ACPI: Document ACPI device specific properties Rafael J. Wysocki
2014-10-01  7:59     ` Arnd Bergmann
2014-10-02 10:41       ` Mika Westerberg
2014-10-02 11:51         ` Arnd Bergmann
2014-10-02 12:15           ` Mika Westerberg
2014-10-02 12:46             ` Arnd Bergmann
2014-10-02 13:36               ` Mika Westerberg
2014-10-02 14:29                 ` Arnd Bergmann
2014-10-02 14:38                   ` Mika Westerberg
2014-10-02 14:55                     ` Arnd Bergmann
2014-10-03 13:56                       ` Mark Rutland
2014-10-03 15:02                         ` Arnd Bergmann
2014-10-03 23:58                           ` Rafael J. Wysocki
2014-10-04 10:56                             ` Arnd Bergmann
2014-10-05 21:40                               ` Rafael J. Wysocki
2014-10-03  2:03                 ` Rafael J. Wysocki
2014-10-03  8:12                   ` Mika Westerberg
2014-10-03 13:58                   ` Mark Rutland
2014-10-03 14:38                     ` Rafael J. Wysocki
2014-10-03 14:35                       ` Mark Rutland
2014-10-04  0:13                         ` Rafael J. Wysocki
2014-10-04 10:59                           ` Arnd Bergmann
2014-10-05 22:26                             ` Rafael J. Wysocki
2014-10-03 13:48             ` Mark Rutland
2014-10-04  0:16               ` Rafael J. Wysocki
2014-10-01  2:12   ` [PATCH v3 05/15] gpio / ACPI: Add support for _DSD device properties Rafael J. Wysocki
2014-10-01  8:03     ` Arnd Bergmann
2014-10-05 10:36       ` Alexandre Courbot
2014-10-05 21:20         ` Rafael J. Wysocki
2014-10-01  2:14   ` [PATCH v3 06/15] gpio: Support for unified device properties interface Rafael J. Wysocki
2014-10-01  2:15   ` [PATCH v3 07/15] gpio: sch: Consolidate core and resume banks Rafael J. Wysocki
2014-10-01  2:15   ` [PATCH v3 08/15] leds: leds-gpio: Add support for GPIO descriptors Rafael J. Wysocki
2014-10-01  8:05     ` Arnd Bergmann
2014-10-01  2:16   ` [PATCH v3 09/15] leds: leds-gpio: Make use of device property API Rafael J. Wysocki
2014-10-03 14:07     ` Mark Rutland
2014-10-04  0:18       ` Rafael J. Wysocki
2014-10-01  2:17   ` [PATCH v3 10/15] leds: leds-gpio: Add ACPI probing support Rafael J. Wysocki
2014-10-01  8:13     ` Arnd Bergmann
2014-10-01  9:13       ` Mika Westerberg
2014-10-01 10:01         ` Arnd Bergmann
2014-10-01 11:59           ` Mika Westerberg
2014-10-01 13:52             ` Arnd Bergmann
2014-10-01 14:04               ` Mika Westerberg
2014-10-01 14:14                 ` Arnd Bergmann
2014-10-02  9:55                   ` Mika Westerberg
2014-10-02 10:44                     ` Arnd Bergmann
2014-10-01 16:30       ` Dmitry Torokhov
2014-10-01 18:11         ` Darren Hart
2014-10-01 18:21           ` Dmitry Torokhov
2014-10-01 18:22           ` Arnd Bergmann
2014-10-01  2:17   ` [PATCH v3 11/15] input: gpio_keys_polled - Add support for GPIO descriptors Rafael J. Wysocki
2014-10-01  8:13     ` Arnd Bergmann
2014-10-01  2:20   ` [PATCH v3 12/15] input: gpio_keys_polled - Make use of device property API Rafael J. Wysocki
2014-10-01  2:20   ` [PATCH v3 13/15] input: gpio_keys_polled - Add ACPI probing support Rafael J. Wysocki
2014-10-01  7:48     ` Dmitry Torokhov
2014-10-01  9:15       ` Mika Westerberg
2014-10-01 16:28         ` Dmitry Torokhov
2014-10-02  9:53           ` Mika Westerberg
2014-10-01  2:21   ` [PATCH v3 14/15] misc: at25: Make use of device property API Rafael J. Wysocki
2014-10-01  8:14     ` Arnd Bergmann
2014-10-01  2:22   ` [PATCH v3 15/15] misc: at25: Add ACPI probing support Rafael J. Wysocki
2014-10-01  8:15     ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141006143248.GE1583@lahna.fi.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=aaron.lu@intel.com \
    --cc=arnd@arndb.de \
    --cc=cooloney@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dvhart@linux.intel.com \
    --cc=gnurou@gmail.com \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome