Skip to contentSkip to conversation

Exynos SROMc configuration and Ethernet support for SMDK5410

PATCH Superseded Pavel Fedin 5 participants 23 messages Oct 29, 2015 – Nov 3, 2015

Subsystems (4)

v4 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v4 cover Exynos SROMc configuration and Ethernet support for SMDK5410

This patch extends Exynos SROM controller driver with ability to configure controller outputs and enables SMSC9115 Ethernet chip on SMDK5410 board, which is connected via SROMc bank #3.

With this patchset, support for the whole existing SMDK range can be added. Actually, only bank number is different.

This patchset also depends on Exynos 5410 pinctrl support, introduced by patches 0003 and 0004 from this set:
[PATCH v4 0/5] ARM: EXYNOS: ODROID-XU DT and LEDs
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-March/330862.html

Pinctrl support is necessary in order to correctly configure multifunctional pins of the Exynos chip.

v3 => v4:
- Devices are now added as subnodes, with additional properties. This allows to cleary specify dependency. If configuration fails, error will be reported and child devices will not be probed.
- These additional properties now have "samsung,srom-XXX" format
- Fixed code style, now better understood.

v2 => v3:
- Fixed up SROMc region size in the device tree
- Reordered patches, documentation goes first now

v1 => v2:
- Fixed some typos and bad labels in device tree
- Improved documentation

Pavel Fedin (4):
Documentation: dt-bindings: Describe SROMc configuration
ARM: dts: Add SROMc to Exynos 5410
drivers: exynos-srom: Add support for bank configuration
ARM: dts: Add Ethernet chip to SMDK5410

 .../bindings/arm/samsung/exynos-srom.txt           | 50 ++++++++++++++++++-
 arch/arm/boot/dts/exynos5410-smdk5410.dts          | 41 +++++++++++++++
 arch/arm/boot/dts/exynos5410.dtsi                  | 15 ++++++
 arch/arm/mach-exynos/Kconfig                       |  2 +-
 drivers/soc/samsung/Kconfig                        |  2 +-
 drivers/soc/samsung/exynos-srom.c                  | 58 +++++++++++++++++++++-
 6 files changed, 162 insertions(+), 6 deletions(-)
Signature · 1 line
2.4.4
#1 lore raw

PATCH v4 1/4 Documentation: dt-bindings: Describe SROMc configuration

Add documentation for new subnode properties, allowing bank configuration. Based on u-boot implementation, but heavily reworked.

---
 .../bindings/arm/samsung/exynos-srom.txt           | 50 +++++++++++++++++++++-
 1 file changed, 48 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt +48 -2
index 33886d5..02ecc7f 100644
@@ -5,8 +5,54 @@ Required properties:
 
 - reg: offset and length of the register set
 
-Example:
+- #address-cells, #size-cells : should be '1' if the device has sub-nodes
+				with 'reg' property.
+- ranges: allows valid 1:1 translation between child's address space and
+	  parent's address space
+
+Sub-nodes:
+The SROM controller can be used to attach external peripherials. In this case
+device nodes should be added as subnodes to the SROMc node. These subnodes,
+except regular device specification, should contain the following properties,
+describing configuration of the relevant SROM bank:
+
+Required properties:
+- samsung,srom-bank : bank number (0 - 3)
+
+- samsung,srom-timing : array of 7 integers: PMC, Tacp, Tcah, Tcoh, Tacc, Tcos,
+			Tacs
+
+Optional properties:
+- samsung,srom-data-width : data width in bytes (1 or 2). If omitted, default
+			    of 1 is used.
+
+Example: basic definition, no banks are configured
 	sromc at 12570000 {
 		compatible = "samsung,exynos-srom";
-		reg = <0x12570000 0x10>;
+		reg = <0x12570000 0x14>;
+	};
+
+Example: SROMc with smsc 911x ethernet chip on bank 3
+	sromc at 12570000 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		compatible = "samsung,exynos-srom";
+		reg = <0x12570000 0x14>;
+
+		ethernet at 07000000 {
+			compatible = "smsc,lan9115";
+			reg = <0x07000000 0x10000>;
+			phy-mode = "mii";
+			interrupt-parent = <&gpx0>;
+			interrupts = <5 8>;
+			reg-io-width = <2>;
+			smsc,irq-push-pull;
+			smsc,force-internal-phy;
+
+			samsung,srom-bank = <3>;
+			samsung,srom-data-width = <2>;
+			samsung,srom-timing = <1 9 12 1 9 1 1>;
+		};
 	};
Signature · 1 line
2.4.4
#13 lore raw

PATCH v4 2/4 ARM: dts: Add SROMc to Exynos 5410

In reply to Pavel Fedin

This machine uses own SoC device tree file, add missing part.

---
 arch/arm/boot/dts/exynos5410.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/boot/dts/exynos5410.dtsi +15 -0
index 4603356..da6a8fa0e 100644
@@ -101,6 +101,15 @@
 			reg = <0x10000000 0x100>;
 		};
 
+		sromc: sromc at 12250000 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges;
+
+			compatible = "samsung,exynos-srom";
+			reg = <0x12250000 0x14>;
+		};
+
 		pmu_system_controller: system-controller at 10040000 {
 			compatible = "samsung,exynos5410-pmu", "syscon";
 			reg = <0x10040000 0x5000>;
@@ -133,6 +142,12 @@
 						<10 &gic 0 130 0>,
 						<11 &gic 0 131 0>;
 			};
+
+			arch_timer {
+				compatible = "arm,armv7-timer";
+				clock-frequency = <24000000>;
+			};
+
 		};
 
 		sysram at 02020000 {
Signature · 1 line
2.4.4
#18 lore raw

PATCH v4 3/4 drivers: exynos-srom: Add support for bank configuration

In reply to Pavel Fedin

Implement handling properties in subnodes and adding child devices to the system. Child devices will not be added if configuration fails.

Since the driver now does more than suspend-resume support, dependency on CONFIG_PM is removed.

---
 arch/arm/mach-exynos/Kconfig      |  2 +-
 drivers/soc/samsung/Kconfig       |  2 +-
 drivers/soc/samsung/exynos-srom.c | 58 +++++++++++++++++++++++++++++++++++++--
 3 files changed, 58 insertions(+), 4 deletions(-)
arch/arm/mach-exynos/Kconfig +1 -1
index 83c85f5..c22dc42 100644
@@ -16,7 +16,7 @@ menuconfig ARCH_EXYNOS
 	select ARM_GIC
 	select COMMON_CLK_SAMSUNG
 	select EXYNOS_THERMAL
-	select EXYNOS_SROM if PM
+	select EXYNOS_SROM
 	select HAVE_ARM_SCU if SMP
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
drivers/soc/samsung/Kconfig +1 -1
index 2833b5b..ea4bc2a 100644
@@ -8,6 +8,6 @@ config SOC_SAMSUNG
 
 config EXYNOS_SROM
 	bool
-	depends on ARM && ARCH_EXYNOS && PM
+	depends on ARM && ARCH_EXYNOS
 
 endmenu
drivers/soc/samsung/exynos-srom.c +56 -2

80 lines not on this page · raw message

Signature · 1 line
2.4.4
#19 lore raw

PATCH v4 4/4 ARM: dts: Add Ethernet chip to SMDK5410

In reply to Pavel Fedin

The chip is smsc9115, connected via SROMc bank 3. Additionally, some GPIO initialization is required.

---
 arch/arm/boot/dts/exynos5410-smdk5410.dts | 41 +++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
arch/arm/boot/dts/exynos5410-smdk5410.dts +41 -0
index cebeaab..311e7be 100644
@@ -61,6 +61,27 @@
 	disable-wp;
 };
 
