* [PATCH 1/3] Device tree binding documentation for chromeos-firmware
[not found] <1448997171-7064-1-git-send-email-martyn.welch@collabora.co.uk>
@ 2015-12-01 19:12 ` Martyn Welch
2015-12-02 15:15 ` Rob Herring
[not found] ` <1448997171-7064-1-git-send-email-martyn.welch-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
1 sibling, 1 reply; 12+ messages in thread
From: Martyn Welch @ 2015-12-01 19:12 UTC (permalink / raw)
To: Olof Johansson
Cc: linux-kernel, Martyn Welch, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, devicetree
This patch adds documentation for the chromeos-firmware binding.
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
---
.../devicetree/bindings/misc/chromeos-firmware.txt | 27 ++++++++++++++++++++++
1 file changed, 27 insertions(+)
create mode 100644 Documentation/devicetree/bindings/misc/chromeos-firmware.txt
diff --git a/Documentation/devicetree/bindings/misc/chromeos-firmware.txt b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
new file mode 100644
index 0000000..8240611
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
@@ -0,0 +1,27 @@
+Device-Tree bindings for chromeos-firmware.c.
+
+Required properties:
+ - compatible = "google,gpio-firmware";
+
+Each signal is represented as a sub-node of "chromeos_firmware":
+Subnode properties:
+
+ - gpios: OF device-tree gpio specification.
+
+Example nodes:
+
+ chromeos_firmware {
+ compatible = "google,gpio-firmware";
+
+ write-protect {
+ gpios = <&gpx3 0 GPIO_ACTIVE_LOW>;
+ };
+
+ developer-switch {
+ gpios = <&gpx1 3 GPIO_ACTIVE_HIGH>;
+ };
+
+ recovery-switch {
+ gpios = <&gpx0 7 GPIO_ACTIVE_LOW>;
+ };
+ };
--
2.1.4
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/3] Addition of binding for firmware signals on peach-pi
[not found] ` <1448997171-7064-1-git-send-email-martyn.welch-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
@ 2015-12-01 19:12 ` Martyn Welch
2015-12-01 23:51 ` Krzysztof Kozlowski
0 siblings, 1 reply; 12+ messages in thread
From: Martyn Welch @ 2015-12-01 19:12 UTC (permalink / raw)
To: Olof Johansson
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Martyn Welch, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Russell King,
Kukjin Kim, Krzysztof Kozlowski,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA
The peach pi has a GPIO connected to the firmware write protect, developer
mode and recovery mode lines. This patch adds the required nodes to the
device tree to configure the pinmuxing and allow these to be read from
user space.
Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: Ian Campbell <ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>
Cc: Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: Kukjin Kim <kgene-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Krzysztof Kozlowski <k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Martyn Welch <martyn.welch-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
---
arch/arm/boot/dts/exynos5800-peach-pi.dts | 40 +++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/arch/arm/boot/dts/exynos5800-peach-pi.dts b/arch/arm/boot/dts/exynos5800-peach-pi.dts
index 49a4f43..485c18f 100644
--- a/arch/arm/boot/dts/exynos5800-peach-pi.dts
+++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts
@@ -53,6 +53,25 @@
};
};
+ chromeos-firmware {
+ compatible = "google,gpio-firmware";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&wp_gpio &dev_mode &rec_mode>;
+
+ write-protect {
+ gpios = <&gpx3 0 GPIO_ACTIVE_LOW>;
+ };
+
+ developer-switch {
+ gpios = <&gpx1 3 GPIO_ACTIVE_HIGH>;
+ };
+
+ recovery-switch {
+ gpios = <&gpx0 7 GPIO_ACTIVE_LOW>;
+ };
+ };
+
gpio-keys {
compatible = "gpio-keys";
@@ -731,6 +750,13 @@
samsung,pin-val = <0>;
};
+ rec_mode: rec-mode {
+ samsung,pins = "gpx0-7";
+ samsung,pin-function = <0>;
+ samsung,pin-pud = <0>;
+ samsung,pin-drv = <0>;
+ };
+
tpm_irq: tpm-irq {
samsung,pins = "gpx1-0";
samsung,pin-function = <0>;
@@ -752,6 +778,13 @@
samsung,pin-drv = <0>;
};
+ dev_mode: dev-mode {
+ samsung,pins = "gpx1-3";
+ samsung,pin-function = <0>;
+ samsung,pin-pud = <3>;
+ samsung,pin-drv = <0>;
+ };
+
ec_irq: ec-irq {
samsung,pins = "gpx1-5";
samsung,pin-function = <0>;
@@ -773,6 +806,13 @@
samsung,pin-drv = <0>;
};
+ wp_gpio: wp_gpio {
+ samsung,pins = "gpx3-0";
+ samsung,pin-function = <0>;
+ samsung,pin-pud = <0>;
+ samsung,pin-drv = <0>;
+ };
+
max77802_irq: max77802-irq {
samsung,pins = "gpx3-1";
samsung,pin-function = <0>;
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] Addition of binding for firmware signals on peach-pi
2015-12-01 19:12 ` [PATCH 3/3] Addition of binding for firmware signals on peach-pi Martyn Welch
@ 2015-12-01 23:51 ` Krzysztof Kozlowski
2015-12-02 9:36 ` Martyn Welch
0 siblings, 1 reply; 12+ messages in thread
From: Krzysztof Kozlowski @ 2015-12-01 23:51 UTC (permalink / raw)
To: Martyn Welch
Cc: Olof Johansson, linux-kernel, Rob Herring, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala, Russell King, Kukjin Kim,
devicetree, linux-arm-kernel, linux-samsung-soc
On 02.12.2015 04:12, Martyn Welch wrote:
> The peach pi has a GPIO connected to the firmware write protect, developer
> mode and recovery mode lines. This patch adds the required nodes to the
> device tree to configure the pinmuxing and allow these to be read from
> user space.
>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Pawel Moll <pawel.moll@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
> Cc: Kumar Gala <galak@codeaurora.org>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Cc: devicetree@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-samsung-soc@vger.kernel.org
> Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
> ---
> arch/arm/boot/dts/exynos5800-peach-pi.dts | 40 +++++++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
Hi,
Thanks for the patch.
Few points from my side:
1. Please add a prefix to the subject: "ARM: dts:".
2. There is no need of such huge CC-list in the body of commit. This
CC-list comes from get_maintainer so there is no benefit of duplicating
it here. The CC is usually used to notify other people who might be
interested but get_maintainer does not point them.
3. I received only this third patch. I did not receive cover letter
explaining possible dependencies so I am not sure how to deal with the
patch. It looks like there are no dependencies... but maybe there are?
Is this is a new binding or no? Please provide a cover letter (if it
exists already be sure to send it to all interested parties) or send
entire patchset so the big picture could be seen.
The patch itself looks good but I'll wait with a review tag for #3.
Best regards,
Krzysztof
>
> diff --git a/arch/arm/boot/dts/exynos5800-peach-pi.dts b/arch/arm/boot/dts/exynos5800-peach-pi.dts
> index 49a4f43..485c18f 100644
> --- a/arch/arm/boot/dts/exynos5800-peach-pi.dts
> +++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts
> @@ -53,6 +53,25 @@
> };
> };
>
> + chromeos-firmware {
> + compatible = "google,gpio-firmware";
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <&wp_gpio &dev_mode &rec_mode>;
> +
> + write-protect {
> + gpios = <&gpx3 0 GPIO_ACTIVE_LOW>;
> + };
> +
> + developer-switch {
> + gpios = <&gpx1 3 GPIO_ACTIVE_HIGH>;
> + };
> +
> + recovery-switch {
> + gpios = <&gpx0 7 GPIO_ACTIVE_LOW>;
> + };
> + };
> +
> gpio-keys {
> compatible = "gpio-keys";
>
> @@ -731,6 +750,13 @@
> samsung,pin-val = <0>;
> };
>
> + rec_mode: rec-mode {
> + samsung,pins = "gpx0-7";
> + samsung,pin-function = <0>;
> + samsung,pin-pud = <0>;
> + samsung,pin-drv = <0>;
> + };
> +
> tpm_irq: tpm-irq {
> samsung,pins = "gpx1-0";
> samsung,pin-function = <0>;
> @@ -752,6 +778,13 @@
> samsung,pin-drv = <0>;
> };
>
> + dev_mode: dev-mode {
> + samsung,pins = "gpx1-3";
> + samsung,pin-function = <0>;
> + samsung,pin-pud = <3>;
> + samsung,pin-drv = <0>;
> + };
> +
> ec_irq: ec-irq {
> samsung,pins = "gpx1-5";
> samsung,pin-function = <0>;
> @@ -773,6 +806,13 @@
> samsung,pin-drv = <0>;
> };
>
> + wp_gpio: wp_gpio {
> + samsung,pins = "gpx3-0";
> + samsung,pin-function = <0>;
> + samsung,pin-pud = <0>;
> + samsung,pin-drv = <0>;
> + };
> +
> max77802_irq: max77802-irq {
> samsung,pins = "gpx3-1";
> samsung,pin-function = <0>;
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] Addition of binding for firmware signals on peach-pi
2015-12-01 23:51 ` Krzysztof Kozlowski
@ 2015-12-02 9:36 ` Martyn Welch
2015-12-03 0:10 ` Krzysztof Kozlowski
0 siblings, 1 reply; 12+ messages in thread
From: Martyn Welch @ 2015-12-02 9:36 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Olof Johansson, linux-kernel, Rob Herring, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala, Russell King, Kukjin Kim,
devicetree, linux-arm-kernel, linux-samsung-soc
On 01/12/15 23:51, Krzysztof Kozlowski wrote:
> On 02.12.2015 04:12, Martyn Welch wrote:
>> The peach pi has a GPIO connected to the firmware write protect, developer
>> mode and recovery mode lines. This patch adds the required nodes to the
>> device tree to configure the pinmuxing and allow these to be read from
>> user space.
>>
>> Cc: Rob Herring <robh+dt@kernel.org>
>> Cc: Pawel Moll <pawel.moll@arm.com>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
>> Cc: Kumar Gala <galak@codeaurora.org>
>> Cc: Russell King <linux@arm.linux.org.uk>
>> Cc: Kukjin Kim <kgene@kernel.org>
>> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>> Cc: devicetree@vger.kernel.org
>> Cc: linux-arm-kernel@lists.infradead.org
>> Cc: linux-samsung-soc@vger.kernel.org
>> Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
>> ---
>> arch/arm/boot/dts/exynos5800-peach-pi.dts | 40 +++++++++++++++++++++++++++++++
>> 1 file changed, 40 insertions(+)
>
> Hi,
>
> Thanks for the patch.
>
> Few points from my side:
> 1. Please add a prefix to the subject: "ARM: dts:".
>
Ok, sorry.
> 2. There is no need of such huge CC-list in the body of commit. This
> CC-list comes from get_maintainer so there is no benefit of duplicating
> it here. The CC is usually used to notify other people who might be
> interested but get_maintainer does not point them.
>
Ok, yes these were pulled from get_maintainer.
> 3. I received only this third patch. I did not receive cover letter
> explaining possible dependencies so I am not sure how to deal with the
> patch. It looks like there are no dependencies... but maybe there are?
> Is this is a new binding or no? Please provide a cover letter (if it
> exists already be sure to send it to all interested parties) or send
> entire patchset so the big picture could be seen.
>
I'll make sure I do that next time.
The cover letter read:
Some Chromebooks have gpio attached to signals used to cause the
firmware to enter alternative modes of operation and/or control other
device characteristics (such as write protection on flash devices). This
patch adds a driver that exposes a read-only interface to allow these
signals to be read from user space.
In addition this patch series provides the required bindings for this to
the peach-pi Chromebook.
This is a new binding, but the driver is based on functionality in the
kernel shipped on Chromebooks. The binding has been modified based on
the form of existing bindings in the mainline kernel.
Does that help?
Martyn
> The patch itself looks good but I'll wait with a review tag for #3.
>
> Best regards,
> Krzysztof
>
>
>>
>> diff --git a/arch/arm/boot/dts/exynos5800-peach-pi.dts b/arch/arm/boot/dts/exynos5800-peach-pi.dts
>> index 49a4f43..485c18f 100644
>> --- a/arch/arm/boot/dts/exynos5800-peach-pi.dts
>> +++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts
>> @@ -53,6 +53,25 @@
>> };
>> };
>>
>> + chromeos-firmware {
>> + compatible = "google,gpio-firmware";
>> +
>> + pinctrl-names = "default";
>> + pinctrl-0 = <&wp_gpio &dev_mode &rec_mode>;
>> +
>> + write-protect {
>> + gpios = <&gpx3 0 GPIO_ACTIVE_LOW>;
>> + };
>> +
>> + developer-switch {
>> + gpios = <&gpx1 3 GPIO_ACTIVE_HIGH>;
>> + };
>> +
>> + recovery-switch {
>> + gpios = <&gpx0 7 GPIO_ACTIVE_LOW>;
>> + };
>> + };
>> +
>> gpio-keys {
>> compatible = "gpio-keys";
>>
>> @@ -731,6 +750,13 @@
>> samsung,pin-val = <0>;
>> };
>>
>> + rec_mode: rec-mode {
>> + samsung,pins = "gpx0-7";
>> + samsung,pin-function = <0>;
>> + samsung,pin-pud = <0>;
>> + samsung,pin-drv = <0>;
>> + };
>> +
>> tpm_irq: tpm-irq {
>> samsung,pins = "gpx1-0";
>> samsung,pin-function = <0>;
>> @@ -752,6 +778,13 @@
>> samsung,pin-drv = <0>;
>> };
>>
>> + dev_mode: dev-mode {
>> + samsung,pins = "gpx1-3";
>> + samsung,pin-function = <0>;
>> + samsung,pin-pud = <3>;
>> + samsung,pin-drv = <0>;
>> + };
>> +
>> ec_irq: ec-irq {
>> samsung,pins = "gpx1-5";
>> samsung,pin-function = <0>;
>> @@ -773,6 +806,13 @@
>> samsung,pin-drv = <0>;
>> };
>>
>> + wp_gpio: wp_gpio {
>> + samsung,pins = "gpx3-0";
>> + samsung,pin-function = <0>;
>> + samsung,pin-pud = <0>;
>> + samsung,pin-drv = <0>;
>> + };
>> +
>> max77802_irq: max77802-irq {
>> samsung,pins = "gpx3-1";
>> samsung,pin-function = <0>;
>>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] Device tree binding documentation for chromeos-firmware
2015-12-01 19:12 ` [PATCH 1/3] Device tree binding documentation for chromeos-firmware Martyn Welch
@ 2015-12-02 15:15 ` Rob Herring
2015-12-02 16:49 ` Martyn Welch
2015-12-03 10:14 ` Martyn Welch
0 siblings, 2 replies; 12+ messages in thread
From: Rob Herring @ 2015-12-02 15:15 UTC (permalink / raw)
To: Martyn Welch
Cc: Olof Johansson, linux-kernel, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, devicetree
On Tue, Dec 01, 2015 at 07:12:49PM +0000, Martyn Welch wrote:
> This patch adds documentation for the chromeos-firmware binding.
>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Pawel Moll <pawel.moll@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
> Cc: Kumar Gala <galak@codeaurora.org>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
> ---
> .../devicetree/bindings/misc/chromeos-firmware.txt | 27 ++++++++++++++++++++++
bindings/firmware/ please.
> 1 file changed, 27 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>
> diff --git a/Documentation/devicetree/bindings/misc/chromeos-firmware.txt b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
> new file mode 100644
> index 0000000..8240611
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
> @@ -0,0 +1,27 @@
> +Device-Tree bindings for chromeos-firmware.c.
Perhaps a bit more description what this is.
What aspect of this is firmware? How does this relate to the EC?
> +
> +Required properties:
> + - compatible = "google,gpio-firmware";
No versions?
> +
> +Each signal is represented as a sub-node of "chromeos_firmware":
> +Subnode properties:
> +
> + - gpios: OF device-tree gpio specification.
> +
> +Example nodes:
> +
> + chromeos_firmware {
This should go under /firmware
> + compatible = "google,gpio-firmware";
> +
> + write-protect {
You need to define what are valid sub nodes. The example is not
documentation.
> + gpios = <&gpx3 0 GPIO_ACTIVE_LOW>;
> + };
> +
> + developer-switch {
> + gpios = <&gpx1 3 GPIO_ACTIVE_HIGH>;
> + };
> +
> + recovery-switch {
> + gpios = <&gpx0 7 GPIO_ACTIVE_LOW>;
> + };
> + };
> --
> 2.1.4
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] Device tree binding documentation for chromeos-firmware
2015-12-02 15:15 ` Rob Herring
@ 2015-12-02 16:49 ` Martyn Welch
2015-12-02 18:44 ` Rob Herring
2015-12-03 10:14 ` Martyn Welch
1 sibling, 1 reply; 12+ messages in thread
From: Martyn Welch @ 2015-12-02 16:49 UTC (permalink / raw)
To: Rob Herring
Cc: Olof Johansson, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala,
devicetree-u79uwXL29TY76Z2rM5mHXA
On 02/12/15 15:15, Rob Herring wrote:
> On Tue, Dec 01, 2015 at 07:12:49PM +0000, Martyn Welch wrote:
>> This patch adds documentation for the chromeos-firmware binding.
>>
>> Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>> Cc: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
>> Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
>> Cc: Ian Campbell <ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>
>> Cc: Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
>> Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> Signed-off-by: Martyn Welch <martyn.welch-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
>> ---
>> .../devicetree/bindings/misc/chromeos-firmware.txt | 27 ++++++++++++++++++++++
>
> bindings/firmware/ please.
>
OK.
>> 1 file changed, 27 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>
>> diff --git a/Documentation/devicetree/bindings/misc/chromeos-firmware.txt b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>> new file mode 100644
>> index 0000000..8240611
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>> @@ -0,0 +1,27 @@
>> +Device-Tree bindings for chromeos-firmware.c.
>
> Perhaps a bit more description what this is.
>
> What aspect of this is firmware? How does this relate to the EC?
>
With respect to write-protect, this line is the write protection for the
flash which holds the bootloader.
For the developer-switch and recovery-switch, I understand that pulling
these lines low result in the stock firmware forcing the device to boot
into developer mode and recovery mode respectively. The device I have no
longer runs the stock firmware, so I'm not able to confirm this, though
I am able to drive these lines.
As far as I'm aware, none of these are related to the operation of the EC.
Will update the binding documentation.
>> +
>> +Required properties:
>> + - compatible = "google,gpio-firmware";
>
> No versions?
>
I'm not aware of any and would rather not start inventing ones that
aren't already there.
>> +
>> +Each signal is represented as a sub-node of "chromeos_firmware":
>> +Subnode properties:
>> +
>> + - gpios: OF device-tree gpio specification.
>> +
>> +Example nodes:
>> +
>> + chromeos_firmware {
>
> This should go under /firmware
Ok, will do.
>
>> + compatible = "google,gpio-firmware";
>> +
>> + write-protect {
>
> You need to define what are valid sub nodes. The example is not
> documentation.
>
Ok
>> + gpios = <&gpx3 0 GPIO_ACTIVE_LOW>;
>> + };
>> +
>> + developer-switch {
>> + gpios = <&gpx1 3 GPIO_ACTIVE_HIGH>;
>> + };
>> +
>> + recovery-switch {
>> + gpios = <&gpx0 7 GPIO_ACTIVE_LOW>;
>> + };
>> + };
>> --
>> 2.1.4
>>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] Device tree binding documentation for chromeos-firmware
2015-12-02 16:49 ` Martyn Welch
@ 2015-12-02 18:44 ` Rob Herring
[not found] ` <CAL_JsqLhoEc9M=ZUgqL1_ZFKVN+1UfL=h-mWUdri0O_bqZyf_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Rob Herring @ 2015-12-02 18:44 UTC (permalink / raw)
To: Martyn Welch
Cc: Olof Johansson, linux-kernel@vger.kernel.org, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala,
devicetree@vger.kernel.org
On Wed, Dec 2, 2015 at 10:49 AM, Martyn Welch
<martyn.welch@collabora.co.uk> wrote:
>
>
> On 02/12/15 15:15, Rob Herring wrote:
>>
>> On Tue, Dec 01, 2015 at 07:12:49PM +0000, Martyn Welch wrote:
>>>
>>> This patch adds documentation for the chromeos-firmware binding.
>>>
>>> Cc: Rob Herring <robh+dt@kernel.org>
>>> Cc: Pawel Moll <pawel.moll@arm.com>
>>> Cc: Mark Rutland <mark.rutland@arm.com>
>>> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
>>> Cc: Kumar Gala <galak@codeaurora.org>
>>> Cc: devicetree@vger.kernel.org
>>> Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
>>> ---
>>> .../devicetree/bindings/misc/chromeos-firmware.txt | 27
>>> ++++++++++++++++++++++
>>
>>
>> bindings/firmware/ please.
>>
>
> OK.
>
>>> 1 file changed, 27 insertions(+)
>>> create mode 100644
>>> Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>> b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>> new file mode 100644
>>> index 0000000..8240611
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>> @@ -0,0 +1,27 @@
>>> +Device-Tree bindings for chromeos-firmware.c.
>>
>>
>> Perhaps a bit more description what this is.
>>
>> What aspect of this is firmware? How does this relate to the EC?
>>
>
> With respect to write-protect, this line is the write protection for the
> flash which holds the bootloader.
What is driving the write-protect? Are trying to assign ownership of
the SOC GPIOs to the bootloader/firmware? If so, I think this is all
wrong.
Rob
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] Device tree binding documentation for chromeos-firmware
[not found] ` <CAL_JsqLhoEc9M=ZUgqL1_ZFKVN+1UfL=h-mWUdri0O_bqZyf_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-12-02 21:47 ` Martyn Welch
0 siblings, 0 replies; 12+ messages in thread
From: Martyn Welch @ 2015-12-02 21:47 UTC (permalink / raw)
To: Rob Herring
Cc: Olof Johansson,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
On 02/12/15 18:44, Rob Herring wrote:
> On Wed, Dec 2, 2015 at 10:49 AM, Martyn Welch
> <martyn.welch-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org> wrote:
>>
>>
>> On 02/12/15 15:15, Rob Herring wrote:
>>>
>>> On Tue, Dec 01, 2015 at 07:12:49PM +0000, Martyn Welch wrote:
>>>>
>>>> This patch adds documentation for the chromeos-firmware binding.
>>>>
>>>> Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>>>> Cc: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
>>>> Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
>>>> Cc: Ian Campbell <ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>
>>>> Cc: Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
>>>> Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>>>> Signed-off-by: Martyn Welch <martyn.welch-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
>>>> ---
>>>> .../devicetree/bindings/misc/chromeos-firmware.txt | 27
>>>> ++++++++++++++++++++++
>>>
>>>
>>> bindings/firmware/ please.
>>>
>>
>> OK.
>>
>>>> 1 file changed, 27 insertions(+)
>>>> create mode 100644
>>>> Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>>> b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>>> new file mode 100644
>>>> index 0000000..8240611
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>>> @@ -0,0 +1,27 @@
>>>> +Device-Tree bindings for chromeos-firmware.c.
>>>
>>>
>>> Perhaps a bit more description what this is.
>>>
>>> What aspect of this is firmware? How does this relate to the EC?
>>>
>>
>> With respect to write-protect, this line is the write protection for the
>> flash which holds the bootloader.
>
> What is driving the write-protect? Are trying to assign ownership of
> the SOC GPIOs to the bootloader/firmware? If so, I think this is all
> wrong.
>
The lines are typically driven by a debugging board plugged into a
socket on the Chromebooks motherboard, not by the device it's self. The
driver exposes a read-only interface to these signals.
Martyn
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/3] Addition of binding for firmware signals on peach-pi
2015-12-02 9:36 ` Martyn Welch
@ 2015-12-03 0:10 ` Krzysztof Kozlowski
0 siblings, 0 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2015-12-03 0:10 UTC (permalink / raw)
To: Martyn Welch
Cc: Olof Johansson, linux-kernel, Rob Herring, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala, Russell King, Kukjin Kim,
devicetree, linux-arm-kernel, linux-samsung-soc
On 02.12.2015 18:36, Martyn Welch wrote:
>
>
> On 01/12/15 23:51, Krzysztof Kozlowski wrote:
>> On 02.12.2015 04:12, Martyn Welch wrote:
>>> The peach pi has a GPIO connected to the firmware write protect,
>>> developer
>>> mode and recovery mode lines. This patch adds the required nodes to the
>>> device tree to configure the pinmuxing and allow these to be read from
>>> user space.
>>>
>>> Cc: Rob Herring <robh+dt@kernel.org>
>>> Cc: Pawel Moll <pawel.moll@arm.com>
>>> Cc: Mark Rutland <mark.rutland@arm.com>
>>> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
>>> Cc: Kumar Gala <galak@codeaurora.org>
>>> Cc: Russell King <linux@arm.linux.org.uk>
>>> Cc: Kukjin Kim <kgene@kernel.org>
>>> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>>> Cc: devicetree@vger.kernel.org
>>> Cc: linux-arm-kernel@lists.infradead.org
>>> Cc: linux-samsung-soc@vger.kernel.org
>>> Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
>>> ---
>>> arch/arm/boot/dts/exynos5800-peach-pi.dts | 40
>>> +++++++++++++++++++++++++++++++
>>> 1 file changed, 40 insertions(+)
>>
>> Hi,
>>
>> Thanks for the patch.
>>
>> Few points from my side:
>> 1. Please add a prefix to the subject: "ARM: dts:".
>>
>
> Ok, sorry.
>
>> 2. There is no need of such huge CC-list in the body of commit. This
>> CC-list comes from get_maintainer so there is no benefit of duplicating
>> it here. The CC is usually used to notify other people who might be
>> interested but get_maintainer does not point them.
>>
>
> Ok, yes these were pulled from get_maintainer.
>
>> 3. I received only this third patch. I did not receive cover letter
>> explaining possible dependencies so I am not sure how to deal with the
>> patch. It looks like there are no dependencies... but maybe there are?
>> Is this is a new binding or no? Please provide a cover letter (if it
>> exists already be sure to send it to all interested parties) or send
>> entire patchset so the big picture could be seen.
>>
>
> I'll make sure I do that next time.
>
> The cover letter read:
>
> Some Chromebooks have gpio attached to signals used to cause the
> firmware to enter alternative modes of operation and/or control other
> device characteristics (such as write protection on flash devices). This
> patch adds a driver that exposes a read-only interface to allow these
> signals to be read from user space.
>
> In addition this patch series provides the required bindings for this to
> the peach-pi Chromebook.
>
>
> This is a new binding, but the driver is based on functionality in the
> kernel shipped on Chromebooks. The binding has been modified based on
> the form of existing bindings in the mainline kernel.
>
> Does that help?
Yes, that helps. With the changes above (subject and reduced CC-line in
commit message):
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
As there are no dependencies this should go through samsung-soc. Just
let us know about DT bindings being accepted/applied.
Best regards,
Krzysztof
>
> Martyn
>
>> The patch itself looks good but I'll wait with a review tag for #3.
>>
>> Best regards,
>> Krzysztof
>>
>>
>>>
>>> diff --git a/arch/arm/boot/dts/exynos5800-peach-pi.dts
>>> b/arch/arm/boot/dts/exynos5800-peach-pi.dts
>>> index 49a4f43..485c18f 100644
>>> --- a/arch/arm/boot/dts/exynos5800-peach-pi.dts
>>> +++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts
>>> @@ -53,6 +53,25 @@
>>> };
>>> };
>>>
>>> + chromeos-firmware {
>>> + compatible = "google,gpio-firmware";
>>> +
>>> + pinctrl-names = "default";
>>> + pinctrl-0 = <&wp_gpio &dev_mode &rec_mode>;
>>> +
>>> + write-protect {
>>> + gpios = <&gpx3 0 GPIO_ACTIVE_LOW>;
>>> + };
>>> +
>>> + developer-switch {
>>> + gpios = <&gpx1 3 GPIO_ACTIVE_HIGH>;
>>> + };
>>> +
>>> + recovery-switch {
>>> + gpios = <&gpx0 7 GPIO_ACTIVE_LOW>;
>>> + };
>>> + };
>>> +
>>> gpio-keys {
>>> compatible = "gpio-keys";
>>>
>>> @@ -731,6 +750,13 @@
>>> samsung,pin-val = <0>;
>>> };
>>>
>>> + rec_mode: rec-mode {
>>> + samsung,pins = "gpx0-7";
>>> + samsung,pin-function = <0>;
>>> + samsung,pin-pud = <0>;
>>> + samsung,pin-drv = <0>;
>>> + };
>>> +
>>> tpm_irq: tpm-irq {
>>> samsung,pins = "gpx1-0";
>>> samsung,pin-function = <0>;
>>> @@ -752,6 +778,13 @@
>>> samsung,pin-drv = <0>;
>>> };
>>>
>>> + dev_mode: dev-mode {
>>> + samsung,pins = "gpx1-3";
>>> + samsung,pin-function = <0>;
>>> + samsung,pin-pud = <3>;
>>> + samsung,pin-drv = <0>;
>>> + };
>>> +
>>> ec_irq: ec-irq {
>>> samsung,pins = "gpx1-5";
>>> samsung,pin-function = <0>;
>>> @@ -773,6 +806,13 @@
>>> samsung,pin-drv = <0>;
>>> };
>>>
>>> + wp_gpio: wp_gpio {
>>> + samsung,pins = "gpx3-0";
>>> + samsung,pin-function = <0>;
>>> + samsung,pin-pud = <0>;
>>> + samsung,pin-drv = <0>;
>>> + };
>>> +
>>> max77802_irq: max77802-irq {
>>> samsung,pins = "gpx3-1";
>>> samsung,pin-function = <0>;
>>>
>>
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] Device tree binding documentation for chromeos-firmware
2015-12-02 15:15 ` Rob Herring
2015-12-02 16:49 ` Martyn Welch
@ 2015-12-03 10:14 ` Martyn Welch
2015-12-03 15:08 ` Rob Herring
1 sibling, 1 reply; 12+ messages in thread
From: Martyn Welch @ 2015-12-03 10:14 UTC (permalink / raw)
To: Rob Herring
Cc: Olof Johansson, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Frank Rowand,
Grant Likely
On 02/12/15 15:15, Rob Herring wrote:
> On Tue, Dec 01, 2015 at 07:12:49PM +0000, Martyn Welch wrote:
>> This patch adds documentation for the chromeos-firmware binding.
>>
>> Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>> Cc: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
>> Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
>> Cc: Ian Campbell <ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>
>> Cc: Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
>> Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> Signed-off-by: Martyn Welch <martyn.welch-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
>> ---
>> .../devicetree/bindings/misc/chromeos-firmware.txt | 27 ++++++++++++++++++++++
>
> bindings/firmware/ please.
>
>> 1 file changed, 27 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>
>> diff --git a/Documentation/devicetree/bindings/misc/chromeos-firmware.txt b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>> new file mode 100644
>> index 0000000..8240611
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>> @@ -0,0 +1,27 @@
<snip>
>> +
>> +Each signal is represented as a sub-node of "chromeos_firmware":
>> +Subnode properties:
>> +
>> + - gpios: OF device-tree gpio specification.
>> +
>> +Example nodes:
>> +
>> + chromeos_firmware {
>
> This should go under /firmware
>
I've changed this to be:
firmware {
chromeos {
...
};
];
Which I generally accept (assuming this is considered a part of the
firmware) as a better way to represent this in the device tree, however
this has the nasty side effect of causing the device tree parsing to
avoid parsing the chromeos child and seeing it's compatible property (as
the firmware node isn't a bus), resulting in the probe routine not being
called.
If I add a 'compatible = "simple-bus"' property to the firmware node it
works, but this doesn't seem quite right as I believe "simple-bus" is
defined as a "simple memory mapped bus".
I /could/ rewrite the initialisation to call of_find_compatible_node(),
but this seems rather hacky and inefficient. I can think of 2 other ways
this could be resolved:
(1) As this is only tangentially related to firmware, I rename it
something like "chromeos-signals" and make it it's own node. In essence
this driver provides a mechanism built on top of specific GPIO (ala
gpio-keys seems to be, after-all this has a similar use of resources to
that).
(2) Add a compatible string something like 'compatible="logical-group";'
to the firmware node and add that too the bus matching logic. This would
have the advantage of solving this in the general case (I guess there
are other instances where a grouping of things more logically rather
than physically connected would ideally be grouped together), though I
expect there may be some strong views regarding this approach.
Would either of those be acceptable or is there a better way of
resolving this that I've missed?
Martyn
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] Device tree binding documentation for chromeos-firmware
2015-12-03 10:14 ` Martyn Welch
@ 2015-12-03 15:08 ` Rob Herring
[not found] ` <CAL_JsqJGk5_Nk7joSHfJXxcVrpHDBbawY=nPOrOiraWinuka4w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 12+ messages in thread
From: Rob Herring @ 2015-12-03 15:08 UTC (permalink / raw)
To: Martyn Welch
Cc: Olof Johansson, linux-kernel@vger.kernel.org, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala,
devicetree@vger.kernel.org, Frank Rowand, Grant Likely
On Thu, Dec 3, 2015 at 4:14 AM, Martyn Welch
<martyn.welch@collabora.co.uk> wrote:
>
> On 02/12/15 15:15, Rob Herring wrote:
>>
>> On Tue, Dec 01, 2015 at 07:12:49PM +0000, Martyn Welch wrote:
>>>
>>> This patch adds documentation for the chromeos-firmware binding.
>>>
>>> Cc: Rob Herring <robh+dt@kernel.org>
>>> Cc: Pawel Moll <pawel.moll@arm.com>
>>> Cc: Mark Rutland <mark.rutland@arm.com>
>>> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
>>> Cc: Kumar Gala <galak@codeaurora.org>
>>> Cc: devicetree@vger.kernel.org
>>> Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
>>> ---
>>> .../devicetree/bindings/misc/chromeos-firmware.txt | 27
>>> ++++++++++++++++++++++
>>
>>
>> bindings/firmware/ please.
>>
>>> 1 file changed, 27 insertions(+)
>>> create mode 100644
>>> Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>> b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>> new file mode 100644
>>> index 0000000..8240611
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>> @@ -0,0 +1,27 @@
>
>
> <snip>
>
>>> +
>>> +Each signal is represented as a sub-node of "chromeos_firmware":
>>> +Subnode properties:
>>> +
>>> + - gpios: OF device-tree gpio specification.
>>> +
>>> +Example nodes:
>>> +
>>> + chromeos_firmware {
>>
>>
>> This should go under /firmware
>>
>
> I've changed this to be:
>
> firmware {
> chromeos {
> ...
> };
> ];
>
> Which I generally accept (assuming this is considered a part of the
> firmware) as a better way to represent this in the device tree, however this
> has the nasty side effect of causing the device tree parsing to avoid
> parsing the chromeos child and seeing it's compatible property (as the
> firmware node isn't a bus), resulting in the probe routine not being called.
>
> If I add a 'compatible = "simple-bus"' property to the firmware node it
> works, but this doesn't seem quite right as I believe "simple-bus" is
> defined as a "simple memory mapped bus".
>
> I /could/ rewrite the initialisation to call of_find_compatible_node(), but
> this seems rather hacky and inefficient. I can think of 2 other ways this
> could be resolved:
>
> (1) As this is only tangentially related to firmware, I rename it something
> like "chromeos-signals" and make it it's own node. In essence this driver
> provides a mechanism built on top of specific GPIO (ala gpio-keys seems to
> be, after-all this has a similar use of resources to that).
I'm starting to fail to understand the relationship to firmware here...
gpio-keys are at least a thing (being a key or set of keys). Your
grouping is a rather random collection of GPIOs. Maybe you need
"gpio-switch" binding and then the function would be "label" property.
> (2) Add a compatible string something like 'compatible="logical-group";' to
> the firmware node and add that too the bus matching logic. This would have
> the advantage of solving this in the general case (I guess there are other
> instances where a grouping of things more logically rather than physically
> connected would ideally be grouped together), though I expect there may be
> some strong views regarding this approach.
Why do you need them grouped?
> Would either of those be acceptable or is there a better way of resolving
> this that I've missed?
I don't know as I still don't really understand what the h/w looks like here.
Rob
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/3] Device tree binding documentation for chromeos-firmware
[not found] ` <CAL_JsqJGk5_Nk7joSHfJXxcVrpHDBbawY=nPOrOiraWinuka4w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-12-03 16:11 ` Martyn Welch
0 siblings, 0 replies; 12+ messages in thread
From: Martyn Welch @ 2015-12-03 16:11 UTC (permalink / raw)
To: Rob Herring
Cc: Olof Johansson,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Pawel Moll,
Mark Rutland, Ian Campbell, Kumar Gala,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Frank Rowand,
Grant Likely
On 03/12/15 15:08, Rob Herring wrote:
> On Thu, Dec 3, 2015 at 4:14 AM, Martyn Welch
> <martyn.welch-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org> wrote:
>>
>> On 02/12/15 15:15, Rob Herring wrote:
>>>
>>> On Tue, Dec 01, 2015 at 07:12:49PM +0000, Martyn Welch wrote:
>>>>
>>>> This patch adds documentation for the chromeos-firmware binding.
>>>>
>>>> Cc: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>>>> Cc: Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>
>>>> Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
>>>> Cc: Ian Campbell <ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>
>>>> Cc: Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
>>>> Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>>>> Signed-off-by: Martyn Welch <martyn.welch-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
>>>> ---
>>>> .../devicetree/bindings/misc/chromeos-firmware.txt | 27
>>>> ++++++++++++++++++++++
>>>
>>>
>>> bindings/firmware/ please.
>>>
>>>> 1 file changed, 27 insertions(+)
>>>> create mode 100644
>>>> Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>>> b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>>> new file mode 100644
>>>> index 0000000..8240611
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/misc/chromeos-firmware.txt
>>>> @@ -0,0 +1,27 @@
>>
>>
>> <snip>
>>
>>>> +
>>>> +Each signal is represented as a sub-node of "chromeos_firmware":
>>>> +Subnode properties:
>>>> +
>>>> + - gpios: OF device-tree gpio specification.
>>>> +
>>>> +Example nodes:
>>>> +
>>>> + chromeos_firmware {
>>>
>>>
>>> This should go under /firmware
>>>
>>
>> I've changed this to be:
>>
>> firmware {
>> chromeos {
>> ...
>> };
>> ];
>>
>> Which I generally accept (assuming this is considered a part of the
>> firmware) as a better way to represent this in the device tree, however this
>> has the nasty side effect of causing the device tree parsing to avoid
>> parsing the chromeos child and seeing it's compatible property (as the
>> firmware node isn't a bus), resulting in the probe routine not being called.
>>
>> If I add a 'compatible = "simple-bus"' property to the firmware node it
>> works, but this doesn't seem quite right as I believe "simple-bus" is
>> defined as a "simple memory mapped bus".
>>
>> I /could/ rewrite the initialisation to call of_find_compatible_node(), but
>> this seems rather hacky and inefficient. I can think of 2 other ways this
>> could be resolved:
>>
>> (1) As this is only tangentially related to firmware, I rename it something
>> like "chromeos-signals" and make it it's own node. In essence this driver
>> provides a mechanism built on top of specific GPIO (ala gpio-keys seems to
>> be, after-all this has a similar use of resources to that).
>
> I'm starting to fail to understand the relationship to firmware here...
>
> gpio-keys are at least a thing (being a key or set of keys). Your
> grouping is a rather random collection of GPIOs. Maybe you need
> "gpio-switch" binding and then the function would be "label" property.
>
So, something like this:
gpio-switch {
compatible = "gpio-switch";
pinctrl-names = "default";
pinctrl-0 = <&wp_gpio &dev_mode &rec_mode>;
write-protect {
label = "write-protect";
gpios = <&gpx3 0 GPIO_ACTIVE_LOW>;
read-only;
};
developer-switch {
label = "developer-switch";
gpios = <&gpx1 3 GPIO_ACTIVE_HIGH>;
read-only;
};
recovery-switch {
label = "recovery-switch";
gpios = <&gpx0 7 GPIO_ACTIVE_LOW>;
read-only;
};
};
(Making it much more generic in the process.)
>> (2) Add a compatible string something like 'compatible="logical-group";' to
>> the firmware node and add that too the bus matching logic. This would have
>> the advantage of solving this in the general case (I guess there are other
>> instances where a grouping of things more logically rather than physically
>> connected would ideally be grouped together), though I expect there may be
>> some strong views regarding this approach.
>
> Why do you need them grouped?
>
That's effectively what is achieved by putting this (and I assume
anything else considered "firmware" under a firmware node isn't it? (or
and I miss-understanding your request?)
I think it is a moot point, I'll rework as you've suggested.
Martyn
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-12-03 16:11 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1448997171-7064-1-git-send-email-martyn.welch@collabora.co.uk>
2015-12-01 19:12 ` [PATCH 1/3] Device tree binding documentation for chromeos-firmware Martyn Welch
2015-12-02 15:15 ` Rob Herring
2015-12-02 16:49 ` Martyn Welch
2015-12-02 18:44 ` Rob Herring
[not found] ` <CAL_JsqLhoEc9M=ZUgqL1_ZFKVN+1UfL=h-mWUdri0O_bqZyf_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-02 21:47 ` Martyn Welch
2015-12-03 10:14 ` Martyn Welch
2015-12-03 15:08 ` Rob Herring
[not found] ` <CAL_JsqJGk5_Nk7joSHfJXxcVrpHDBbawY=nPOrOiraWinuka4w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-03 16:11 ` Martyn Welch
[not found] ` <1448997171-7064-1-git-send-email-martyn.welch-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
2015-12-01 19:12 ` [PATCH 3/3] Addition of binding for firmware signals on peach-pi Martyn Welch
2015-12-01 23:51 ` Krzysztof Kozlowski
2015-12-02 9:36 ` Martyn Welch
2015-12-03 0:10 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).