* [PATCH 1/4] dt-bindings: syscon: Add syscon endian properties support
[not found] <20200306130341.9585-1-Sergey.Semin@baikalelectronics.ru>
@ 2020-03-06 13:03 ` Sergey.Semin
2020-03-12 21:11 ` Rob Herring
2020-03-06 13:03 ` [PATCH 2/4] dt-bindings: power: reset: Replace SYSCON reboot-mode legacy bindings with YAML-based one Sergey.Semin
2020-03-06 13:03 ` [PATCH 3/4] dt-bindings: power: reset: Add regmap support to the SYSCON reboot-mode bindings Sergey.Semin
2 siblings, 1 reply; 17+ messages in thread
From: Sergey.Semin @ 2020-03-06 13:03 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Mark Rutland
Cc: Serge Semin, Serge Semin, Alexey Malahov, Thomas Bogendoerfer,
Paul Burton, Ralf Baechle, devicetree, linux-kernel
From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
In accordance with the syscon-driver (drivers/mfd/syscon.c) the syscon
dts-nodes may accept endian properties of the boolean type: little-endian,
big-endian, native-endian. Lets make sure that syscon bindings json-schema
also supports them.
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
---
Documentation/devicetree/bindings/mfd/syscon.yaml | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
index 39375e4313d2..9ee404991533 100644
--- a/Documentation/devicetree/bindings/mfd/syscon.yaml
+++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
@@ -61,6 +61,11 @@ properties:
description:
Reference to a phandle of a hardware spinlock provider node.
+patternProperties:
+ "^(big|little|native)-endian$":
+ $ref: /schemas/types.yaml#/definitions/flag
+ description: Bytes order of the system controller memory space.
+
required:
- compatible
- reg
@@ -81,4 +86,13 @@ examples:
hwlocks = <&hwlock1 1>;
};
+ - |
+ cpu_ctl: cpu@1F04D02C {
+ compatible = "syscon";
+ reg = <0x1F04D02C 0x004>;
+
+ little-endian;
+ reg-io-width = <4>;
+ };
+
...
--
2.25.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/4] dt-bindings: power: reset: Replace SYSCON reboot-mode legacy bindings with YAML-based one
[not found] <20200306130341.9585-1-Sergey.Semin@baikalelectronics.ru>
2020-03-06 13:03 ` [PATCH 1/4] dt-bindings: syscon: Add syscon endian properties support Sergey.Semin
@ 2020-03-06 13:03 ` Sergey.Semin
2020-03-06 19:56 ` Sebastian Reichel
` (2 more replies)
2020-03-06 13:03 ` [PATCH 3/4] dt-bindings: power: reset: Add regmap support to the SYSCON reboot-mode bindings Sergey.Semin
2 siblings, 3 replies; 17+ messages in thread
From: Sergey.Semin @ 2020-03-06 13:03 UTC (permalink / raw)
To: Sebastian Reichel, Rob Herring, Mark Rutland
Cc: Serge Semin, Serge Semin, Alexey Malahov, Thomas Bogendoerfer,
Paul Burton, Ralf Baechle, linux-pm, devicetree, linux-kernel
From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Modern device tree bindings are supposed to be created as YAML-files
in accordance with dt-schema. This commit replaces SYSCON reboot-mode
legacy bare text bindings with YAML file. As before the bindings file
states that the corresponding dts node is supposed to be compatible
"syscon-reboot-mode" device and necessarily have an offset property
to determine which register from the regmap is supposed to keep the
mode on reboot.
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
---
.../power/reset/syscon-reboot-mode.txt | 35 ------------
.../power/reset/syscon-reboot-mode.yaml | 55 +++++++++++++++++++
2 files changed, 55 insertions(+), 35 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt
create mode 100644 Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt
deleted file mode 100644
index f7ce1d8af04a..000000000000
--- a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-SYSCON reboot mode driver
-
-This driver gets reboot mode magic value form reboot-mode driver
-and stores it in a SYSCON mapped register. Then the bootloader
-can read it and take different action according to the magic
-value stored.
-
-This DT node should be represented as a sub-node of a "syscon", "simple-mfd"
-node.
-
-Required properties:
-- compatible: should be "syscon-reboot-mode"
-- offset: offset in the register map for the storage register (in bytes)
-
-Optional property:
-- mask: bits mask of the bits in the register to store the reboot mode magic value,
- default set to 0xffffffff if missing.
-
-The rest of the properties should follow the generic reboot-mode description
-found in reboot-mode.txt
-
-Example:
- pmu: pmu@20004000 {
- compatible = "rockchip,rk3066-pmu", "syscon", "simple-mfd";
- reg = <0x20004000 0x100>;
-
- reboot-mode {
- compatible = "syscon-reboot-mode";
- offset = <0x40>;
- mode-normal = <BOOT_NORMAL>;
- mode-recovery = <BOOT_RECOVERY>;
- mode-bootloader = <BOOT_FASTBOOT>;
- mode-loader = <BOOT_BL_DOWNLOAD>;
- };
- };
diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
new file mode 100644
index 000000000000..e09bb07b1abb
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/reset/syscon-reboot-mode.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic SYSCON reboot mode driver
+
+maintainers:
+ - Sebastian Reichel <sre@kernel.org>
+
+description: |
+ This driver gets reboot mode magic value from reboot-mode driver
+ and stores it in a SYSCON mapped register. Then the bootloader
+ can read it and take different action according to the magic
+ value stored. The SYSCON mapped register is retrieved from the
+ parental dt-node plus the offset. So the SYSCON reboot-mode node
+ should be represented as a sub-node of a "syscon", "simple-mfd" node.
+
+properties:
+ compatible:
+ const: syscon-reboot-mode
+
+ mask:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: Update only the register bits defined by the mask (32 bit).
+
+ offset:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: Offset in the register map for the mode register (in bytes).
+
+patternProperties:
+ "^mode-.+":
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: Vendor-specific mode value written to the mode register.
+
+additionalProperties: false
+
+required:
+ - compatible
+ - offset
+
+examples:
+ - |
+ #include <dt-bindings/soc/rockchip,boot-mode.h>
+
+ reboot-mode {
+ compatible = "syscon-reboot-mode";
+ offset = <0x40>;
+ mode-normal = <BOOT_NORMAL>;
+ mode-recovery = <BOOT_RECOVERY>;
+ mode-bootloader = <BOOT_FASTBOOT>;
+ mode-loader = <BOOT_BL_DOWNLOAD>;
+ };
+...
--
2.25.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 3/4] dt-bindings: power: reset: Add regmap support to the SYSCON reboot-mode bindings
[not found] <20200306130341.9585-1-Sergey.Semin@baikalelectronics.ru>
2020-03-06 13:03 ` [PATCH 1/4] dt-bindings: syscon: Add syscon endian properties support Sergey.Semin
2020-03-06 13:03 ` [PATCH 2/4] dt-bindings: power: reset: Replace SYSCON reboot-mode legacy bindings with YAML-based one Sergey.Semin
@ 2020-03-06 13:03 ` Sergey.Semin
2020-03-06 19:57 ` Sebastian Reichel
2020-03-12 21:14 ` Rob Herring
2 siblings, 2 replies; 17+ messages in thread
From: Sergey.Semin @ 2020-03-06 13:03 UTC (permalink / raw)
To: Sebastian Reichel, Rob Herring, Mark Rutland
Cc: Serge Semin, Serge Semin, Alexey Malahov, Thomas Bogendoerfer,
Paul Burton, Ralf Baechle, linux-pm, devicetree, linux-kernel
From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Optional regmap property will be used to refer to a syscon-controller
having a reboot tolerant register mapped.
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
---
.../bindings/power/reset/syscon-reboot-mode.yaml | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
index e09bb07b1abb..f47bf52ad983 100644
--- a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
+++ b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
@@ -13,9 +13,8 @@ description: |
This driver gets reboot mode magic value from reboot-mode driver
and stores it in a SYSCON mapped register. Then the bootloader
can read it and take different action according to the magic
- value stored. The SYSCON mapped register is retrieved from the
- parental dt-node plus the offset. So the SYSCON reboot-mode node
- should be represented as a sub-node of a "syscon", "simple-mfd" node.
+ value stored. The SYSCON mapped register is retrieved either from
+ the parental dt-node or from a regmap phandle plus the offset.
properties:
compatible:
@@ -29,6 +28,10 @@ properties:
$ref: /schemas/types.yaml#/definitions/uint32
description: Offset in the register map for the mode register (in bytes).
+ regmap:
+ $ref: /schemas/types.yaml#/definitions/phandle
+ description: Phandle to the register map node.
+
patternProperties:
"^mode-.+":
$ref: /schemas/types.yaml#/definitions/uint32
--
2.25.1
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 2/4] dt-bindings: power: reset: Replace SYSCON reboot-mode legacy bindings with YAML-based one
2020-03-06 13:03 ` [PATCH 2/4] dt-bindings: power: reset: Replace SYSCON reboot-mode legacy bindings with YAML-based one Sergey.Semin
@ 2020-03-06 19:56 ` Sebastian Reichel
[not found] ` <20200306200551.49C47803087C@mail.baikalelectronics.ru>
2020-03-12 21:12 ` Rob Herring
2 siblings, 0 replies; 17+ messages in thread
From: Sebastian Reichel @ 2020-03-06 19:56 UTC (permalink / raw)
To: Sergey.Semin
Cc: Rob Herring, Mark Rutland, Serge Semin, Alexey Malahov,
Thomas Bogendoerfer, Paul Burton, Ralf Baechle, linux-pm,
devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 5100 bytes --]
Hi,
On Fri, Mar 06, 2020 at 04:03:39PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
>
> Modern device tree bindings are supposed to be created as YAML-files
> in accordance with dt-schema. This commit replaces SYSCON reboot-mode
> legacy bare text bindings with YAML file. As before the bindings file
> states that the corresponding dts node is supposed to be compatible
> "syscon-reboot-mode" device and necessarily have an offset property
> to determine which register from the regmap is supposed to keep the
> mode on reboot.
>
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: Paul Burton <paulburton@kernel.org>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> ---
I'm missing patch 1 and would like an Acked-by from Rob Herring, so
for now:
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-- Sebastian
> .../power/reset/syscon-reboot-mode.txt | 35 ------------
> .../power/reset/syscon-reboot-mode.yaml | 55 +++++++++++++++++++
> 2 files changed, 55 insertions(+), 35 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt
> create mode 100644 Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
>
> diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt
> deleted file mode 100644
> index f7ce1d8af04a..000000000000
> --- a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -SYSCON reboot mode driver
> -
> -This driver gets reboot mode magic value form reboot-mode driver
> -and stores it in a SYSCON mapped register. Then the bootloader
> -can read it and take different action according to the magic
> -value stored.
> -
> -This DT node should be represented as a sub-node of a "syscon", "simple-mfd"
> -node.
> -
> -Required properties:
> -- compatible: should be "syscon-reboot-mode"
> -- offset: offset in the register map for the storage register (in bytes)
> -
> -Optional property:
> -- mask: bits mask of the bits in the register to store the reboot mode magic value,
> - default set to 0xffffffff if missing.
> -
> -The rest of the properties should follow the generic reboot-mode description
> -found in reboot-mode.txt
> -
> -Example:
> - pmu: pmu@20004000 {
> - compatible = "rockchip,rk3066-pmu", "syscon", "simple-mfd";
> - reg = <0x20004000 0x100>;
> -
> - reboot-mode {
> - compatible = "syscon-reboot-mode";
> - offset = <0x40>;
> - mode-normal = <BOOT_NORMAL>;
> - mode-recovery = <BOOT_RECOVERY>;
> - mode-bootloader = <BOOT_FASTBOOT>;
> - mode-loader = <BOOT_BL_DOWNLOAD>;
> - };
> - };
> diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> new file mode 100644
> index 000000000000..e09bb07b1abb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> @@ -0,0 +1,55 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/power/reset/syscon-reboot-mode.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Generic SYSCON reboot mode driver
> +
> +maintainers:
> + - Sebastian Reichel <sre@kernel.org>
> +
> +description: |
> + This driver gets reboot mode magic value from reboot-mode driver
> + and stores it in a SYSCON mapped register. Then the bootloader
> + can read it and take different action according to the magic
> + value stored. The SYSCON mapped register is retrieved from the
> + parental dt-node plus the offset. So the SYSCON reboot-mode node
> + should be represented as a sub-node of a "syscon", "simple-mfd" node.
> +
> +properties:
> + compatible:
> + const: syscon-reboot-mode
> +
> + mask:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: Update only the register bits defined by the mask (32 bit).
> +
> + offset:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: Offset in the register map for the mode register (in bytes).
> +
> +patternProperties:
> + "^mode-.+":
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description: Vendor-specific mode value written to the mode register.
> +
> +additionalProperties: false
> +
> +required:
> + - compatible
> + - offset
> +
> +examples:
> + - |
> + #include <dt-bindings/soc/rockchip,boot-mode.h>
> +
> + reboot-mode {
> + compatible = "syscon-reboot-mode";
> + offset = <0x40>;
> + mode-normal = <BOOT_NORMAL>;
> + mode-recovery = <BOOT_RECOVERY>;
> + mode-bootloader = <BOOT_FASTBOOT>;
> + mode-loader = <BOOT_BL_DOWNLOAD>;
> + };
> +...
> --
> 2.25.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/4] dt-bindings: power: reset: Add regmap support to the SYSCON reboot-mode bindings
2020-03-06 13:03 ` [PATCH 3/4] dt-bindings: power: reset: Add regmap support to the SYSCON reboot-mode bindings Sergey.Semin
@ 2020-03-06 19:57 ` Sebastian Reichel
2020-03-12 21:14 ` Rob Herring
1 sibling, 0 replies; 17+ messages in thread
From: Sebastian Reichel @ 2020-03-06 19:57 UTC (permalink / raw)
To: Sergey.Semin
Cc: Rob Herring, Mark Rutland, Serge Semin, Alexey Malahov,
Thomas Bogendoerfer, Paul Burton, Ralf Baechle, linux-pm,
devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2190 bytes --]
Hi,
On Fri, Mar 06, 2020 at 04:03:40PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
>
> Optional regmap property will be used to refer to a syscon-controller
> having a reboot tolerant register mapped.
>
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: Paul Burton <paulburton@kernel.org>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> ---
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-- Sebastian
> .../bindings/power/reset/syscon-reboot-mode.yaml | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> index e09bb07b1abb..f47bf52ad983 100644
> --- a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> +++ b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> @@ -13,9 +13,8 @@ description: |
> This driver gets reboot mode magic value from reboot-mode driver
> and stores it in a SYSCON mapped register. Then the bootloader
> can read it and take different action according to the magic
> - value stored. The SYSCON mapped register is retrieved from the
> - parental dt-node plus the offset. So the SYSCON reboot-mode node
> - should be represented as a sub-node of a "syscon", "simple-mfd" node.
> + value stored. The SYSCON mapped register is retrieved either from
> + the parental dt-node or from a regmap phandle plus the offset.
>
> properties:
> compatible:
> @@ -29,6 +28,10 @@ properties:
> $ref: /schemas/types.yaml#/definitions/uint32
> description: Offset in the register map for the mode register (in bytes).
>
> + regmap:
> + $ref: /schemas/types.yaml#/definitions/phandle
> + description: Phandle to the register map node.
> +
> patternProperties:
> "^mode-.+":
> $ref: /schemas/types.yaml#/definitions/uint32
> --
> 2.25.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/4] dt-bindings: power: reset: Replace SYSCON reboot-mode legacy bindings with YAML-based one
[not found] ` <20200306200551.49C47803087C@mail.baikalelectronics.ru>
@ 2020-03-11 20:47 ` Sergey Semin
0 siblings, 0 replies; 17+ messages in thread
From: Sergey Semin @ 2020-03-11 20:47 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Rob Herring, Mark Rutland, Alexey Malahov, Thomas Bogendoerfer,
Paul Burton, Ralf Baechle, linux-pm, devicetree, linux-kernel
On Fri, Mar 06, 2020 at 08:56:38PM +0100, Sebastian Reichel wrote:
> Hi,
>
> On Fri, Mar 06, 2020 at 04:03:39PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> > From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> >
> > Modern device tree bindings are supposed to be created as YAML-files
> > in accordance with dt-schema. This commit replaces SYSCON reboot-mode
> > legacy bare text bindings with YAML file. As before the bindings file
> > states that the corresponding dts node is supposed to be compatible
> > "syscon-reboot-mode" device and necessarily have an offset property
> > to determine which register from the regmap is supposed to keep the
> > mode on reboot.
> >
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> > Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> > Cc: Paul Burton <paulburton@kernel.org>
> > Cc: Ralf Baechle <ralf@linux-mips.org>
> > ---
>
> I'm missing patch 1 and would like an Acked-by from Rob Herring, so
> for now:
>
> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
>
Great. Thanks. I'll resend the patchset very soon. You aren't in the
first patch Cc because it doesn't concern power/reset subsystem, but
mfd/syscon. That's why my submission script didn't add you to the list.
Sorry about that. I'll send a v2 copy to you.
Regards,
-Sergey
> -- Sebastian
>
> > .../power/reset/syscon-reboot-mode.txt | 35 ------------
> > .../power/reset/syscon-reboot-mode.yaml | 55 +++++++++++++++++++
> > 2 files changed, 55 insertions(+), 35 deletions(-)
> > delete mode 100644 Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt
> > create mode 100644 Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt
> > deleted file mode 100644
> > index f7ce1d8af04a..000000000000
> > --- a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt
> > +++ /dev/null
> > @@ -1,35 +0,0 @@
> > -SYSCON reboot mode driver
> > -
> > -This driver gets reboot mode magic value form reboot-mode driver
> > -and stores it in a SYSCON mapped register. Then the bootloader
> > -can read it and take different action according to the magic
> > -value stored.
> > -
> > -This DT node should be represented as a sub-node of a "syscon", "simple-mfd"
> > -node.
> > -
> > -Required properties:
> > -- compatible: should be "syscon-reboot-mode"
> > -- offset: offset in the register map for the storage register (in bytes)
> > -
> > -Optional property:
> > -- mask: bits mask of the bits in the register to store the reboot mode magic value,
> > - default set to 0xffffffff if missing.
> > -
> > -The rest of the properties should follow the generic reboot-mode description
> > -found in reboot-mode.txt
> > -
> > -Example:
> > - pmu: pmu@20004000 {
> > - compatible = "rockchip,rk3066-pmu", "syscon", "simple-mfd";
> > - reg = <0x20004000 0x100>;
> > -
> > - reboot-mode {
> > - compatible = "syscon-reboot-mode";
> > - offset = <0x40>;
> > - mode-normal = <BOOT_NORMAL>;
> > - mode-recovery = <BOOT_RECOVERY>;
> > - mode-bootloader = <BOOT_FASTBOOT>;
> > - mode-loader = <BOOT_BL_DOWNLOAD>;
> > - };
> > - };
> > diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> > new file mode 100644
> > index 000000000000..e09bb07b1abb
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> > @@ -0,0 +1,55 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/power/reset/syscon-reboot-mode.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Generic SYSCON reboot mode driver
> > +
> > +maintainers:
> > + - Sebastian Reichel <sre@kernel.org>
> > +
> > +description: |
> > + This driver gets reboot mode magic value from reboot-mode driver
> > + and stores it in a SYSCON mapped register. Then the bootloader
> > + can read it and take different action according to the magic
> > + value stored. The SYSCON mapped register is retrieved from the
> > + parental dt-node plus the offset. So the SYSCON reboot-mode node
> > + should be represented as a sub-node of a "syscon", "simple-mfd" node.
> > +
> > +properties:
> > + compatible:
> > + const: syscon-reboot-mode
> > +
> > + mask:
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + description: Update only the register bits defined by the mask (32 bit).
> > +
> > + offset:
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + description: Offset in the register map for the mode register (in bytes).
> > +
> > +patternProperties:
> > + "^mode-.+":
> > + $ref: /schemas/types.yaml#/definitions/uint32
> > + description: Vendor-specific mode value written to the mode register.
> > +
> > +additionalProperties: false
> > +
> > +required:
> > + - compatible
> > + - offset
> > +
> > +examples:
> > + - |
> > + #include <dt-bindings/soc/rockchip,boot-mode.h>
> > +
> > + reboot-mode {
> > + compatible = "syscon-reboot-mode";
> > + offset = <0x40>;
> > + mode-normal = <BOOT_NORMAL>;
> > + mode-recovery = <BOOT_RECOVERY>;
> > + mode-bootloader = <BOOT_FASTBOOT>;
> > + mode-loader = <BOOT_BL_DOWNLOAD>;
> > + };
> > +...
> > --
> > 2.25.1
> >
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/4] dt-bindings: syscon: Add syscon endian properties support
2020-03-06 13:03 ` [PATCH 1/4] dt-bindings: syscon: Add syscon endian properties support Sergey.Semin
@ 2020-03-12 21:11 ` Rob Herring
2020-03-13 12:26 ` Sergey Semin
0 siblings, 1 reply; 17+ messages in thread
From: Rob Herring @ 2020-03-12 21:11 UTC (permalink / raw)
To: Sergey.Semin
Cc: Lee Jones, Mark Rutland, Serge Semin, Alexey Malahov,
Thomas Bogendoerfer, Paul Burton, Ralf Baechle, devicetree,
linux-kernel
On Fri, Mar 06, 2020 at 04:03:38PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
>
> In accordance with the syscon-driver (drivers/mfd/syscon.c) the syscon
> dts-nodes may accept endian properties of the boolean type: little-endian,
> big-endian, native-endian. Lets make sure that syscon bindings json-schema
> also supports them.
>
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: Paul Burton <paulburton@kernel.org>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> ---
> Documentation/devicetree/bindings/mfd/syscon.yaml | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
> index 39375e4313d2..9ee404991533 100644
> --- a/Documentation/devicetree/bindings/mfd/syscon.yaml
> +++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
> @@ -61,6 +61,11 @@ properties:
> description:
> Reference to a phandle of a hardware spinlock provider node.
>
> +patternProperties:
> + "^(big|little|native)-endian$":
> + $ref: /schemas/types.yaml#/definitions/flag
> + description: Bytes order of the system controller memory space.
Common properties should have a type definition in a common schema. For
this one, I'd like it in the core schema in dtschema.
I'd expect for any specific 'syscon', either none or only a subset of
these are valid, so I don't think this should be added here.
Rob
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/4] dt-bindings: power: reset: Replace SYSCON reboot-mode legacy bindings with YAML-based one
2020-03-06 13:03 ` [PATCH 2/4] dt-bindings: power: reset: Replace SYSCON reboot-mode legacy bindings with YAML-based one Sergey.Semin
2020-03-06 19:56 ` Sebastian Reichel
[not found] ` <20200306200551.49C47803087C@mail.baikalelectronics.ru>
@ 2020-03-12 21:12 ` Rob Herring
2 siblings, 0 replies; 17+ messages in thread
From: Rob Herring @ 2020-03-12 21:12 UTC (permalink / raw)
To: Sergey.Semin
Cc: Sebastian Reichel, Mark Rutland, Serge Semin, Serge Semin,
Alexey Malahov, Thomas Bogendoerfer, Paul Burton, Ralf Baechle,
linux-pm, devicetree, linux-kernel
On Fri, 6 Mar 2020 16:03:39 +0300, <Sergey.Semin@baikalelectronics.ru> wrote:
> From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
>
> Modern device tree bindings are supposed to be created as YAML-files
> in accordance with dt-schema. This commit replaces SYSCON reboot-mode
> legacy bare text bindings with YAML file. As before the bindings file
> states that the corresponding dts node is supposed to be compatible
> "syscon-reboot-mode" device and necessarily have an offset property
> to determine which register from the regmap is supposed to keep the
> mode on reboot.
>
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: Paul Burton <paulburton@kernel.org>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> ---
> .../power/reset/syscon-reboot-mode.txt | 35 ------------
> .../power/reset/syscon-reboot-mode.yaml | 55 +++++++++++++++++++
> 2 files changed, 55 insertions(+), 35 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt
> create mode 100644 Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
>
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/4] dt-bindings: power: reset: Add regmap support to the SYSCON reboot-mode bindings
2020-03-06 13:03 ` [PATCH 3/4] dt-bindings: power: reset: Add regmap support to the SYSCON reboot-mode bindings Sergey.Semin
2020-03-06 19:57 ` Sebastian Reichel
@ 2020-03-12 21:14 ` Rob Herring
2020-03-13 13:02 ` Sergey Semin
1 sibling, 1 reply; 17+ messages in thread
From: Rob Herring @ 2020-03-12 21:14 UTC (permalink / raw)
To: Sergey.Semin
Cc: Sebastian Reichel, Mark Rutland, Serge Semin, Alexey Malahov,
Thomas Bogendoerfer, Paul Burton, Ralf Baechle, linux-pm,
devicetree, linux-kernel
On Fri, Mar 06, 2020 at 04:03:40PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
>
> Optional regmap property will be used to refer to a syscon-controller
> having a reboot tolerant register mapped.
NAK. It should simply be a child node of the 'syscon-controller'.
>
> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: Paul Burton <paulburton@kernel.org>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> ---
> .../bindings/power/reset/syscon-reboot-mode.yaml | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> index e09bb07b1abb..f47bf52ad983 100644
> --- a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> +++ b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> @@ -13,9 +13,8 @@ description: |
> This driver gets reboot mode magic value from reboot-mode driver
> and stores it in a SYSCON mapped register. Then the bootloader
> can read it and take different action according to the magic
> - value stored. The SYSCON mapped register is retrieved from the
> - parental dt-node plus the offset. So the SYSCON reboot-mode node
> - should be represented as a sub-node of a "syscon", "simple-mfd" node.
> + value stored. The SYSCON mapped register is retrieved either from
> + the parental dt-node or from a regmap phandle plus the offset.
>
> properties:
> compatible:
> @@ -29,6 +28,10 @@ properties:
> $ref: /schemas/types.yaml#/definitions/uint32
> description: Offset in the register map for the mode register (in bytes).
>
> + regmap:
> + $ref: /schemas/types.yaml#/definitions/phandle
> + description: Phandle to the register map node.
> +
> patternProperties:
> "^mode-.+":
> $ref: /schemas/types.yaml#/definitions/uint32
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/4] dt-bindings: syscon: Add syscon endian properties support
2020-03-12 21:11 ` Rob Herring
@ 2020-03-13 12:26 ` Sergey Semin
0 siblings, 0 replies; 17+ messages in thread
From: Sergey Semin @ 2020-03-13 12:26 UTC (permalink / raw)
To: Rob Herring
Cc: Lee Jones, Mark Rutland, Alexey Malahov, Thomas Bogendoerfer,
Paul Burton, Ralf Baechle, devicetree, linux-kernel
On Thu, Mar 12, 2020 at 04:11:02PM -0500, Rob Herring wrote:
> On Fri, Mar 06, 2020 at 04:03:38PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> > From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> >
> > In accordance with the syscon-driver (drivers/mfd/syscon.c) the syscon
> > dts-nodes may accept endian properties of the boolean type: little-endian,
> > big-endian, native-endian. Lets make sure that syscon bindings json-schema
> > also supports them.
> >
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> > Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> > Cc: Paul Burton <paulburton@kernel.org>
> > Cc: Ralf Baechle <ralf@linux-mips.org>
> > ---
> > Documentation/devicetree/bindings/mfd/syscon.yaml | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
> > index 39375e4313d2..9ee404991533 100644
> > --- a/Documentation/devicetree/bindings/mfd/syscon.yaml
> > +++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
> > @@ -61,6 +61,11 @@ properties:
> > description:
> > Reference to a phandle of a hardware spinlock provider node.
> >
> > +patternProperties:
> > + "^(big|little|native)-endian$":
> > + $ref: /schemas/types.yaml#/definitions/flag
> > + description: Bytes order of the system controller memory space.
>
> Common properties should have a type definition in a common schema. For
> this one, I'd like it in the core schema in dtschema.
So what do you suggest then? Will you move this file to the dt-scheme/schemas
in your repo? What shall I do with this patch, just drop? Or would you like me
to fork your dt-schema repo, add dt-schemas/schemas/mfd/syscon.yaml file similar
to this one with "*-endian" property supported, then pull-request or
send a patch with the alteration back to your repo?
>
> I'd expect for any specific 'syscon', either none or only a subset of
> these are valid, so I don't think this should be added here.
AFAIU mfd/syscon.yaml describes a generic syscon compatible with generic
driver drivers/mfd/syscon.c, which may have any of these properties
declared in its dt-node. We can't predict which one because, well, it's
generic. At the same time, yes, only a subset of these properties can be
supported by a specific system controller, which one can be determined
by the controller specific dt schema. So if we left the property here in
the generic syscon.yaml, then the controller dt-schema would have had a
pattern like:
>
> allOf:
> - $ref: ../../mfd/syscon.yaml#
>
> properties:
> little-endian: true
>
> additionalProperties: false
>
as I did for soc/baikal-t1/be,bt1-l2-ctl.yaml. See the patch: "dt-bindings:
Add Baikal-T1 L2-cache Control Block dts bindings file" in the corresponding
patchset in your email Inbox.
Regards,
-Sergey
>
> Rob
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/4] dt-bindings: power: reset: Add regmap support to the SYSCON reboot-mode bindings
2020-03-12 21:14 ` Rob Herring
@ 2020-03-13 13:02 ` Sergey Semin
2020-03-14 18:04 ` Sebastian Reichel
2020-03-18 23:14 ` Rob Herring
0 siblings, 2 replies; 17+ messages in thread
From: Sergey Semin @ 2020-03-13 13:02 UTC (permalink / raw)
To: Rob Herring
Cc: Sebastian Reichel, Mark Rutland, Alexey Malahov,
Thomas Bogendoerfer, Paul Burton, Ralf Baechle, linux-pm,
devicetree, linux-kernel
On Thu, Mar 12, 2020 at 04:14:38PM -0500, Rob Herring wrote:
> On Fri, Mar 06, 2020 at 04:03:40PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> > From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> >
> > Optional regmap property will be used to refer to a syscon-controller
> > having a reboot tolerant register mapped.
>
> NAK. It should simply be a child node of the 'syscon-controller'.
Hm, It's dilemma. The driver maintainer said ack, while you disagree.)
So the code change will be merged while the doc-part won't? Lets discuss then
to settle the issue.
Why 'syscon-reboot' can be out of syscon-controller node, while
'syscon-reboot-mode' can't? They both belong to the same usecase: save
cause id and reboot. So having similar properties-set and declaring their
nodes someplace nearby is natural. According to the driver 'syscon-reboot'
can't lack the regmap property because it's mandatory, while here you refuse
to have even optional support. Additionally in most of the cases the
'syscon-reboot' nodes aren't declared as a child of a system controller
node. Why 'syscon-reboot-mode' can't work in a similar way?
Regards,
-Sergey
>
> >
> > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > Signed-off-by: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
> > Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> > Cc: Paul Burton <paulburton@kernel.org>
> > Cc: Ralf Baechle <ralf@linux-mips.org>
> > ---
> > .../bindings/power/reset/syscon-reboot-mode.yaml | 9 ++++++---
> > 1 file changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> > index e09bb07b1abb..f47bf52ad983 100644
> > --- a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> > +++ b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> > @@ -13,9 +13,8 @@ description: |
> > This driver gets reboot mode magic value from reboot-mode driver
> > and stores it in a SYSCON mapped register. Then the bootloader
> > can read it and take different action according to the magic
> > - value stored. The SYSCON mapped register is retrieved from the
> > - parental dt-node plus the offset. So the SYSCON reboot-mode node
> > - should be represented as a sub-node of a "syscon", "simple-mfd" node.
> > + value stored. The SYSCON mapped register is retrieved either from
> > + the parental dt-node or from a regmap phandle plus the offset.
> >
> > properties:
> > compatible:
> > @@ -29,6 +28,10 @@ properties:
> > $ref: /schemas/types.yaml#/definitions/uint32
> > description: Offset in the register map for the mode register (in bytes).
> >
> > + regmap:
> > + $ref: /schemas/types.yaml#/definitions/phandle
> > + description: Phandle to the register map node.
> > +
> > patternProperties:
> > "^mode-.+":
> > $ref: /schemas/types.yaml#/definitions/uint32
> > --
> > 2.25.1
> >
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/4] dt-bindings: power: reset: Add regmap support to the SYSCON reboot-mode bindings
2020-03-13 13:02 ` Sergey Semin
@ 2020-03-14 18:04 ` Sebastian Reichel
2020-03-18 23:14 ` Rob Herring
1 sibling, 0 replies; 17+ messages in thread
From: Sebastian Reichel @ 2020-03-14 18:04 UTC (permalink / raw)
To: Sergey Semin
Cc: Rob Herring, Mark Rutland, Alexey Malahov, Thomas Bogendoerfer,
Paul Burton, Ralf Baechle, linux-pm, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 702 bytes --]
Hi,
On Fri, Mar 13, 2020 at 04:02:31PM +0300, Sergey Semin wrote:
> On Thu, Mar 12, 2020 at 04:14:38PM -0500, Rob Herring wrote:
> > On Fri, Mar 06, 2020 at 04:03:40PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> > > From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > > Optional regmap property will be used to refer to a syscon-controller
> > > having a reboot tolerant register mapped.
> >
> > NAK. It should simply be a child node of the 'syscon-controller'.
>
> Hm, It's dilemma. The driver maintainer said ack, while you
> disagree. So the code change will be merged while the doc-part
> won't?
FWIW I do not merge with bindings being NAK'd by Rob.
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/4] dt-bindings: power: reset: Add regmap support to the SYSCON reboot-mode bindings
2020-03-13 13:02 ` Sergey Semin
2020-03-14 18:04 ` Sebastian Reichel
@ 2020-03-18 23:14 ` Rob Herring
2020-03-31 19:50 ` Sergey Semin
1 sibling, 1 reply; 17+ messages in thread
From: Rob Herring @ 2020-03-18 23:14 UTC (permalink / raw)
To: Sergey Semin
Cc: Sebastian Reichel, Mark Rutland, Alexey Malahov,
Thomas Bogendoerfer, Paul Burton, Ralf Baechle, open list:THERMAL,
devicetree, linux-kernel@vger.kernel.org
On Fri, Mar 13, 2020 at 7:03 AM Sergey Semin
<Sergey.Semin@baikalelectronics.ru> wrote:
>
> On Thu, Mar 12, 2020 at 04:14:38PM -0500, Rob Herring wrote:
> > On Fri, Mar 06, 2020 at 04:03:40PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> > > From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > >
> > > Optional regmap property will be used to refer to a syscon-controller
> > > having a reboot tolerant register mapped.
> >
> > NAK. It should simply be a child node of the 'syscon-controller'.
>
> Hm, It's dilemma. The driver maintainer said ack, while you disagree.)
> So the code change will be merged while the doc-part won't? Lets discuss then
> to settle the issue.
>
> Why 'syscon-reboot' can be out of syscon-controller node, while
> 'syscon-reboot-mode' can't?
Look at the history and you will see one was reviewed by DT
maintainers and one wasn't.
> They both belong to the same usecase: save
> cause id and reboot. So having similar properties-set and declaring their
> nodes someplace nearby is natural.
Which is what I'm asking for. Where else in the tree does it make
sense to locate the 'syscon-reboot-mode' node? Locate nodes where they
logically belong.
> According to the driver 'syscon-reboot'
> can't lack the regmap property because it's mandatory, while here you refuse
> to have even optional support. Additionally in most of the cases the
> 'syscon-reboot' nodes aren't declared as a child of a system controller
> node. Why 'syscon-reboot-mode' can't work in a similar way?
There's plenty of bad or "don't follow current best practice" examples
in the tree for all sorts of things. That is not a reason for doing
something in a new binding or adding to an existing one.
Rob
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/4] dt-bindings: power: reset: Add regmap support to the SYSCON reboot-mode bindings
2020-03-18 23:14 ` Rob Herring
@ 2020-03-31 19:50 ` Sergey Semin
2020-04-16 19:56 ` Sergey Semin
0 siblings, 1 reply; 17+ messages in thread
From: Sergey Semin @ 2020-03-31 19:50 UTC (permalink / raw)
To: Rob Herring
Cc: Sebastian Reichel, Mark Rutland, Alexey Malahov,
Thomas Bogendoerfer, Paul Burton, Ralf Baechle, open list:THERMAL,
devicetree, linux-kernel@vger.kernel.org
On Wed, Mar 18, 2020 at 05:14:25PM -0600, Rob Herring wrote:
> On Fri, Mar 13, 2020 at 7:03 AM Sergey Semin
> <Sergey.Semin@baikalelectronics.ru> wrote:
> >
> > On Thu, Mar 12, 2020 at 04:14:38PM -0500, Rob Herring wrote:
> > > On Fri, Mar 06, 2020 at 04:03:40PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> > > > From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > > >
> > > > Optional regmap property will be used to refer to a syscon-controller
> > > > having a reboot tolerant register mapped.
> > >
> > > NAK. It should simply be a child node of the 'syscon-controller'.
> >
> > Hm, It's dilemma. The driver maintainer said ack, while you disagree.)
> > So the code change will be merged while the doc-part won't? Lets discuss then
> > to settle the issue.
> >
> > Why 'syscon-reboot' can be out of syscon-controller node, while
> > 'syscon-reboot-mode' can't?
>
> Look at the history and you will see one was reviewed by DT
> maintainers and one wasn't.
>
> > They both belong to the same usecase: save
> > cause id and reboot. So having similar properties-set and declaring their
> > nodes someplace nearby is natural.
>
> Which is what I'm asking for. Where else in the tree does it make
> sense to locate the 'syscon-reboot-mode' node? Locate nodes where they
> logically belong.
>
> > According to the driver 'syscon-reboot'
> > can't lack the regmap property because it's mandatory, while here you refuse
> > to have even optional support. Additionally in most of the cases the
> > 'syscon-reboot' nodes aren't declared as a child of a system controller
> > node. Why 'syscon-reboot-mode' can't work in a similar way?
>
> There's plenty of bad or "don't follow current best practice" examples
> in the tree for all sorts of things. That is not a reason for doing
> something in a new binding or adding to an existing one.
>
> Rob
Alright. I see your point. What about I'd provide a sort of opposite
implementation? I could make the "regmap"-phandle reference being optional
in the !"syscon-reboot"! driver instead of adding the regmap-property
support to the "syscon-reboot-mode" driver. So if regmap property isn't
defined in the "syscon-reboot"-compatible node, the driver will try to
get a syscon regmap from the parental node as it's done in the
"syscon-reboot-mode" driver.
Seeing you think that regmap-property-based design is a bad practice in
this case, I also could mark the property as deprecated in the "syscon-reboot"
dt schema and print a warning from the "syscon-reboot" driver if one is defined.
What do you think?
Regards,
-Sergey
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/4] dt-bindings: power: reset: Add regmap support to the SYSCON reboot-mode bindings
2020-03-31 19:50 ` Sergey Semin
@ 2020-04-16 19:56 ` Sergey Semin
2020-04-16 21:28 ` Rob Herring
0 siblings, 1 reply; 17+ messages in thread
From: Sergey Semin @ 2020-04-16 19:56 UTC (permalink / raw)
To: Rob Herring
Cc: Sebastian Reichel, Mark Rutland, Alexey Malahov,
Thomas Bogendoerfer, Paul Burton, Ralf Baechle, open list:THERMAL,
devicetree, linux-kernel@vger.kernel.org
Rob,
Any comment on my suggestion below?
Regards,
-Sergey
On Tue, Mar 31, 2020 at 10:50:53PM +0300, Sergey Semin wrote:
> On Wed, Mar 18, 2020 at 05:14:25PM -0600, Rob Herring wrote:
> > On Fri, Mar 13, 2020 at 7:03 AM Sergey Semin
> > <Sergey.Semin@baikalelectronics.ru> wrote:
> > >
> > > On Thu, Mar 12, 2020 at 04:14:38PM -0500, Rob Herring wrote:
> > > > On Fri, Mar 06, 2020 at 04:03:40PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> > > > > From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > > > >
> > > > > Optional regmap property will be used to refer to a syscon-controller
> > > > > having a reboot tolerant register mapped.
> > > >
> > > > NAK. It should simply be a child node of the 'syscon-controller'.
> > >
> > > Hm, It's dilemma. The driver maintainer said ack, while you disagree.)
> > > So the code change will be merged while the doc-part won't? Lets discuss then
> > > to settle the issue.
> > >
> > > Why 'syscon-reboot' can be out of syscon-controller node, while
> > > 'syscon-reboot-mode' can't?
> >
> > Look at the history and you will see one was reviewed by DT
> > maintainers and one wasn't.
> >
> > > They both belong to the same usecase: save
> > > cause id and reboot. So having similar properties-set and declaring their
> > > nodes someplace nearby is natural.
> >
> > Which is what I'm asking for. Where else in the tree does it make
> > sense to locate the 'syscon-reboot-mode' node? Locate nodes where they
> > logically belong.
> >
> > > According to the driver 'syscon-reboot'
> > > can't lack the regmap property because it's mandatory, while here you refuse
> > > to have even optional support. Additionally in most of the cases the
> > > 'syscon-reboot' nodes aren't declared as a child of a system controller
> > > node. Why 'syscon-reboot-mode' can't work in a similar way?
> >
> > There's plenty of bad or "don't follow current best practice" examples
> > in the tree for all sorts of things. That is not a reason for doing
> > something in a new binding or adding to an existing one.
> >
> > Rob
>
> Alright. I see your point. What about I'd provide a sort of opposite
> implementation? I could make the "regmap"-phandle reference being optional
> in the !"syscon-reboot"! driver instead of adding the regmap-property
> support to the "syscon-reboot-mode" driver. So if regmap property isn't
> defined in the "syscon-reboot"-compatible node, the driver will try to
> get a syscon regmap from the parental node as it's done in the
> "syscon-reboot-mode" driver.
>
> Seeing you think that regmap-property-based design is a bad practice in
> this case, I also could mark the property as deprecated in the "syscon-reboot"
> dt schema and print a warning from the "syscon-reboot" driver if one is defined.
>
> What do you think?
>
> Regards,
> -Sergey
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/4] dt-bindings: power: reset: Add regmap support to the SYSCON reboot-mode bindings
2020-04-16 19:56 ` Sergey Semin
@ 2020-04-16 21:28 ` Rob Herring
2020-04-17 7:45 ` Sergey Semin
0 siblings, 1 reply; 17+ messages in thread
From: Rob Herring @ 2020-04-16 21:28 UTC (permalink / raw)
To: Sergey Semin
Cc: Sebastian Reichel, Mark Rutland, Alexey Malahov,
Thomas Bogendoerfer, Paul Burton, Ralf Baechle, open list:THERMAL,
devicetree, linux-kernel@vger.kernel.org
On Thu, Apr 16, 2020 at 10:56:20PM +0300, Sergey Semin wrote:
> Rob,
> Any comment on my suggestion below?
>
> Regards,
> -Sergey
>
> On Tue, Mar 31, 2020 at 10:50:53PM +0300, Sergey Semin wrote:
> > On Wed, Mar 18, 2020 at 05:14:25PM -0600, Rob Herring wrote:
> > > On Fri, Mar 13, 2020 at 7:03 AM Sergey Semin
> > > <Sergey.Semin@baikalelectronics.ru> wrote:
> > > >
> > > > On Thu, Mar 12, 2020 at 04:14:38PM -0500, Rob Herring wrote:
> > > > > On Fri, Mar 06, 2020 at 04:03:40PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> > > > > > From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > > > > >
> > > > > > Optional regmap property will be used to refer to a syscon-controller
> > > > > > having a reboot tolerant register mapped.
> > > > >
> > > > > NAK. It should simply be a child node of the 'syscon-controller'.
> > > >
> > > > Hm, It's dilemma. The driver maintainer said ack, while you disagree.)
> > > > So the code change will be merged while the doc-part won't? Lets discuss then
> > > > to settle the issue.
> > > >
> > > > Why 'syscon-reboot' can be out of syscon-controller node, while
> > > > 'syscon-reboot-mode' can't?
> > >
> > > Look at the history and you will see one was reviewed by DT
> > > maintainers and one wasn't.
> > >
> > > > They both belong to the same usecase: save
> > > > cause id and reboot. So having similar properties-set and declaring their
> > > > nodes someplace nearby is natural.
> > >
> > > Which is what I'm asking for. Where else in the tree does it make
> > > sense to locate the 'syscon-reboot-mode' node? Locate nodes where they
> > > logically belong.
> > >
> > > > According to the driver 'syscon-reboot'
> > > > can't lack the regmap property because it's mandatory, while here you refuse
> > > > to have even optional support. Additionally in most of the cases the
> > > > 'syscon-reboot' nodes aren't declared as a child of a system controller
> > > > node. Why 'syscon-reboot-mode' can't work in a similar way?
> > >
> > > There's plenty of bad or "don't follow current best practice" examples
> > > in the tree for all sorts of things. That is not a reason for doing
> > > something in a new binding or adding to an existing one.
> > >
> > > Rob
> >
> > Alright. I see your point. What about I'd provide a sort of opposite
> > implementation? I could make the "regmap"-phandle reference being optional
> > in the !"syscon-reboot"! driver instead of adding the regmap-property
> > support to the "syscon-reboot-mode" driver. So if regmap property isn't
> > defined in the "syscon-reboot"-compatible node, the driver will try to
> > get a syscon regmap from the parental node as it's done in the
> > "syscon-reboot-mode" driver.
That seems fine.
> > Seeing you think that regmap-property-based design is a bad practice in
> > this case, I also could mark the property as deprecated in the "syscon-reboot"
> > dt schema and print a warning from the "syscon-reboot" driver if one is defined.
Depends on how many platforms will start getting warnings. I think just
marking deprecated is enough.
Rob
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/4] dt-bindings: power: reset: Add regmap support to the SYSCON reboot-mode bindings
2020-04-16 21:28 ` Rob Herring
@ 2020-04-17 7:45 ` Sergey Semin
0 siblings, 0 replies; 17+ messages in thread
From: Sergey Semin @ 2020-04-17 7:45 UTC (permalink / raw)
To: Rob Herring
Cc: Sebastian Reichel, Mark Rutland, Alexey Malahov,
Thomas Bogendoerfer, Paul Burton, Ralf Baechle, open list:THERMAL,
devicetree, linux-kernel@vger.kernel.org
On Thu, Apr 16, 2020 at 04:28:42PM -0500, Rob Herring wrote:
> On Thu, Apr 16, 2020 at 10:56:20PM +0300, Sergey Semin wrote:
> > Rob,
> > Any comment on my suggestion below?
> >
> > Regards,
> > -Sergey
> >
> > On Tue, Mar 31, 2020 at 10:50:53PM +0300, Sergey Semin wrote:
> > > On Wed, Mar 18, 2020 at 05:14:25PM -0600, Rob Herring wrote:
> > > > On Fri, Mar 13, 2020 at 7:03 AM Sergey Semin
> > > > <Sergey.Semin@baikalelectronics.ru> wrote:
> > > > >
> > > > > On Thu, Mar 12, 2020 at 04:14:38PM -0500, Rob Herring wrote:
> > > > > > On Fri, Mar 06, 2020 at 04:03:40PM +0300, Sergey.Semin@baikalelectronics.ru wrote:
> > > > > > > From: Serge Semin <Sergey.Semin@baikalelectronics.ru>
> > > > > > >
> > > > > > > Optional regmap property will be used to refer to a syscon-controller
> > > > > > > having a reboot tolerant register mapped.
> > > > > >
> > > > > > NAK. It should simply be a child node of the 'syscon-controller'.
> > > > >
> > > > > Hm, It's dilemma. The driver maintainer said ack, while you disagree.)
> > > > > So the code change will be merged while the doc-part won't? Lets discuss then
> > > > > to settle the issue.
> > > > >
> > > > > Why 'syscon-reboot' can be out of syscon-controller node, while
> > > > > 'syscon-reboot-mode' can't?
> > > >
> > > > Look at the history and you will see one was reviewed by DT
> > > > maintainers and one wasn't.
> > > >
> > > > > They both belong to the same usecase: save
> > > > > cause id and reboot. So having similar properties-set and declaring their
> > > > > nodes someplace nearby is natural.
> > > >
> > > > Which is what I'm asking for. Where else in the tree does it make
> > > > sense to locate the 'syscon-reboot-mode' node? Locate nodes where they
> > > > logically belong.
> > > >
> > > > > According to the driver 'syscon-reboot'
> > > > > can't lack the regmap property because it's mandatory, while here you refuse
> > > > > to have even optional support. Additionally in most of the cases the
> > > > > 'syscon-reboot' nodes aren't declared as a child of a system controller
> > > > > node. Why 'syscon-reboot-mode' can't work in a similar way?
> > > >
> > > > There's plenty of bad or "don't follow current best practice" examples
> > > > in the tree for all sorts of things. That is not a reason for doing
> > > > something in a new binding or adding to an existing one.
> > > >
> > > > Rob
> > >
> > > Alright. I see your point. What about I'd provide a sort of opposite
> > > implementation? I could make the "regmap"-phandle reference being optional
> > > in the !"syscon-reboot"! driver instead of adding the regmap-property
> > > support to the "syscon-reboot-mode" driver. So if regmap property isn't
> > > defined in the "syscon-reboot"-compatible node, the driver will try to
> > > get a syscon regmap from the parental node as it's done in the
> > > "syscon-reboot-mode" driver.
>
> That seems fine.
>
> > > Seeing you think that regmap-property-based design is a bad practice in
> > > this case, I also could mark the property as deprecated in the "syscon-reboot"
> > > dt schema and print a warning from the "syscon-reboot" driver if one is defined.
>
> Depends on how many platforms will start getting warnings. I think just
> marking deprecated is enough.
Ok. Thanks. I'll do this in v2.
Regards,
-Sergey
>
> Rob
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2020-04-17 7:45 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20200306130341.9585-1-Sergey.Semin@baikalelectronics.ru>
2020-03-06 13:03 ` [PATCH 1/4] dt-bindings: syscon: Add syscon endian properties support Sergey.Semin
2020-03-12 21:11 ` Rob Herring
2020-03-13 12:26 ` Sergey Semin
2020-03-06 13:03 ` [PATCH 2/4] dt-bindings: power: reset: Replace SYSCON reboot-mode legacy bindings with YAML-based one Sergey.Semin
2020-03-06 19:56 ` Sebastian Reichel
[not found] ` <20200306200551.49C47803087C@mail.baikalelectronics.ru>
2020-03-11 20:47 ` Sergey Semin
2020-03-12 21:12 ` Rob Herring
2020-03-06 13:03 ` [PATCH 3/4] dt-bindings: power: reset: Add regmap support to the SYSCON reboot-mode bindings Sergey.Semin
2020-03-06 19:57 ` Sebastian Reichel
2020-03-12 21:14 ` Rob Herring
2020-03-13 13:02 ` Sergey Semin
2020-03-14 18:04 ` Sebastian Reichel
2020-03-18 23:14 ` Rob Herring
2020-03-31 19:50 ` Sergey Semin
2020-04-16 19:56 ` Sergey Semin
2020-04-16 21:28 ` Rob Herring
2020-04-17 7:45 ` Sergey Semin
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).