+&pinctrl_0 {
+	srom_ctl: srom-ctl {
+		samsung,pins = "gpy0-3", "gpy0-4", "gpy0-5",
+			       "gpy1-0", "gpy1-1", "gpy1-2", "gpy1-3";
+		samsung,pin-function = <2>;
+		samsung,pin-drv = <0>;
+	};
+
+	srom_ebi: srom-ebi {
+		samsung,pins = "gpy3-0", "gpy3-1", "gpy3-2", "gpy3-3",
+			       "gpy3-4", "gpy3-5", "gpy3-6", "gpy3-7",
+			       "gpy5-0", "gpy5-1", "gpy5-2", "gpy5-3",
+			       "gpy5-4", "gpy5-5", "gpy5-6", "gpy5-7",
+			       "gpy6-0", "gpy6-1", "gpy6-2", "gpy6-3",
+			       "gpy6-4", "gpy6-5", "gpy6-6", "gpy6-7";
+		samsung,pin-function = <2>;
+		samsung,pin-pud = <3>;
+		samsung,pin-drv = <0>;
+	};
+};
+
 &uart0 {
 	status = "okay";
 };
@@ -72,3 +93,23 @@
 &uart2 {
 	status = "okay";
 };
+
+&sromc {
+	pinctrl-names = "default";
+	pinctrl-0 = <&srom_ctl>, <&srom_ebi>;
+
+	ethernet at 07000000 {
+		compatible = "smsc,lan9115";
+		reg = <0x07000000 0x10000>;
+		phy-mode = "mii";
+		interrupt-parent = <&gpx0>;
+		interrupts = <5 8>;
+		reg-io-width = <2>;
+		smsc,irq-push-pull;
+		smsc,force-internal-phy;
+
+		samsung,srom-bank = <3>;
+		samsung,srom-data-width = <2>;
+		samsung,srom-timing = <1 9 12 1 9 1 1>;
+	};
+};
Signature · 1 line
2.4.4
#14 lore raw

Re: [PATCH v4 2/4] ARM: dts: Add SROMc to Exynos 5410

In reply to Pavel Fedin

Hi Pavel,

Quoted 12 lines · Pavel Fedin

This machine uses own SoC device tree file, add missing part.

---
 arch/arm/boot/dts/exynos5410.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/boot/dts/exynos5410.dtsi +0 -0
index 4603356..da6a8fa0e 100644

arch/arm/boot/dts/exynos5410.dtsi line 108

Quoted 8 lines
arch/arm/boot/dts/exynos5410.dtsi +5 -0
@@ -101,6 +101,15 @@
                        reg = <0x10000000 0x100>;
                };
 
+               sromc: sromc at 12250000 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+

We do not need to specify these three properties as they are already present in parent node "soc".

Quoted 8 lines
arch/arm/boot/dts/exynos5410.dtsi +4 -0
+                       compatible = "samsung,exynos-srom";
+                       reg = <0x12250000 0x14>;
+               };
+
                pmu_system_controller: system-controller at 10040000 {
                        compatible = "samsung,exynos5410-pmu", "syscon";
                        reg = <0x10040000 0x5000>;

arch/arm/boot/dts/exynos5410.dtsi line 150

Quoted 9 lines
arch/arm/boot/dts/exynos5410.dtsi +6 -0
@@ -133,6 +142,12 @@
                                                <10 &gic 0 130 0>,
                                                <11 &gic 0 131 0>;
                        };
+
+                       arch_timer {
+                               compatible = "arm,armv7-timer";
+                               clock-frequency = <24000000>;
+                       };
+

This change should not be part of this patch.

Thanks,
Pankaj Dubey

Quoted 10 lines
arch/arm/boot/dts/exynos5410.dtsi +0 -1
                };
 
                sysram at 02020000 {
--

2.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#20 lore raw

Re: [PATCH v4 4/4] ARM: dts: Add Ethernet chip to SMDK5410

In reply to Pavel Fedin

Hi Pavel,

Quoted 52 lines · Pavel Fedin

The chip is smsc9115, connected via SROMc bank 3. Additionally, some GPIO initialization is required.

---
 arch/arm/boot/dts/exynos5410-smdk5410.dts | 41 +++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
arch/arm/boot/dts/exynos5410-smdk5410.dts +29 -0
index cebeaab..311e7be 100644
@@ -61,6 +61,27 @@
        disable-wp;
 };
 
+&pinctrl_0 {
+       srom_ctl: srom-ctl {
+               samsung,pins = "gpy0-3", "gpy0-4", "gpy0-5",
+                              "gpy1-0", "gpy1-1", "gpy1-2", "gpy1-3";
+               samsung,pin-function = <2>;
+               samsung,pin-drv = <0>;
+       };
+
+       srom_ebi: srom-ebi {
+               samsung,pins = "gpy3-0", "gpy3-1", "gpy3-2", "gpy3-3",
+                              "gpy3-4", "gpy3-5", "gpy3-6", "gpy3-7",
+                              "gpy5-0", "gpy5-1", "gpy5-2", "gpy5-3",
+                              "gpy5-4", "gpy5-5", "gpy5-6", "gpy5-7",
+                              "gpy6-0", "gpy6-1", "gpy6-2", "gpy6-3",
+                              "gpy6-4", "gpy6-5", "gpy6-6", "gpy6-7";
+               samsung,pin-function = <2>;
+               samsung,pin-pud = <3>;
+               samsung,pin-drv = <0>;
+       };
+};
+
 &uart0 {
        status = "okay";
 };
@@ -72,3 +93,23 @@
 &uart2 {
        status = "okay";
 };
