dt-bindings: sram: Convert SRAM bindings to json-schema
Subsystems (4)
Krzysztof Kozlowski
maintainerPATCH v3 1/10 dt-bindings: sram: Convert SRAM bindings to json-schema
Convert generic mmio-sram bindings to DT schema format using json-schema. Require the address/size cells to be 1, not equal to root node.
---
Changes since v2:
1. Add Rob as maintainer,
2. Use "contains" for compatible,
3. Fix address and size cells to 1,
4. Add maxitems to reg under children,
5. Remove unneeded string type from label.
Changes since v1:
1. Indent example with four spaces (more readable).
--- .../devicetree/bindings/sram/sram.txt | 80 ----------- .../devicetree/bindings/sram/sram.yaml | 134 ++++++++++++++++++ 2 files changed, 134 insertions(+), 80 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sram/sram.txt create mode 100644 Documentation/devicetree/bindings/sram/sram.yaml
Documentation/devicetree/bindings/sram/sram.txt deleted +0 -80
@@ -1,80 +0,0 @@ -Generic on-chip SRAM - -Simple IO memory regions to be managed by the genalloc API. - -Required properties: - -- compatible : mmio-sram or atmel,sama5d2-securam - -- reg : SRAM iomem address range - -Reserving sram areas: ---------------------- - -Each child of the sram node specifies a region of reserved memory. Each -child node should use a 'reg' property to specify a specific range of -reserved memory. - -Following the generic-names recommended practice, node names should -reflect the purpose of the node. Unit address (@<address>) should be -appended to the name. - -Required properties in the sram node: - -- #address-cells, #size-cells : should use the same values as the root node -- ranges : standard definition, should translate from local addresses - within the sram to bus addresses - -Optional properties in the sram node: - -- no-memory-wc : the flag indicating, that SRAM memory region has not to - be remapped as write combining. WC is used by default. - -Required properties in the area nodes: - -- reg : iomem address range, relative to the SRAM range - -Optional properties in the area nodes: - -- compatible : standard definition, should contain a vendor specific string - in the form <vendor>,[<device>-]<usage> -- pool : indicates that the particular reserved SRAM area is addressable - and in use by another device or devices -- export : indicates that the reserved SRAM area may be accessed outside - of the kernel, e.g. by bootloader or userspace -- protect-exec : Same as 'pool' above but with the additional - constraint that code wil be run from the region and - that the memory is maintained as read-only, executable - during code execution. NOTE: This region must be page - aligned on start and end in order to properly allow - manipulation of the page attributes. -- label : the name for the reserved partition, if omitted, the label - is taken from the node name excluding the unit address. -- clocks : a list of phandle and clock specifier pair that controls the - single SRAM clock. - -Example: - -sram: sram@5c000000 { - compatible = "mmio-sram"; - reg = <0x5c000000 0x40000>; /* 256 KiB SRAM at address 0x5c000000 */ - - #address-cells = <1>; - #size-cells = <1>; - ranges = <0 0x5c000000 0x40000>; - - smp-sram@100 { - compatible = "socvendor,smp-sram"; - reg = <0x100 0x50>; - }; - - device-sram@1000 { - reg = <0x1000 0x1000>; - pool; - }; - - exported@20000 { - reg = <0x20000 0x20000>; - export; - }; -};
Documentation/devicetree/bindings/sram/sram.yaml new file +134 -0
134 lines not on this page · raw message
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH v3 2/10 dt-bindings: sram: Convert Samsung Exynos SYSRAM bindings to json-schema
Convert Samsung Exynos SYSRAM bindings to DT schema format using json-schema.
---
Changes since v2:
1. Use sram as name of node in example.
Changes since v1:
1. Indent example with four spaces (more readable).
--- .../devicetree/bindings/sram/samsung-sram.txt | 38 ------------ .../bindings/sram/samsung-sram.yaml | 58 +++++++++++++++++++ MAINTAINERS | 2 +- 3 files changed, 59 insertions(+), 39 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sram/samsung-sram.txt create mode 100644 Documentation/devicetree/bindings/sram/samsung-sram.yaml
Documentation/devicetree/bindings/sram/samsung-sram.txt deleted +0 -38
@@ -1,38 +0,0 @@ -Samsung Exynos SYSRAM for SMP bringup: ------------------------------------- - -Samsung SMP-capable Exynos SoCs use part of the SYSRAM for the bringup -of the secondary cores. Once the core gets powered up it executes the -code that is residing at some specific location of the SYSRAM. - -Therefore reserved section sub-nodes have to be added to the mmio-sram -declaration. These nodes are of two types depending upon secure or -non-secure execution environment. - -Required sub-node properties: -- compatible : depending upon boot mode, should be - "samsung,exynos4210-sysram" : for Secure SYSRAM - "samsung,exynos4210-sysram-ns" : for Non-secure SYSRAM - -The rest of the properties should follow the generic mmio-sram discription -found in Documentation/devicetree/bindings/sram/sram.txt - -Example: - - sysram@2020000 { - compatible = "mmio-sram"; - reg = <0x02020000 0x54000>; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0 0x02020000 0x54000>; - - smp-sysram@0 { - compatible = "samsung,exynos4210-sysram"; - reg = <0x0 0x1000>; - }; - - smp-sysram@53000 { - compatible = "samsung,exynos4210-sysram-ns"; - reg = <0x53000 0x1000>; - }; - };
Documentation/devicetree/bindings/sram/samsung-sram.yaml new file +58 -0
58 lines not on this page · raw message
MAINTAINERS +1 -1
@@ -2235,7 +2235,7 @@ F: drivers/soc/samsung/ F: include/linux/soc/samsung/ F: Documentation/arm/samsung/ F: Documentation/devicetree/bindings/arm/samsung/ -F: Documentation/devicetree/bindings/sram/samsung-sram.txt +F: Documentation/devicetree/bindings/sram/samsung-sram.yaml F: Documentation/devicetree/bindings/power/pd-samsung.txt N: exynos
Signature · 1 line
2.17.1
Rob Herring
maintainerRe: [PATCH v3 02/10] dt-bindings: sram: Convert Samsung Exynos SYSRAM bindings to json-schema
Quoted 43 lines · Krzysztof Kozlowski
Convert Samsung Exynos SYSRAM bindings to DT schema format using json-schema.
Signed-off-by Krzysztof Kozlowski <[email protected]>---
Changes since v2:
1. Use sram as name of node in example.Changes since v1:
1. Indent example with four spaces (more readable).--- .../devicetree/bindings/sram/samsung-sram.txt | 38 ------------ .../bindings/sram/samsung-sram.yaml | 58 +++++++++++++++++++ MAINTAINERS | 2 +- 3 files changed, 59 insertions(+), 39 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sram/samsung-sram.txt create mode 100644 Documentation/devicetree/bindings/sram/samsung-sram.yamlDocumentation/devicetree/bindings/sram/samsung-sram.yaml new file +16
-0@@ -0,0 +1,58 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sram/samsung-sram.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung Exynos SoC SYSRAM for SMP bringup + +maintainers: + - Krzysztof Kozlowski <[email protected]> + +description: |+ + Samsung SMP-capable Exynos SoCs use part of the SYSRAM for the bringup + of the secondary cores. Once the core gets powered up it executes the + code that is residing at some specific location of the SYSRAM. +
Documentation/devicetree/bindings/sram/samsung-sram.yaml line 26
Quoted 10 lines
Documentation/devicetree/bindings/sram/samsung-sram.yaml new file +10
-0+ Therefore reserved section sub-nodes have to be added to the mmio-sram + declaration. These nodes are of two types depending upon secure or + non-secure execution environment. + +allOf: + - $ref: "sram.yaml#" + +properties: + $nodename: + pattern: "^sysram(@.*)?"
As you are renaming all the node names, this will no longer work. If you change it to 'sram', that's going to match others, but would still work as long as the child node names are unique to Samsung. If you change them to '*-sram' then, you'd have to come up with something else. That probably means using 'compatible' strings. At that point, it's kind of silly to just be validating what your are using to select the schema. It may be better to just add the compatible strings into sram.yaml if that's the only difference.
Quoted 13 lines
Documentation/devicetree/bindings/sram/samsung-sram.yaml new file +13
-0+ +patternProperties: + "^([a-z]*-)?sysram@[a-f0-9]$": + type: object + + properties: + compatible: + description: + Depending upon boot mode + enum: + - samsung,exynos4210-sysram # for Secure SYSRAM + - samsung,exynos4210-sysram-ns # for Non-secure SYSRAM +
Krzysztof Kozlowski
maintainerRe: [PATCH v3 02/10] dt-bindings: sram: Convert Samsung Exynos SYSRAM bindings to json-schema
Quoted 55 lines · Rob Herring
Quoted 43 lines · Krzysztof Kozlowski
Convert Samsung Exynos SYSRAM bindings to DT schema format using json-schema.
Signed-off-by Krzysztof Kozlowski <[email protected]>---
Changes since v2:
1. Use sram as name of node in example.Changes since v1:
1. Indent example with four spaces (more readable).--- .../devicetree/bindings/sram/samsung-sram.txt | 38 ------------ .../bindings/sram/samsung-sram.yaml | 58 +++++++++++++++++++ MAINTAINERS | 2 +- 3 files changed, 59 insertions(+), 39 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sram/samsung-sram.txt create mode 100644 Documentation/devicetree/bindings/sram/samsung-sram.yamlDocumentation/devicetree/bindings/sram/samsung-sram.yaml new file +16
-0@@ -0,0 +1,58 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sram/samsung-sram.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung Exynos SoC SYSRAM for SMP bringup + +maintainers: + - Krzysztof Kozlowski <[email protected]> + +description: |+ + Samsung SMP-capable Exynos SoCs use part of the SYSRAM for the bringup + of the secondary cores. Once the core gets powered up it executes the + code that is residing at some specific location of the SYSRAM. +Documentation/devicetree/bindings/sram/samsung-sram.yaml line 26
Quoted 10 lines
Documentation/devicetree/bindings/sram/samsung-sram.yaml new file +10
-0+ Therefore reserved section sub-nodes have to be added to the mmio-sram + declaration. These nodes are of two types depending upon secure or + non-secure execution environment. + +allOf: + - $ref: "sram.yaml#" + +properties: + $nodename: + pattern: "^sysram(@.*)?"
Quoted 8 lines
As you are renaming all the node names, this will no longer work. If you change it to 'sram', that's going to match others, but would still work as long as the child node names are unique to Samsung. If you change them to '*-sram' then, you'd have to come up with something else. That probably means using 'compatible' strings. At that point, it's kind of silly to just be validating what your are using to select the schema. It may be better to just add the compatible strings into
sram.yamlif that's the only difference.
You're right. I'll move them to sram.yaml and maybe add also example.
Best regards,
Krzysztof
Krzysztof Kozlowski
maintainerPATCH v3 3/10 ARM: dts: exynos: Rename SysRAM node to "sram"
In reply to Krzysztof KozlowskiThe device node name should reflect generic class of a device so rename the SysRAM node from "sysram" to "sram". The child nodes stay as before as "smp-sysram" to match their real purpose. This will be also in sync with upcoming DT schema. No functional change.
--- arch/arm/boot/dts/exynos3250.dtsi | 2 +- arch/arm/boot/dts/exynos4210.dtsi | 2 +- arch/arm/boot/dts/exynos4412.dtsi | 2 +- arch/arm/boot/dts/exynos5250.dtsi | 2 +- arch/arm/boot/dts/exynos54xx.dtsi | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/exynos3250.dtsi +1 -1
@@ -138,7 +138,7 @@ #size-cells = <1>; ranges; - sysram@2020000 { + sram@2020000 { compatible = "mmio-sram"; reg = <0x02020000 0x40000>; #address-cells = <1>;
arch/arm/boot/dts/exynos4210.dtsi +1 -1
@@ -72,7 +72,7 @@ }; soc: soc { - sysram: sysram@2020000 { + sysram: sram@2020000 { compatible = "mmio-sram"; reg = <0x02020000 0x20000>; #address-cells = <1>;
arch/arm/boot/dts/exynos4412.dtsi +1 -1
@@ -188,7 +188,7 @@ interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>; }; - sysram@2020000 { + sram@2020000 { compatible = "mmio-sram"; reg = <0x02020000 0x40000>; #address-cells = <1>;
arch/arm/boot/dts/exynos5250.dtsi +1 -1
@@ -164,7 +164,7 @@ }; soc: soc { - sysram@2020000 { + sram@2020000 { compatible = "mmio-sram"; reg = <0x02020000 0x30000>; #address-cells = <1>;
arch/arm/boot/dts/exynos54xx.dtsi +1 -1
@@ -46,7 +46,7 @@ }; soc: soc { - sysram@2020000 { + sram@2020000 { compatible = "mmio-sram"; reg = <0x02020000 0x54000>; #address-cells = <1>;
Signature · 1 line
2.17.1
Re: [PATCH v3 03/10] ARM: dts: exynos: Rename SysRAM node to "sram"
Quoted 5 lines · Krzysztof Kozlowski
The device node name should reflect generic class of a device so rename the SysRAM node from "sysram" to "sram". The child nodes stay as before as "smp-sysram" to match their real purpose. This will be also in sync with upcoming DT schema. No functional change.
Quoted 7 lines
Signed-off-by Krzysztof Kozlowski <[email protected]>--- arch/arm/boot/dts/exynos3250.dtsi | 2 +- arch/arm/boot/dts/exynos4210.dtsi | 2 +- arch/arm/boot/dts/exynos4412.dtsi | 2 +- arch/arm/boot/dts/exynos5250.dtsi | 2 +- arch/arm/boot/dts/exynos54xx.dtsi | 2 +-
Applied this one to samsung-soc.
Best regards,
Krzysztof
Krzysztof Kozlowski
maintainerPATCH v3 4/10 arm64: dts: tegra: Rename sysram node to "sram"
In reply to Krzysztof KozlowskiThe device node name should reflect generic class of a device so rename the "sysram" node to "sram". This will be also in sync with upcoming DT schema. No functional change.
--- arch/arm64/boot/dts/nvidia/tegra186.dtsi | 2 +- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/nvidia/tegra186.dtsi +1 -1
@@ -1174,7 +1174,7 @@ power-domains = <&bpmp TEGRA186_POWER_DOMAIN_GPU>; }; - sysram@30000000 { + sram@30000000 { compatible = "nvidia,tegra186-sysram", "mmio-sram"; reg = <0x0 0x30000000 0x0 0x50000>; #address-cells = <2>;
arch/arm64/boot/dts/nvidia/tegra194.dtsi +1 -1
@@ -1430,7 +1430,7 @@ 0x82000000 0x0 0x40000000 0x1f 0x40000000 0x0 0xc0000000>; /* non-prefetchable memory (3GB) */ }; - sysram@40000000 { + sram@40000000 { compatible = "nvidia,tegra194-sysram", "mmio-sram"; reg = <0x0 0x40000000 0x0 0x50000>; #address-cells = <1>;
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH v3 5/10 ARM: dts: dove: Rename "sa-sram" node to "sram"
In reply to Krzysztof KozlowskiThe device node name should reflect generic class of a device so rename the "sa-sram" node to "sram". This will be also in sync with upcoming DT schema. No functional change.
--- arch/arm/boot/dts/dove.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/dove.dtsi +1 -1
@@ -784,7 +784,7 @@ status = "disabled"; }; - crypto_sram: sa-sram@ffffe000 { + crypto_sram: sram@ffffe000 { compatible = "mmio-sram"; reg = <0xffffe000 0x800>; clocks = <&gate_clk 15>;
Signature · 1 line
2.17.1
Re: [PATCH v3 05/10] ARM: dts: dove: Rename "sa-sram" node to "sram"
Hi Krzysztof Kozlowski,
Quoted 5 lines
The device node name should reflect generic class of a device so rename the "sa-sram" node to "sram". This will be also in sync with upcoming DT schema. No functional change.
Signed-off-by Krzysztof Kozlowski <[email protected]>
Applied on mvebu/dt
Thanks,
Gregory
Quoted 20 lines
--- arch/arm/boot/dts/dove.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/boot/dts/dove.dtsi +1
-1@@ -784,7 +784,7 @@ status = "disabled"; }; - crypto_sram: sa-sram@ffffe000 { + crypto_sram: sram@ffffe000 { compatible = "mmio-sram"; reg = <0xffffe000 0x800>; clocks = <&gate_clk 15>;Signature · 1 line
2.17.1
Signature · 3 lines
Gregory Clement, Bootlin Embedded Linux and Kernel engineering http://bootlin.com
Krzysztof Kozlowski
maintainerPATCH v3 6/10 ARM: dts: imx: Rename "iram" node to "sram"
In reply to Krzysztof KozlowskiThe device node name should reflect generic class of a device so rename the "iram" node to "sram". This will be also in sync with upcoming DT schema. No functional change.
--- arch/arm/boot/dts/imx27.dtsi | 2 +- arch/arm/boot/dts/imx31.dtsi | 2 +- arch/arm/boot/dts/imx51.dtsi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/imx27.dtsi +1 -1
@@ -585,7 +585,7 @@ status = "disabled"; }; - iram: iram@ffff4c00 { + iram: sram@ffff4c00 { compatible = "mmio-sram"; reg = <0xffff4c00 0xb400>; };
arch/arm/boot/dts/imx31.dtsi +1 -1
@@ -55,7 +55,7 @@ interrupt-parent = <&avic>; ranges; - iram: iram@1fffc000 { + iram: sram@1fffc000 { compatible = "mmio-sram"; reg = <0x1fffc000 0x4000>; #address-cells = <1>;
arch/arm/boot/dts/imx51.dtsi +1 -1
@@ -116,7 +116,7 @@ interrupt-parent = <&tzic>; ranges; - iram: iram@1ffe0000 { + iram: sram@1ffe0000 { compatible = "mmio-sram"; reg = <0x1ffe0000 0x20000>; };
Signature · 1 line
2.17.1
Re: [PATCH v3 06/10] ARM: dts: imx: Rename "iram" node to "sram"
Quoted 5 lines · Krzysztof Kozlowski
The device node name should reflect generic class of a device so rename the "iram" node to "sram". This will be also in sync with upcoming DT schema. No functional change.
Signed-off-by Krzysztof Kozlowski <[email protected]>
Let me know if you want it go through IMX tree.
Shawn
Krzysztof Kozlowski
maintainerRe: [PATCH v3 06/10] ARM: dts: imx: Rename "iram" node to "sram"
Quoted 11 lines · Shawn Guo
Quoted 5 lines · Krzysztof Kozlowski
The device node name should reflect generic class of a device so rename the "iram" node to "sram". This will be also in sync with upcoming DT schema. No functional change.
Signed-off-by Krzysztof Kozlowski <[email protected]>Acked-by Shawn Guo <[email protected]>Let me know if you want it go through IMX tree.
Yes please, I think each of these should go through soc maintainers.
Best regards,
Krzysztof
Shawn Guo
AppliedRe: [PATCH v3 06/10] ARM: dts: imx: Rename "iram" node to "sram"
In reply to Krzysztof KozlowskiQuoted 5 lines · Krzysztof Kozlowski
The device node name should reflect generic class of a device so rename the "iram" node to "sram". This will be also in sync with upcoming DT schema. No functional change.
Signed-off-by Krzysztof Kozlowski <[email protected]>
Applied, thanks.
Krzysztof Kozlowski
maintainerPATCH v3 7/10 ARM: dts: keystone: Rename "msmram" node to "sram"
In reply to Krzysztof KozlowskiThe device node name should reflect generic class of a device so rename the "msmram" node to "sram". This will be also in sync with upcoming DT schema. No functional change.
--- arch/arm/boot/dts/keystone-k2e.dtsi | 2 +- arch/arm/boot/dts/keystone-k2g.dtsi | 2 +- arch/arm/boot/dts/keystone-k2hk.dtsi | 2 +- arch/arm/boot/dts/keystone-k2l.dtsi | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/keystone-k2e.dtsi +1 -1
@@ -86,7 +86,7 @@ }; }; - msm_ram: msmram@c000000 { + msm_ram: sram@c000000 { compatible = "mmio-sram"; reg = <0x0c000000 0x200000>; ranges = <0x0 0x0c000000 0x200000>;
arch/arm/boot/dts/keystone-k2g.dtsi +1 -1
@@ -95,7 +95,7 @@ ranges = <0x0 0x0 0x0 0xc0000000>; dma-ranges = <0x80000000 0x8 0x00000000 0x80000000>; - msm_ram: msmram@c000000 { + msm_ram: sram@c000000 { compatible = "mmio-sram"; reg = <0x0c000000 0x100000>; ranges = <0x0 0x0c000000 0x100000>;
arch/arm/boot/dts/keystone-k2hk.dtsi +1 -1
@@ -57,7 +57,7 @@ &soc0 { /include/ "keystone-k2hk-clocks.dtsi" - msm_ram: msmram@c000000 { + msm_ram: sram@c000000 { compatible = "mmio-sram"; reg = <0x0c000000 0x600000>; ranges = <0x0 0x0c000000 0x600000>;
arch/arm/boot/dts/keystone-k2l.dtsi +1 -1
@@ -255,7 +255,7 @@ }; }; - msm_ram: msmram@c000000 { + msm_ram: sram@c000000 { compatible = "mmio-sram"; reg = <0x0c000000 0x200000>; ranges = <0x0 0x0c000000 0x200000>;
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH v3 8/10 ARM: dts: tegra: Rename "iram" node to "sram"
In reply to Krzysztof KozlowskiThe device node name should reflect generic class of a device so rename the "iram" node to "sram". This will be also in sync with upcoming DT schema. No functional change.
--- arch/arm/boot/dts/tegra20.dtsi | 2 +- arch/arm/boot/dts/tegra30.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/tegra20.dtsi +1 -1
@@ -16,7 +16,7 @@ reg = <0 0>; }; - iram@40000000 { + sram@40000000 { compatible = "mmio-sram"; reg = <0x40000000 0x40000>; #address-cells = <1>;
arch/arm/boot/dts/tegra30.dtsi +1 -1
@@ -96,7 +96,7 @@ }; }; - iram@40000000 { + sram@40000000 { compatible = "mmio-sram"; reg = <0x40000000 0x40000>; #address-cells = <1>;
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH v3 9/10 ARM: dts: am: Rename "ocmcram" node to "sram"
In reply to Krzysztof KozlowskiThe device node name should reflect generic class of a device so rename the "ocmcram" node to "sram". This will be also in sync with upcoming DT schema. No functional change.
--- arch/arm/boot/dts/am33xx.dtsi | 2 +- arch/arm/boot/dts/am4372.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/am33xx.dtsi +1 -1
@@ -393,7 +393,7 @@ }; }; - ocmcram: ocmcram@40300000 { + ocmcram: sram@40300000 { compatible = "mmio-sram"; reg = <0x40300000 0x10000>; /* 64k */ ranges = <0x0 0x40300000 0x10000>;
arch/arm/boot/dts/am4372.dtsi +1 -1
@@ -349,7 +349,7 @@ }; }; - ocmcram: ocmcram@40300000 { + ocmcram: sram@40300000 { compatible = "mmio-sram"; reg = <0x40300000 0x40000>; /* 256k */ ranges = <0x0 0x40300000 0x40000>;
Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerPATCH v3 10/10 ARM: dts: omap: Rename "ocmcram" node to "sram"
In reply to Krzysztof KozlowskiThe device node name should reflect generic class of a device so rename the "ocmcram" node to "sram". This will be also in sync with upcoming DT schema. No functional change.
--- arch/arm/boot/dts/omap4.dtsi | 2 +- arch/arm/boot/dts/omap5.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/omap4.dtsi +1 -1
@@ -148,7 +148,7 @@ l4_abe: interconnect@40100000 { }; - ocmcram: ocmcram@40304000 { + ocmcram: sram@40304000 { compatible = "mmio-sram"; reg = <0x40304000 0xa000>; /* 40k */ };
arch/arm/boot/dts/omap5.dtsi +1 -1
@@ -162,7 +162,7 @@ l4_abe: interconnect@40100000 { }; - ocmcram: ocmcram@40300000 { + ocmcram: sram@40300000 { compatible = "mmio-sram"; reg = <0x40300000 0x20000>; /* 128k */ };
Signature · 1 line
2.17.1
Re: [PATCH v3 10/10] ARM: dts: omap: Rename "ocmcram" node to "sram"
Quoted 3 lines · Krzysztof Kozlowski
The device node name should reflect generic class of a device so rename the "ocmcram" node to "sram". This will be also in sync with upcoming DT schema. No functional change.
Applying this into omap-for-v5.5/dt thanks.
Tony
Rob Herring
maintainerQuoted 85 lines · Krzysztof Kozlowski
Convert generic mmio-sram bindings to DT schema format using json-schema. Require the address/size cells to be 1, not equal to root node.
Signed-off-by Krzysztof Kozlowski <[email protected]>---
Changes since v2:
1. Add Rob as maintainer,
2. Use "contains" for compatible,
3. Fix address and size cells to 1,
4. Add maxitems to reg under children,
5. Remove unneeded string type from label.Changes since v1:
1. Indent example with four spaces (more readable).--- .../devicetree/bindings/sram/sram.txt | 80 ----------- .../devicetree/bindings/sram/sram.yaml | 134 ++++++++++++++++++ 2 files changed, 134 insertions(+), 80 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sram/sram.txt create mode 100644 Documentation/devicetree/bindings/sram/sram.yamlDocumentation/devicetree/bindings/sram/sram.yaml new file +54
-0@@ -0,0 +1,134 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sram/sram.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Generic on-chip SRAM + +maintainers: + - Rob Herring <[email protected]> + +description: |+ + Simple IO memory regions to be managed by the genalloc API. + + Each child of the sram node specifies a region of reserved memory. Each + child node should use a 'reg' property to specify a specific range of + reserved memory. + + Following the generic-names recommended practice, node names should + reflect the purpose of the node. Unit address (@<address>) should be + appended to the name. + +properties: + $nodename: + pattern: "^sram(@.*)?" + + compatible: + contains: + enum: + - mmio-sram + - atmel,sama5d2-securam + + reg: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + + ranges: + description: + Should translate from local addresses within the sram to bus addresses. + + no-memory-wc: + description: + The flag indicating, that SRAM memory region has not to be remapped + as write combining. WC is used by default. + type: boolean + +patternProperties: + "^([a-z]*-)?sram@[a-f0-9]$": + type: object
Documentation/devicetree/bindings/sram/sram.yaml line 64
Quoted 10 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +10
-0+ description: + Each child of the sram node specifies a region of reserved memory. + properties: + reg: + description: + IO mem address range, relative to the SRAM range. + maxItems: 1 + + compatible: + $ref: /schemas/types.yaml#/definitions/string
No need to define the type again. We can say 'maxItems: 1' if we really want to force it to 1 entry.
Quoted 21 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +21
-0+ description: + Should contain a vendor specific string in the form + <vendor>,[<device>-]<usage> + + pool: + description: + Indicates that the particular reserved SRAM area is addressable + and in use by another device or devices. + type: boolean + + export: + description: + Indicates that the reserved SRAM area may be accessed outside + of the kernel, e.g. by bootloader or userspace. + type: boolean + + protect-exec: + description: | + Same as 'pool' above but with the additional constraint that code + will be run from the region and that the memory is maintained as + read-only, executable during code execution. NOTE: This region must
Documentation/devicetree/bindings/sram/sram.yaml line 95
Quoted 10 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +10
-0+ be page aligned on start and end in order to properly allow + manipulation of the page attributes. + type: boolean + + label: + description: + The name for the reserved partition, if omitted, the label is taken + from the node name excluding the unit address. + + clocks:
Shouldn't this be up one level? Looks like this is the only case (Marvell and i.MX are the only ones I see with clocks).
Documentation/devicetree/bindings/sram/sram.yaml line 98
Quoted 3 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +3
-0+ description: + A list of phandle and clock specifier pair that controls the + single SRAM clock.
maxItems: 1
Documentation/devicetree/bindings/sram/sram.yaml line 108
Quoted 10 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +10
-0+ + required: + - reg + +required: + - compatible + - reg + - "#address-cells" + - "#size-cells" + - ranges
Does 'additionalProperties' work here and/or in the child node? I guess not if we keep some node names.
Quoted 12 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +12
-0+ +examples: + - | + sram: sram@5c000000 { + compatible = "mmio-sram"; + reg = <0x5c000000 0x40000>; /* 256 KiB SRAM at address 0x5c000000 */ + + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x5c000000 0x40000>; + + smp-sram@100 {
Documentation/devicetree/bindings/sram/sram.yaml line 130
Quoted 10 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +10
-0+ compatible = "socvendor,smp-sram"; + reg = <0x100 0x50>; + }; + + device-sram@1000 { + reg = <0x1000 0x1000>; + pool; + }; + + exported@20000 {
This one doesn't match the pattern. That's fine I guess for dts files, but examples should be good examples.
Quoted 7 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +4
-0+ reg = <0x20000 0x20000>; + export; + }; + };Signature · 1 line
2.17.1
Krzysztof Kozlowski
maintainerQuoted 91 lines · Rob Herring
Quoted 90 lines · Krzysztof Kozlowski
Convert generic mmio-sram bindings to DT schema format using json-schema. Require the address/size cells to be 1, not equal to root node.
Signed-off-by Krzysztof Kozlowski <[email protected]>---
Changes since v2:
1. Add Rob as maintainer,
2. Use "contains" for compatible,
3. Fix address and size cells to 1,
4. Add maxitems to reg under children,
5. Remove unneeded string type from label.Changes since v1:
1. Indent example with four spaces (more readable).--- .../devicetree/bindings/sram/sram.txt | 80 ----------- .../devicetree/bindings/sram/sram.yaml | 134 ++++++++++++++++++ 2 files changed, 134 insertions(+), 80 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sram/sram.txt create mode 100644 Documentation/devicetree/bindings/sram/sram.yamlDocumentation/devicetree/bindings/sram/sram.yaml new file +59
-0@@ -0,0 +1,134 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sram/sram.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Generic on-chip SRAM + +maintainers: + - Rob Herring <[email protected]> + +description: |+ + Simple IO memory regions to be managed by the genalloc API. + + Each child of the sram node specifies a region of reserved memory. Each + child node should use a 'reg' property to specify a specific range of + reserved memory. + + Following the generic-names recommended practice, node names should + reflect the purpose of the node. Unit address (@<address>) should be + appended to the name. + +properties: + $nodename: + pattern: "^sram(@.*)?" + + compatible: + contains: + enum: + - mmio-sram + - atmel,sama5d2-securam + + reg: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + + ranges: + description: + Should translate from local addresses within the sram to bus addresses. + + no-memory-wc: + description: + The flag indicating, that SRAM memory region has not to be remapped + as write combining. WC is used by default. + type: boolean + +patternProperties: + "^([a-z]*-)?sram@[a-f0-9]$": + type: object + description: + Each child of the sram node specifies a region of reserved memory. + properties: + reg: + description:
Quoted 8 lines
Documentation/devicetree/bindings/sram/sram.yaml line 64
Quoted 5 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +5
-0+ IO mem address range, relative to the SRAM range. + maxItems: 1 + + compatible: + $ref: /schemas/types.yaml#/definitions/stringNo need to define the type again. We can say 'maxItems: 1' if we really want to force it to 1 entry.
I'll fix it and integrate Samsung compatibles here.
Quoted 27 lines
Quoted 27 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +26
-0+ description: + Should contain a vendor specific string in the form + <vendor>,[<device>-]<usage> + + pool: + description: + Indicates that the particular reserved SRAM area is addressable + and in use by another device or devices. + type: boolean + + export: + description: + Indicates that the reserved SRAM area may be accessed outside + of the kernel, e.g. by bootloader or userspace. + type: boolean + + protect-exec: + description: | + Same as 'pool' above but with the additional constraint that code + will be run from the region and that the memory is maintained as + read-only, executable during code execution. NOTE: This region must + be page aligned on start and end in order to properly allow + manipulation of the page attributes. + type: boolean + + label:
Quoted 8 lines
Documentation/devicetree/bindings/sram/sram.yaml line 95
Quoted 5 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +5
-0+ description: + The name for the reserved partition, if omitted, the label is taken + from the node name excluding the unit address. + + clocks:Shouldn't this be up one level? Looks like this is the only case (Marvell and i.MX are the only ones I see with clocks).
Yes, that's a mistake in original bindings.
Quoted 6 lines
Documentation/devicetree/bindings/sram/sram.yaml line 98
Quoted 4 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +3
-0+ description: + A list of phandle and clock specifier pair that controls the + single SRAM clock.maxItems: 1
Yes.
Quoted 14 lines
Documentation/devicetree/bindings/sram/sram.yaml line 108
Quoted 11 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +10
-0+ + required: + - reg + +required: + - compatible + - reg + - "#address-cells" + - "#size-cells" + - rangesDoes 'additionalProperties' work here and/or in the child node? I guess not if we keep some node names.
It seems that it works.
Quoted 18 lines
Quoted 18 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +17
-0+ +examples: + - | + sram: sram@5c000000 { + compatible = "mmio-sram"; + reg = <0x5c000000 0x40000>; /* 256 KiB SRAM at address 0x5c000000 */ + + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x5c000000 0x40000>; + + smp-sram@100 { + compatible = "socvendor,smp-sram"; + reg = <0x100 0x50>; + }; + + device-sram@1000 {
Quoted 8 lines
Documentation/devicetree/bindings/sram/sram.yaml line 130
Quoted 5 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +5
-0+ reg = <0x1000 0x1000>; + pool; + }; + + exported@20000 {This one doesn't match the pattern. That's fine I guess for dts files, but examples should be good examples.
Sure.
Best regards,
Krzysztof
Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/sram/sram.yaml new file +4
-0+ reg = <0x20000 0x20000>; + export; + }; + };Signature · 1 line
2.17.1