+
+&sromc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&srom_ctl>, <&srom_ebi>;
+
+       ethernet at 07000000 {
+               compatible = "smsc,lan9115";
+               reg = <0x07000000 0x10000>;

arch/arm/boot/dts/exynos5410-smdk5410.dts line 113

Quoted 10 lines
arch/arm/boot/dts/exynos5410-smdk5410.dts +10 -0
+               phy-mode = "mii";
+               interrupt-parent = <&gpx0>;
+               interrupts = <5 8>;
+               reg-io-width = <2>;
+               smsc,irq-push-pull;
+               smsc,force-internal-phy;
+
+               samsung,srom-bank = <3>;
+               samsung,srom-data-width = <2>;
+               samsung,srom-timing = <1 9 12 1 9 1 1>;

I think this is not correct. We can't change binding of "smsc,lan9115" which is already documented here [1]. These samsung specific srom properties should be in srom node or its subnode, but not in this way.

[1]: Documentation/devicetree/bindings/net/smsc911x.txt

Thanks,
Pankaj Dubey

Quoted 9 lines
arch/arm/boot/dts/exynos5410-smdk5410.dts +2 -1
+       };
+};
--

2.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#21 lore raw
In reply to Pavel Fedin
Quoted 36 lines · Pavel Fedin

This patch extends Exynos SROM controller driver with ability to configure controller outputs and enables SMSC9115 Ethernet chip on SMDK5410 board, which is connected via SROMc bank #3.

With this patchset, support for the whole existing SMDK range can be added. Actually, only bank number is different.

This patchset also depends on Exynos 5410 pinctrl support, introduced by patches 0003 and 0004 from this set:
[PATCH v4 0/5] ARM: EXYNOS: ODROID-XU DT and LEDs
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-March/330862.html

Pinctrl support is necessary in order to correctly configure multifunctional pins of the Exynos chip.

v3 => v4:
- Devices are now added as subnodes, with additional properties. This allows to cleary specify dependency. If configuration fails, error will be reported and child devices will not be probed.
- These additional properties now have "samsung,srom-XXX" format
- Fixed code style, now better understood.

v2 => v3:
- Fixed up SROMc region size in the device tree
- Reordered patches, documentation goes first now

v1 => v2:
- Fixed some typos and bad labels in device tree
- Improved documentation

Pavel Fedin (4):
Documentation: dt-bindings: Describe SROMc configuration
ARM: dts: Add SROMc to Exynos 5410
drivers: exynos-srom: Add support for bank configuration
ARM: dts: Add Ethernet chip to SMDK5410

Quoted 8 lines
 .../bindings/arm/samsung/exynos-srom.txt           | 50 ++++++++++++++++++-
 arch/arm/boot/dts/exynos5410-smdk5410.dts          | 41 +++++++++++++++
 arch/arm/boot/dts/exynos5410.dtsi                  | 15 ++++++
 arch/arm/mach-exynos/Kconfig                       |  2 +-
 drivers/soc/samsung/Kconfig                        |  2 +-
 drivers/soc/samsung/exynos-srom.c                  | 58 +++++++++++++++++++++-
 6 files changed, 162 insertions(+), 6 deletions(-)

Something wrong here, I am not able to find V4 1/4 and 3/4 in this mailing list.

Thanks,
Pankaj Dubey

Quoted 8 lines

--
2.4.4

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#2 lore raw

Re: [PATCH v4 1/4] Documentation: dt-bindings: Describe SROMc configuration

In reply to Pavel Fedin
Quoted 2 lines · Pavel Fedin

Add documentation for new subnode properties, allowing bank configuration. Based on u-boot implementation, but heavily reworked.

Please, carefully look at:
Documentation/devicetree/bindings/net/gpmc-eth.txt Documentation/devicetree/bindings/bus/ti-gpmc.txt

1. Try to re-use existing bindings. Although I see existing bank-width and gpmc,device-width but yours samsung,srom-data-width seems better. Maybe there are other to re-use?

2. The array of "PMC, Tacp, Tcah, Tcoh, Tacc, Tcos, Tacs" is poorly extendable and not very descriptive/readable. You mapped directly device register which is the easier way for the driver but that is not the purpose of binding.

3. Please provide ranges for valid values and units.

4. PMC is not a timing.

I doubt that TI GPMC could be used in Exynos SROM but please look at it and get useful stuff from it.

Best regards,
Krzysztof

Quoted 68 lines
---
 .../bindings/arm/samsung/exynos-srom.txt           | 50 +++++++++++++++++++++-
 1 file changed, 48 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt +48 -2
index 33886d5..02ecc7f 100644
@@ -5,8 +5,54 @@ Required properties:
 
 - reg: offset and length of the register set
 
-Example:
+- #address-cells, #size-cells : should be '1' if the device has sub-nodes
+				with 'reg' property.
+- ranges: allows valid 1:1 translation between child's address space and
+	  parent's address space
+
+Sub-nodes:
+The SROM controller can be used to attach external peripherials. In this case
+device nodes should be added as subnodes to the SROMc node. These subnodes,
+except regular device specification, should contain the following properties,
+describing configuration of the relevant SROM bank:
+
+Required properties:
+- samsung,srom-bank : bank number (0 - 3)
+
+- samsung,srom-timing : array of 7 integers: PMC, Tacp, Tcah, Tcoh, Tacc, Tcos,
+			Tacs
+
+Optional properties:
+- samsung,srom-data-width : data width in bytes (1 or 2). If omitted, default
+			    of 1 is used.
+
+Example: basic definition, no banks are configured
 	sromc at 12570000 {
 		compatible = "samsung,exynos-srom";
-		reg = <0x12570000 0x10>;
+		reg = <0x12570000 0x14>;
+	};
+
+Example: SROMc with smsc 911x ethernet chip on bank 3
+	sromc at 12570000 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		compatible = "samsung,exynos-srom";
+		reg = <0x12570000 0x14>;
+
+		ethernet at 07000000 {
+			compatible = "smsc,lan9115";
+			reg = <0x07000000 0x10000>;
+			phy-mode = "mii";
+			interrupt-parent = <&gpx0>;
+			interrupts = <5 8>;
+			reg-io-width = <2>;
+			smsc,irq-push-pull;
+			smsc,force-internal-phy;
+
+			samsung,srom-bank = <3>;
+			samsung,srom-data-width = <2>;
+			samsung,srom-timing = <1 9 12 1 9 1 1>;
+		};
 	};
#15 lore raw

RE: [PATCH v4 2/4] ARM: dts: Add SROMc to Exynos 5410

In reply to Pankaj Dubey

Hello!

Quoted 28 lines

-----Original Message-----
From: linux-samsung-soc-owner at vger.kernel.org [mailto:linux-samsung-soc-owner at vger.kernel.org] On Behalf Of Pankaj Dubey
Sent: Thursday, October 29, 2015 8:28 PM
To: Pavel Fedin
Cc: devicetree at vger.kernel.org; linux-arm-kernel at lists.infradead.org; linux-samsung-soc; linux-kernel at vger.kernel.org; Rob Herring; Pawel Moll; Mark Rutland; Ian Campbell; Kumar Gala; Kukjin Kim; Krzysztof Kozlowski
Subject: Re: [PATCH v4 2/4] ARM: dts: Add SROMc to Exynos 5410

Hi Pavel,

Quoted 15 lines · Pavel Fedin

This machine uses own SoC device tree file, add missing part.

---
 arch/arm/boot/dts/exynos5410.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/boot/dts/exynos5410.dtsi +0 -0
index 4603356..da6a8fa0e 100644
@@ -101,6 +101,15 @@
                        reg = <0x10000000 0x100>;
                };
 
Quoted 8 lines

arch/arm/boot/dts/exynos5410.dtsi line 108

Quoted 5 lines
arch/arm/boot/dts/exynos5410.dtsi +5 -0
+               sromc: sromc at 12250000 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+

We do not need to specify these three properties as they are already present in parent node "soc".

We do, otherwise dtc complains about defaults of #address-cells = 2 and #size-cells=1, and without empty "ranges" subnode's resources are not correctly translated.

Quoted 12 lines
Quoted 12 lines
arch/arm/boot/dts/exynos5410.dtsi +4 -0
+                       compatible = "samsung,exynos-srom";
+                       reg = <0x12250000 0x14>;
+               };
+
                pmu_system_controller: system-controller at 10040000 {
                        compatible = "samsung,exynos5410-pmu", "syscon";
                        reg = <0x10040000 0x5000>;
@@ -133,6 +142,12 @@
                                                <10 &gic 0 130 0>,
                                                <11 &gic 0 131 0>;
                        };
Quoted 8 lines

arch/arm/boot/dts/exynos5410.dtsi line 150

Quoted 6 lines
arch/arm/boot/dts/exynos5410.dtsi +6 -0
+
+                       arch_timer {
+                               compatible = "arm,armv7-timer";
+                               clock-frequency = <24000000>;
+                       };
+

This change should not be part of this patch.

Ooops, thank you very much, this should not have been here at all. This is a leftover from my experiments, i was tracing DT parsing code and added it just for test, to see why timer gets probed as a subnode. Just forgot to remove it afterwards and it slipped into the patch.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

#22 lore raw
In reply to Pankaj Dubey

Hello!

Quoted 10 lines
Quoted 8 lines
 .../bindings/arm/samsung/exynos-srom.txt           | 50 ++++++++++++++++++-
 arch/arm/boot/dts/exynos5410-smdk5410.dts          | 41 +++++++++++++++
 arch/arm/boot/dts/exynos5410.dtsi                  | 15 ++++++
 arch/arm/mach-exynos/Kconfig                       |  2 +-
 drivers/soc/samsung/Kconfig                        |  2 +-
 drivers/soc/samsung/exynos-srom.c                  | 58 +++++++++++++++++++++-
 6 files changed, 162 insertions(+), 6 deletions(-)

Something wrong here, I am not able to find V4 1/4 and 3/4 in this mailing list.

Which mailing list is "this"? I've just rechecked, i've got my messages back on both (linux-samsung-soc and linux-arm-kernel).

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

#3 lore raw

RE: [PATCH v4 1/4] Documentation: dt-bindings: Describe SROMc configuration

In reply to Krzysztof Kozlowski

Hello!

Quoted 6 lines
Quoted 2 lines

Add documentation for new subnode properties, allowing bank configuration. Based on u-boot implementation, but heavily reworked.

Please, carefully look at:
Documentation/devicetree/bindings/net/gpmc-eth.txt Documentation/devicetree/bindings/bus/ti-gpmc.txt

Thank you very much. Indeed, this looks very similar. By the way, should i document smsc over sromc in the same manner, writing
devicetree/bindings/net/sromc-eth.txt?

This is a short reply for now, i'll make longer one (or just a new version) after studying these existing bindings and trying to
apply them.

Pankaj:

Quoted 13 lines
Quoted 13 lines

+&sromc {

Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt +12 -0
+       pinctrl-names = "default";
+       pinctrl-0 = <&srom_ctl>, <&srom_ebi>;
+
+       ethernet at 07000000 {
+               compatible = "smsc,lan9115";
+               reg = <0x07000000 0x10000>;
+               phy-mode = "mii";
+               interrupt-parent = <&gpx0>;
+               interrupts = <5 8>;
+               reg-io-width = <2>;
+               smsc,irq-push-pull;
+               smsc,force-internal-phy;
Quoted 8 lines

Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt Required properties: · line 56

Quoted 4 lines
Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt +4 -0
+
+               samsung,srom-bank = <3>;
+               samsung,srom-data-width = <2>;
+               samsung,srom-timing = <1 9 12 1 9 1 1>;

I think this is not correct. We can't change binding of "smsc,lan9115" which is already documented here [1]. These samsung specific srom properties should be in srom node or its subnode, but not in this way.

So, if you look at gpmc-eth.txt, you'll see that this approach is perfectly valid (this is a reply to another msg, just don't want
to post one more single-line reply).

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

#4 lore raw

Re: [PATCH v4 1/4] Documentation: dt-bindings: Describe SROMc configuration

Quoted 9 lines · Pavel Fedin

Hello!

Quoted 6 lines
Quoted 2 lines

Add documentation for new subnode properties, allowing bank configuration. Based on u-boot implementation, but heavily reworked.

Please, carefully look at:
Documentation/devicetree/bindings/net/gpmc-eth.txt Documentation/devicetree/bindings/bus/ti-gpmc.txt

Quoted 5 lines

Thank you very much. Indeed, this looks very similar. By the way, should i document smsc over sromc in the same manner, writing
devicetree/bindings/net/sromc-eth.txt?

This is a short reply for now, i'll make longer one (or just a new version) after studying these existing bindings and trying to
apply them.

Existing SROMC bindings document is small so one document for everything should be sufficient. This can be always split if new type of devices will be using SROMC (BTW, do you know of any other devices using SROMC on Exynos?).

Quoted 25 lines

Pankaj:

Quoted 13 lines
Quoted 13 lines

+&sromc {

Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt +12 -0
+       pinctrl-names = "default";
+       pinctrl-0 = <&srom_ctl>, <&srom_ebi>;
+
+       ethernet at 07000000 {
+               compatible = "smsc,lan9115";
+               reg = <0x07000000 0x10000>;
+               phy-mode = "mii";
+               interrupt-parent = <&gpx0>;
+               interrupts = <5 8>;
+               reg-io-width = <2>;
+               smsc,irq-push-pull;
+               smsc,force-internal-phy;
Quoted 8 lines

Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt Required properties: · line 56

Quoted 4 lines
Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt +4 -0
+
+               samsung,srom-bank = <3>;
+               samsung,srom-data-width = <2>;
+               samsung,srom-timing = <1 9 12 1 9 1 1>;

I think this is not correct. We can't change binding of "smsc,lan9115" which is already documented here [1]. These samsung specific srom properties should be in srom node or its subnode, but not in this way.

Quoted 2 lines

So, if you look at gpmc-eth.txt, you'll see that this approach is perfectly valid (this is a reply to another msg, just don't want
to post one more single-line reply).

Yes, the binding of smsc,lan9115 is not changed.

Putting srom properties in separate bank node would be good also but then some mapping (connection) between ethernet and bank should be added probably...

Best regards,
Krzysztof

#16 lore raw

Re: [PATCH v4 2/4] ARM: dts: Add SROMc to Exynos 5410

In reply to Pavel Fedin

Hi Pavel,

Quoted 39 lines · Pavel Fedin

Hello!

Quoted 28 lines

-----Original Message-----
From: linux-samsung-soc-owner at vger.kernel.org [mailto:linux-samsung-soc-owner at vger.kernel.org] On Behalf Of Pankaj Dubey
Sent: Thursday, October 29, 2015 8:28 PM
To: Pavel Fedin
Cc: devicetree at vger.kernel.org; linux-arm-kernel at lists.infradead.org; linux-samsung-soc; linux-kernel at vger.kernel.org; Rob Herring; Pawel Moll; Mark Rutland; Ian Campbell; Kumar Gala; Kukjin Kim; Krzysztof Kozlowski
Subject: Re: [PATCH v4 2/4] ARM: dts: Add SROMc to Exynos 5410

Hi Pavel,

Quoted 15 lines · Pavel Fedin

This machine uses own SoC device tree file, add missing part.

---
  arch/arm/boot/dts/exynos5410.dtsi | 15 +++++++++++++++
  1 file changed, 15 insertions(+)
arch/arm/boot/dts/exynos5410.dtsi +0 -0
index 4603356..da6a8fa0e 100644
@@ -101,6 +101,15 @@
                         reg = <0x10000000 0x100>;
                 };
 
Quoted 8 lines

arch/arm/boot/dts/exynos5410.dtsi line 108

Quoted 5 lines
arch/arm/boot/dts/exynos5410.dtsi +5 -0
+               sromc: sromc at 12250000 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+

We do not need to specify these three properties as they are already present in parent node "soc".

Quoted 2 lines

We do, otherwise dtc complains about defaults of #address-cells = 2 and #size-cells=1, and without empty "ranges" subnode's resources are not correctly translated.

First of all this patch will not give this error. So this part should not be a part of this patch.
You should be getting above error after applying v4 4/4 "ARM: dts: Add Ethernet chip to SMDK5410". So if its failing for ethernet subnode, you can move this address-cells and size-cells in dts file just above ethernet node as shown below:

index 311e7be..d69981d 100644

arch/arm/boot/dts/exynos5410-smdk5410.dts +3 -0
@@ -95,6 +95,9 @@
  };
 
  &sromc {
+       #address-cells = <1>;
+       #size-cells = <1>;
+       ranges;
         pinctrl-names = "default";
         pinctrl-0 = <&srom_ctl>, <&srom_ebi>;
 

And another question still remains open, we can't just like that change "smsc,lan9115" binding by adding samsung specific properties. If you want to do and there is no other way, you need to update DT binding of "smsc,lan9115" and get it reviewed.
Probably you can check suggestions from Krzysztof, where he pointed out some hint on how other places this is getting used.

Thanks,
Pankaj Dubey

Quoted 30 lines
Quoted 12 lines
Quoted 12 lines
arch/arm/boot/dts/exynos5410.dtsi +4 -0
+                       compatible = "samsung,exynos-srom";
+                       reg = <0x12250000 0x14>;
+               };
+
                 pmu_system_controller: system-controller at 10040000 {
                         compatible = "samsung,exynos5410-pmu", "syscon";
                         reg = <0x10040000 0x5000>;
@@ -133,6 +142,12 @@
                                                 <10 &gic 0 130 0>,
                                                 <11 &gic 0 131 0>;
                         };
Quoted 8 lines

arch/arm/boot/dts/exynos5410.dtsi line 150

Quoted 6 lines
arch/arm/boot/dts/exynos5410.dtsi +6 -0
+
+                       arch_timer {
+                               compatible = "arm,armv7-timer";
+                               clock-frequency = <24000000>;
+                       };
+

This change should not be part of this patch.

Ooops, thank you very much, this should not have been here at all. This is a leftover from my experiments, i was tracing DT parsing code and added it just for test, to see why timer gets probed as a subnode. Just forgot to remove it afterwards and it slipped into the patch.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

#7 lore raw

RE: [PATCH v4 1/4] Documentation: dt-bindings: Describe SROMc configuration

In reply to Krzysztof Kozlowski

Hello!

Quoted 7 lines

Please, carefully look at:
Documentation/devicetree/bindings/net/gpmc-eth.txt Documentation/devicetree/bindings/bus/ti-gpmc.txt

1. Try to re-use existing bindings. Although I see existing bank-width and gpmc,device-width but yours samsung,srom-data-width seems better. Maybe there are other to re-use?

I've done this and this is what i currently came up with. I'd like to discuss this before respin because nobody needs this
back-and-forth bouncing.
--- cut exynos5410.dtsi ---

		sromc: sromc at 12250000 {
			#address-cells = <2>;
			#size-cells = <1>;
			ranges = <0 0 0x04000000 0x20000
				  1 0 0x05000000 0x20000
				  2 0 0x06000000 0x20000
				  3 0 0x07000000 0x20000>;

			compatible = "samsung,exynos-srom";
			reg = <0x12250000 0x14>;
		};
--- cut exynos5410.dtsi ---
--- cut exynos5410-smdk5410.dts ---
&sromc {
	pinctrl-names = "default";
	pinctrl-0 = <&srom_ctl>, <&srom_ebi>;

	ethernet at 3 {
		compatible = "smsc,lan9115";
		reg = <3 0 0x10000>;
		phy-mode = "mii";
		interrupt-parent = <&gpx0>;
		interrupts = <5 8>;
		reg-io-width = <2>;
		smsc,irq-push-pull;
		smsc,force-internal-phy;

		samsung,srom-config = <1 9 12 1 9 1 1>;
	};
};

--- cut exynos5410-smdk5410.dts ---

1. After writing proper ranges i was able to get rid of dedicated bank number property, because now it is the first value in
device's "reg".
2. I noticed that smsc binding already uses reg-io-width property. I searched for it, and it appears to be reused by many devices.
So, i decided to use it to specify bank width, since it's already there. ti-gpmc uses bank-width because it supports configurations like reg-io-width = 4 && bank-width = 2. I don't know if it's possible to do the same with SROMc, Exynos doc doesn't tell anything about 32-bit accesses. But, if you want to support it too, i would suggest the following algorithm:
if (have bank-width)
width = bank-width
else if (have reg-io-width)
width = reg-io-width
else
width = 1 /* default */
3. About samsung,srom-config array. I have the following reasons to keep if this way:
- listing every property under own name is just too much typing
- these values really do not make sense without each other, or partialy. I would say that in array form they are even better
readable, because it is the same order in which they go into the register. However, it is still a nice idea do document them, but... my PDF has "confidential" watermark on it, and this would mean that i essentially copy some information from it into Linux doc. Is it okay to do this?
If you still dislike the array, i'll redo is a set of properties like samsung,srom-tacs, samsung,srom-tcos, etc.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

#17 lore raw

RE: [PATCH v4 2/4] ARM: dts: Add SROMc to Exynos 5410

In reply to Pankaj Dubey

Hello!

Quoted 24 lines
Quoted 10 lines
Quoted 8 lines

arch/arm/boot/dts/exynos5410-smdk5410.dts

Quoted 5 lines
arch/arm/boot/dts/exynos5410-smdk5410.dts +5 -0
+               sromc: sromc at 12250000 {
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+

We do not need to specify these three properties as they are already present in parent node "soc".

We do, otherwise dtc complains about defaults of #address-cells = 2 and #size-cells=1, and

without empty "ranges" subnode's resources are not correctly translated.

Quoted 1 line

First of all this patch will not give this error. So this part should not be a part of this patch.
You should be getting above error after applying v4 4/4 "ARM: dts: Add Ethernet chip to SMDK5410". So if its failing for ethernet subnode, you can move this address-cells and size-cells in dts file just above ethernet node as shown below:

index 311e7be..d69981d 100644

arch/arm/boot/dts/exynos5410-smdk5410.dts line 103

Quoted 9 lines
arch/arm/boot/dts/exynos5410-smdk5410.dts +3 -0
@@ -95,6 +95,9 @@
  };
 
  &sromc {
+       #address-cells = <1>;
+       #size-cells = <1>;
+       ranges;
         pinctrl-names = "default";
         pinctrl-0 = <&srom_ctl>, <&srom_ebi>;
 

IMHO this makes little of sense, because in this case you would have to duplicate these properties for every supported machine. address-cells, size-cells and ranges belong to the controller itself, not to its children. Of course i could split up the patch into two, first introduce sromc, second introduce mapping. But does it worth that? Both patches would be 3 lines of code each.
Anyway, this specific talk is outdated by now, please check out neighbor topic, we are discussing significantly improved binding with Krzystof.

Quoted 2 lines

And another question still remains open, we can't just like that change "smsc,lan9115" binding by adding samsung specific properties.

I am sorry, but you either do not understand us with Krzystof, or not reading at all...
This is not a change in the binding. And these properties do not belong to smsc at all. They would be added to *ANY* device which sits on top of SROMc. This is more like a bus-specific extra. It's similar to "reg" property having different meanings for different buses.

Quoted 2 lines

Probably you can check suggestions from Krzysztof, where he pointed out some hint on how other places this is getting used.

Did you read them? I did, and they do exactly the same thing as i do.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

#5 lore raw

Re: [PATCH v4 1/4] Documentation: dt-bindings: Describe SROMc configuration

In reply to Krzysztof Kozlowski
Quoted 50 lines · Krzysztof Kozlowski
Quoted 9 lines · Pavel Fedin

Hello!

Quoted 6 lines
Quoted 2 lines

Add documentation for new subnode properties, allowing bank configuration. Based on u-boot implementation, but heavily reworked.

Please, carefully look at:
Documentation/devicetree/bindings/net/gpmc-eth.txt Documentation/devicetree/bindings/bus/ti-gpmc.txt

Quoted 5 lines

Thank you very much. Indeed, this looks very similar. By the way, should i document smsc over sromc in the same manner, writing
devicetree/bindings/net/sromc-eth.txt?

This is a short reply for now, i'll make longer one (or just a new version) after studying these existing bindings and trying to
apply them.

Existing SROMC bindings document is small so one document for everything should be sufficient. This can be always split if new type of devices will be using SROMC (BTW, do you know of any other devices using SROMC on Exynos?).

Quoted 25 lines

Pankaj:

Quoted 13 lines
Quoted 13 lines

+&sromc {

Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt +12 -0
+       pinctrl-names = "default";
+       pinctrl-0 = <&srom_ctl>, <&srom_ebi>;
+
+       ethernet at 07000000 {
+               compatible = "smsc,lan9115";
+               reg = <0x07000000 0x10000>;
+               phy-mode = "mii";
+               interrupt-parent = <&gpx0>;
+               interrupts = <5 8>;
+               reg-io-width = <2>;
+               smsc,irq-push-pull;
+               smsc,force-internal-phy;
Quoted 8 lines

Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt Required properties: · line 56

Quoted 4 lines
Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt +4 -0
+
+               samsung,srom-bank = <3>;
+               samsung,srom-data-width = <2>;
+               samsung,srom-timing = <1 9 12 1 9 1 1>;

I think this is not correct. We can't change binding of "smsc,lan9115" which is already documented here [1]. These samsung specific srom properties should be in srom node or its subnode, but not in this way.

Quoted 2 lines

So, if you look at gpmc-eth.txt, you'll see that this approach is perfectly valid (this is a reply to another msg, just don't want
to post one more single-line reply).

Quoted 5 lines

Yes, the binding of smsc,lan9115 is not changed.

Putting srom properties in separate bank node would be good also but then some mapping (connection) between ethernet and bank should be added probably...

Is this to get some data needed by the ethernet from the ROM? We have the nvmem binding to support that.

Rob

#6 lore raw

Re: [PATCH v4 1/4] Documentation: dt-bindings: Describe SROMc configuration

W dniu 31.10.2015 o 02:15, Rob Herring pisze:

Quoted 52 lines
Quoted 50 lines · Krzysztof Kozlowski
Quoted 9 lines · Pavel Fedin

Hello!

Quoted 6 lines
Quoted 2 lines

Add documentation for new subnode properties, allowing bank configuration. Based on u-boot implementation, but heavily reworked.

Please, carefully look at:
Documentation/devicetree/bindings/net/gpmc-eth.txt Documentation/devicetree/bindings/bus/ti-gpmc.txt

Quoted 5 lines

Thank you very much. Indeed, this looks very similar. By the way, should i document smsc over sromc in the same manner, writing
devicetree/bindings/net/sromc-eth.txt?

This is a short reply for now, i'll make longer one (or just a new version) after studying these existing bindings and trying to
apply them.

Existing SROMC bindings document is small so one document for everything should be sufficient. This can be always split if new type of devices will be using SROMC (BTW, do you know of any other devices using SROMC on Exynos?).

Quoted 27 lines

Pankaj:

Quoted 13 lines
Quoted 13 lines

+&sromc {

Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt +12 -0
+       pinctrl-names = "default";
+       pinctrl-0 = <&srom_ctl>, <&srom_ebi>;
+
+       ethernet at 07000000 {
+               compatible = "smsc,lan9115";
+               reg = <0x07000000 0x10000>;
+               phy-mode = "mii";
+               interrupt-parent = <&gpx0>;
+               interrupts = <5 8>;
+               reg-io-width = <2>;
+               smsc,irq-push-pull;
+               smsc,force-internal-phy;
Quoted 8 lines

Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt Required properties: · line 56

Quoted 4 lines
Documentation/devicetree/bindings/arm/samsung/exynos-srom.txt +4 -0
+
+               samsung,srom-bank = <3>;
+               samsung,srom-data-width = <2>;
+               samsung,srom-timing = <1 9 12 1 9 1 1>;

I think this is not correct. We can't change binding of "smsc,lan9115" which is already documented here [1]. These samsung specific srom properties should be in srom node or its subnode, but not in this way.

So, if you look at gpmc-eth.txt, you'll see that this approach is perfectly valid (this is a reply to another msg, just don't want
to post one more single-line reply).

Quoted 8 lines
Quoted 5 lines

Yes, the binding of smsc,lan9115 is not changed.

Putting srom properties in separate bank node would be good also but then some mapping (connection) between ethernet and bank should be added probably...

Is this to get some data needed by the ethernet from the ROM? We have the nvmem binding to support that.

No, this does not act like nvram driver. It is rather a memory controller. The same as existing TI GPMC:
Documentation/devicetree/bindings/net/gpmc-eth.txt although configuration is different so gpmc driver cannot be reused.

Best regards,
Krzysztof

#8 lore raw

Re: [PATCH v4 1/4] Documentation: dt-bindings: Describe SROMc configuration

In reply to Pavel Fedin

W dniu 30.10.2015 o 19:43, Pavel Fedin pisze:

Quoted 13 lines

Hello!

Quoted 7 lines

Please, carefully look at:
Documentation/devicetree/bindings/net/gpmc-eth.txt Documentation/devicetree/bindings/bus/ti-gpmc.txt

1. Try to re-use existing bindings. Although I see existing bank-width and gpmc,device-width but yours samsung,srom-data-width seems better. Maybe there are other to re-use?

I've done this and this is what i currently came up with. I'd like to discuss this before respin because nobody needs this
back-and-forth bouncing.
--- cut exynos5410.dtsi ---

Quoted 7 lines
		sromc: sromc at 12250000 {
			#address-cells = <2>;
			#size-cells = <1>;
			ranges = <0 0 0x04000000 0x20000
				  1 0 0x05000000 0x20000
				  2 0 0x06000000 0x20000
				  3 0 0x07000000 0x20000>;

Do you have to use 2 cells for address? Cannot it be:
ranges = <0 0x04000000 0x20000
1 0x05000000 0x20000 2 0x06000000 0x20000 3 0x07000000 0x20000>;

Quoted 3 lines
			compatible = "samsung,exynos-srom";
			reg = <0x12250000 0x14>;

Put compatible and reg at beginning.

Quoted 20 lines
		};
--- cut exynos5410.dtsi ---
--- cut exynos5410-smdk5410.dts ---
&sromc {
	pinctrl-names = "default";
	pinctrl-0 = <&srom_ctl>, <&srom_ebi>;

	ethernet at 3 {
		compatible = "smsc,lan9115";
		reg = <3 0 0x10000>;
		phy-mode = "mii";
		interrupt-parent = <&gpx0>;
		interrupts = <5 8>;
		reg-io-width = <2>;
		smsc,irq-push-pull;
		smsc,force-internal-phy;

		samsung,srom-config = <1 9 12 1 9 1 1>;
	};
};
Quoted 4 lines

--- cut exynos5410-smdk5410.dts ---

1. After writing proper ranges i was able to get rid of dedicated bank number property, because now it is the first value in
device's "reg".

Good, I like your approach.

Quoted 10 lines

2. I noticed that smsc binding already uses reg-io-width property. I searched for it, and it appears to be reused by many devices.
So, i decided to use it to specify bank width, since it's already there. ti-gpmc uses bank-width because it supports configurations like reg-io-width = 4 && bank-width = 2. I don't know if it's possible to do the same with SROMc, Exynos doc doesn't tell anything about 32-bit accesses. But, if you want to support it too, i would suggest the following algorithm:
if (have bank-width)
width = bank-width
else if (have reg-io-width)
width = reg-io-width
else
width = 1 /* default */

Re-using reg-io-width seems fine. In future, if needed, this can be extended by introducing bank-width but now there is no sense in it.

Quoted 4 lines

3. About samsung,srom-config array. I have the following reasons to keep if this way:
- listing every property under own name is just too much typing
- these values really do not make sense without each other, or partialy. I would say that in array form they are even better
readable, because it is the same order in which they go into the register.

For timings - OK. PMC is separate. This is not a timing.

Quoted 3 lines

However, it is still a nice idea do document them, but...
my PDF has "confidential" watermark on it, and this would mean that i essentially copy some information from it into Linux doc. Is it okay to do this?

You need to document them. We are not gonna put some data looking like a vendor blob into the binding. I understand that document has confidential mark... all of Samsung datasheets I've seen had it. I don't find it as problem but of course I am not the one to judge here. If you do not feel comfortable publishing such data, get an approval from your manager. You can also try to search for this in vendor code (opensource.samsung.com). If it is published there, then this won't be a disclosure.

Quoted 2 lines

If you still dislike the array, i'll redo is a set of properties like samsung,srom-tacs, samsung,srom-tcos, etc.

Ok, array for timings, but PMC IMHO is different.

BTW, your email client is weird. You are sending non-wrapped emails without format=flowed in Content-Type. Please stick to mailing list convention of wrapping at 72-char. It is really difficult to read your replies.

Best regards,
Krzysztof

#9 lore raw

RE: [PATCH v4 1/4] Documentation: dt-bindings: Describe SROMc configuration

Hello!

Quoted 10 lines
Quoted 8 lines

--- cut exynos5410.dtsi ---

		sromc: sromc at 12250000 {
			#address-cells = <2>;
			#size-cells = <1>;
			ranges = <0 0 0x04000000 0x20000
				  1 0 0x05000000 0x20000
				  2 0 0x06000000 0x20000
				  3 0 0x07000000 0x20000>;

Do you have to use 2 cells for address? Cannot it be:

Review

Quoted 4 lines
(quoted diff) +0 -0
 			ranges = <0 0x04000000 0x20000
 				  1 0x05000000 0x20000
 				  2 0x06000000 0x20000
 				  3 0x07000000 0x20000>;

I tried this first, but it didn't work, and ranges translation
gave me something really weird (like addr = 0x80 and size = 0x04000004). I decided not to dig deeply into "ranges" processing, but just followed GPMC approach. They say that first number is range ID and second number is offset within the range. And it just worked.

Quoted 7 lines
Quoted 3 lines

3. About samsung,srom-config array. I have the following reasons to keep if this way:
- listing every property under own name is just too much typing
- these values really do not make sense without each other, or partialy. I would say

that in array form they are even better

Quoted 1 line

readable, because it is the same order in which they go into the register.

For timings - OK. PMC is separate. This is not a timing.

But it's srom-config, and not srom-timing anymore. So do you want
two properties like srom-timing + srom-page-mode (with vendor prefix of course)?

Quoted 8 lines

You need to document them. We are not gonna put some data looking like a vendor blob into the binding. I understand that document has confidential mark... all of Samsung datasheets I've seen had it. I don't find it as problem but of course I am not the one to judge here. If you do not feel comfortable publishing such data, get an approval from your manager. You can also try to search for this in vendor code (opensource.samsung.com). If it is published there, then this won't be a disclosure.

I've seen the actual SROMc settings in some old Android kernels, like 3.0.4.
But they are not documented there, no comments, just #define's.
Ok, i'll try to take a look how to minimize the actual information. :)

Quoted 3 lines

BTW, your email client is weird. You are sending non-wrapped emails without format=flowed in Content-Type. Please stick to mailing list convention of wrapping at 72-char.

I know, sorry, this is MS Outlook (not Express), and it's impossible
to configure it this way (if i just set up word wrap, it starts to corrupt patches). I am now trying to wrap the text by hands, i hope it's better. And i cannot use anything else because... You know why. :)

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

#10 lore raw

Re: [PATCH v4 1/4] Documentation: dt-bindings: Describe SROMc configuration

Quoted 17 lines · Pavel Fedin

Hello!

Quoted 10 lines
Quoted 8 lines

--- cut exynos5410.dtsi ---

		sromc: sromc at 12250000 {
			#address-cells = <2>;
			#size-cells = <1>;
			ranges = <0 0 0x04000000 0x20000
				  1 0 0x05000000 0x20000
				  2 0 0x06000000 0x20000
				  3 0 0x07000000 0x20000>;

Do you have to use 2 cells for address? Cannot it be:

Review

Quoted 4 lines
(quoted diff) +0 -0
 			ranges = <0 0x04000000 0x20000
 				  1 0x05000000 0x20000
 				  2 0x06000000 0x20000
 				  3 0x07000000 0x20000>;
Quoted 3 lines

I tried this first, but it didn't work, and ranges translation
gave me something really weird (like addr = 0x80 and size = 0x04000004).

Did you change the address-cells to <1>?

Quoted 8 lines

I decided not to dig deeply into
"ranges" processing, but just followed GPMC approach. They say that first number is range ID and second number is offset within the range. And it just worked.

Quoted 3 lines
Quoted 3 lines

3. About samsung,srom-config array. I have the following reasons to keep if this way:
- listing every property under own name is just too much typing
- these values really do not make sense without each other, or partialy. I would say

Quoted 8 lines
Quoted 4 lines

that in array form they are even better

Quoted 1 line

readable, because it is the same order in which they go into the register.

For timings - OK. PMC is separate. This is not a timing.

But it's srom-config, and not srom-timing anymore. So do you want
two properties like srom-timing + srom-page-mode (with vendor prefix of course)?

Yes, I still want separate properties because this too generic. In next SoC they will extend the register and you will have to extend the binding. I agree for simplicity reasons to group timings in an array. But not entire register.

Quoted 9 lines
Quoted 8 lines

You need to document them. We are not gonna put some data looking like a vendor blob into the binding. I understand that document has confidential mark... all of Samsung datasheets I've seen had it. I don't find it as problem but of course I am not the one to judge here. If you do not feel comfortable publishing such data, get an approval from your manager. You can also try to search for this in vendor code (opensource.samsung.com). If it is published there, then this won't be a disclosure.

Quoted 3 lines

I've seen the actual SROMc settings in some old Android kernels, like 3.0.4.
But they are not documented there, no comments, just #define's.
Ok, i'll try to take a look how to minimize the actual information. :)

Actually 15 secs of search by grep revealed that they are already documented and published. I looked at first image coming into my mind:
GT-I9300_JB arch/arm/mach-exynos/include/mach/sromc-exynos4.h

Quoted 8 lines
Quoted 3 lines

BTW, your email client is weird. You are sending non-wrapped emails without format=flowed in Content-Type. Please stick to mailing list convention of wrapping at 72-char.

I know, sorry, this is MS Outlook (not Express), and it's impossible
to configure it this way (if i just set up word wrap, it starts to corrupt patches). I am now trying to wrap the text by hands, i hope it's better. And i cannot use anything else because... You know why. :)

Actually no... I don't know why...
All of us are using whatever we want (mutt+MDA, thunderbird, kmail, etc.). At least in two locations I've been: in Polish R&D and in HQ.

Best regards,
Krzysztof

#11 lore raw

RE: [PATCH v4 1/4] Documentation: dt-bindings: Describe SROMc configuration

Hello!

Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Quoted 8 lines

--- cut exynos5410.dtsi ---

		sromc: sromc at 12250000 {
			#address-cells = <2>;
			#size-cells = <1>;
			ranges = <0 0 0x04000000 0x20000
				  1 0 0x05000000 0x20000
				  2 0 0x06000000 0x20000
				  3 0 0x07000000 0x20000>;

Do you have to use 2 cells for address? Cannot it be:

(quoted diff) +0 -0
 			ranges = <0 0x04000000 0x20000
 				  1 0x05000000 0x20000
 				  2 0x06000000 0x20000
 				  3 0x07000000 0x20000>;
Quoted 5 lines
Quoted 3 lines

I tried this first, but it didn't work, and ranges translation
gave me something really weird (like addr = 0x80 and size = 0x04000004).

Did you change the address-cells to <1>?

Of course i did.

I don't quote the rest because i simply agree to what you've said. Will respin with these changes.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia

#12 lore raw

Re: [PATCH v4 1/4] Documentation: dt-bindings: Describe SROMc configuration

Quoted 17 lines · Pavel Fedin

Hello!

Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Quoted 8 lines

--- cut exynos5410.dtsi ---

		sromc: sromc at 12250000 {
			#address-cells = <2>;
			#size-cells = <1>;
			ranges = <0 0 0x04000000 0x20000
				  1 0 0x05000000 0x20000
				  2 0 0x06000000 0x20000
				  3 0 0x07000000 0x20000>;

Do you have to use 2 cells for address? Cannot it be:

(quoted diff) +0 -0
 			ranges = <0 0x04000000 0x20000
 				  1 0x05000000 0x20000
 				  2 0x06000000 0x20000
 				  3 0x07000000 0x20000>;
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

I tried this first, but it didn't work, and ranges translation
gave me something really weird (like addr = 0x80 and size = 0x04000004).

Did you change the address-cells to <1>?

Of course i did.

I saw some other nodes use the ranges without the offset but maybe some more steps are required for such configuration.

So anyway send the version with the child offset and I will try to figure out why it is required.

Best regards,
Krzysztof