Skip to contentSkip to conversation

ARM: dts: da850-evm: add clock properties to the nand node

PATCH In review Bartosz Golaszewski 5 participants 9 messages Feb 5, 2018 – Feb 11, 2018 Device tree bindings

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: da850-evm: add clock properties to the nand node

From: Bartosz Golaszewski <[email protected]>

Make nand work with the common clock framework by specifying which clock should be used and what name to look up.

---
 arch/arm/boot/dts/da850-evm.dts | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/boot/dts/da850-evm.dts +3 -0
index a86a8a1816f2..2602ad8e99ee 100644
@@ -296,6 +296,9 @@
 			reg = <0 0x02000000 0x02000000
 			       1 0x00000000 0x00008000>;
 
+			clocks = <&psc0 3>;
+			clock-names = "aemif";
+
 			ti,davinci-chipselect = <1>;
 			ti,davinci-mask-ale = <0>;
 			ti,davinci-mask-cle = <0>;
Signature · 1 line
2.16.1
#1 lore raw
Quoted 15 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Make nand work with the common clock framework by specifying which clock should be used and what name to look up.

---
 arch/arm/boot/dts/da850-evm.dts | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/boot/dts/da850-evm.dts +0 -0
index a86a8a1816f2..2602ad8e99ee 100644

arch/arm/boot/dts/da850-evm.dts line 300

Quoted 5 lines
arch/arm/boot/dts/da850-evm.dts +2 -0
@@ -296,6 +296,9 @@
 			reg = <0 0x02000000 0x02000000
 			       1 0x00000000 0x00008000>;
 
+			clocks = <&psc0 3>;
+			clock-names = "aemif";

Looks like this is being added only to satisfy the devm_clk_get() call in nand_davinci_probe() which I think is superfluous since we also enable the same clock in aemif_probe().

Perhaps the better solution is to drip the clk code in drivers/mtd/nand/davinci_nand.c and shift legacy code to start using drivers/memory/aemif.c as well? This way we can also drop arch/arm/mach-davinci/aemif.c

Thanks,
Sekhar

#2 lore raw

2018-02-06 12:07 GMT+01:00 Sekhar Nori <[email protected]>:

Quoted 26 lines · Bartosz Golaszewski
Quoted 15 lines

From: Bartosz Golaszewski <[email protected]>

Make nand work with the common clock framework by specifying which clock should be used and what name to look up.

---
 arch/arm/boot/dts/da850-evm.dts | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/boot/dts/da850-evm.dts +0 -0
index a86a8a1816f2..2602ad8e99ee 100644

arch/arm/boot/dts/da850-evm.dts line 300

Quoted 5 lines
arch/arm/boot/dts/da850-evm.dts +2 -0
@@ -296,6 +296,9 @@
                      reg = <0 0x02000000 0x02000000
                             1 0x00000000 0x00008000>;
 
+                     clocks = <&psc0 3>;
+                     clock-names = "aemif";

Looks like this is being added only to satisfy the devm_clk_get() call in nand_davinci_probe() which I think is superfluous since we also enable the same clock in aemif_probe().

Quoted 7 lines

Perhaps the better solution is to drip the clk code in drivers/mtd/nand/davinci_nand.c and shift legacy code to start using drivers/memory/aemif.c as well? This way we can also drop arch/arm/mach-davinci/aemif.c

Thanks,
Sekhar

Yes, this sounds good, but I think we should leave it for later as an additional improvement, once everything else is in place. I think these patches should be applied together with David's series in order to not break the support on davinci boards and the aemif work would go in later as a follow-up. How about that?

Also: I don't have any keystone board to test whether such changes don't break the nand support there. Would you be able to test this?

Thanks,
Bartosz

#3 lore raw
Quoted 32 lines · Bartosz Golaszewski

2018-02-06 12:07 GMT+01:00 Sekhar Nori <[email protected]>:

Quoted 31 lines · Bartosz Golaszewski
Quoted 15 lines

From: Bartosz Golaszewski <[email protected]>

Make nand work with the common clock framework by specifying which clock should be used and what name to look up.

---
 arch/arm/boot/dts/da850-evm.dts | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/boot/dts/da850-evm.dts +0 -0
index a86a8a1816f2..2602ad8e99ee 100644

arch/arm/boot/dts/da850-evm.dts line 300

Quoted 5 lines
arch/arm/boot/dts/da850-evm.dts +2 -0
@@ -296,6 +296,9 @@
                      reg = <0 0x02000000 0x02000000
                             1 0x00000000 0x00008000>;
 
+                     clocks = <&psc0 3>;
+                     clock-names = "aemif";

Looks like this is being added only to satisfy the devm_clk_get() call in nand_davinci_probe() which I think is superfluous since we also enable the same clock in aemif_probe().

Perhaps the better solution is to drip the clk code in drivers/mtd/nand/davinci_nand.c and shift legacy code to start using drivers/memory/aemif.c as well? This way we can also drop arch/arm/mach-davinci/aemif.c

Quoted 8 lines
Quoted 2 lines

Thanks,
Sekhar

Yes, this sounds good, but I think we should leave it for later as an additional improvement, once everything else is in place. I think these patches should be applied together with David's series in order to not break the support on davinci boards and the aemif work would go in later as a follow-up. How about that?

No, I dont think we should add temporary hacks to DT to work around driver issues (I do think its a hack since the clock belongs to aemif module not NAND flash).

An easier driver hack might be to not treat devm_clk_get() failure in davinci_nand.c as catastrophic. It will safely fail in DT case and we should get the clock in legacy boot case.

I think we are looking at a driver update dependency anyway.

Quoted 3 lines

Also: I don't have any keystone board to test whether such changes don't break the nand support there. Would you be able to test this?

Yes, I have access to those boards.

Thanks,
Sekhar

#4 lore raw

PATCH 1/1 ARM: dts: da850-evm: add clock properties to the nand node

Quoted 46 lines · Sekhar Nori
Quoted 32 lines · Bartosz Golaszewski

2018-02-06 12:07 GMT+01:00 Sekhar Nori <[email protected]>:

Quoted 31 lines · Bartosz Golaszewski
Quoted 15 lines

From: Bartosz Golaszewski <[email protected]>

Make nand work with the common clock framework by specifying which clock should be used and what name to look up.

---
  arch/arm/boot/dts/da850-evm.dts | 3 +++
  1 file changed, 3 insertions(+)
arch/arm/boot/dts/da850-evm.dts +0 -0
index a86a8a1816f2..2602ad8e99ee 100644

arch/arm/boot/dts/da850-evm.dts line 300

Quoted 5 lines
arch/arm/boot/dts/da850-evm.dts +2 -0
@@ -296,6 +296,9 @@
                       reg = <0 0x02000000 0x02000000
                              1 0x00000000 0x00008000>;
 
+                     clocks = <&psc0 3>;
+                     clock-names = "aemif";

Looks like this is being added only to satisfy the devm_clk_get() call in nand_davinci_probe() which I think is superfluous since we also enable the same clock in aemif_probe().

Perhaps the better solution is to drip the clk code in drivers/mtd/nand/davinci_nand.c and shift legacy code to start using drivers/memory/aemif.c as well? This way we can also drop arch/arm/mach-davinci/aemif.c

Quoted 8 lines
Quoted 2 lines

Thanks,
Sekhar

Yes, this sounds good, but I think we should leave it for later as an additional improvement, once everything else is in place. I think these patches should be applied together with David's series in order to not break the support on davinci boards and the aemif work would go in later as a follow-up. How about that?

No, I dont think we should add temporary hacks to DT to work around driver issues (I do think its a hack since the clock belongs to aemif module not NAND flash).

Quoted 5 lines

An easier driver hack might be to not treat devm_clk_get() failure in davinci_nand.c as catastrophic. It will safely fail in DT case and we should get the clock in legacy boot case.

I think we are looking at a driver update dependency anyway.

It looks like keystone.dtsi is using the clock-ranges property in the aemif node to pass the clock to child nodes. Could we not do the same in da850.dtsi?

Quoted 10 lines
Quoted 4 lines

Also: I don't have any keystone board to test whether such changes don't break the nand support there. Would you be able to test this?

Yes, I have access to those boards.

Thanks,
Sekhar

#5 lore raw
Quoted 51 lines · David Lechner
Quoted 50 lines · Sekhar Nori
Quoted 32 lines · Bartosz Golaszewski

2018-02-06 12:07 GMT+01:00 Sekhar Nori <[email protected]>:

Quoted 31 lines · Bartosz Golaszewski
Quoted 18 lines

From: Bartosz Golaszewski <[email protected]>

Make nand work with the common clock framework by specifying which clock should be used and what name to look up.

---
? arch/arm/boot/dts/da850-evm.dts | 3 +++
? 1 file changed, 3 insertions(+)

arch/arm/boot/dts/da850-evm.dts +0 -0
index a86a8a1816f2..2602ad8e99ee 100644
@@ -296,6 +296,9 @@

?????????????????????? reg = <0 0x02000000 0x02000000 ????????????????????????????? 1 0x00000000 0x00008000>;

Quoted 2 lines

+???????????????????? clocks = <&psc0 3>;
+???????????????????? clock-names = "aemif";

Looks like this is being added only to satisfy the devm_clk_get() call in nand_davinci_probe() which I think is superfluous since we also enable the same clock in aemif_probe().

Perhaps the better solution is to drip the clk code in drivers/mtd/nand/davinci_nand.c and shift legacy code to start using drivers/memory/aemif.c as well? This way we can also drop arch/arm/mach-davinci/aemif.c

Quoted 8 lines
Quoted 2 lines

Thanks,
Sekhar

Yes, this sounds good, but I think we should leave it for later as an additional improvement, once everything else is in place. I think these patches should be applied together with David's series in order to not break the support on davinci boards and the aemif work would go in later as a follow-up. How about that?

No, I dont think we should add temporary hacks to DT to work around driver issues (I do think its a hack since the clock belongs to aemif module not NAND flash).

An easier driver hack might be to not treat devm_clk_get() failure in davinci_nand.c as catastrophic. It will safely fail in DT case and we should get the clock in legacy boot case.

Quoted 5 lines
Quoted 1 line

I think we are looking at a driver update dependency anyway.

It looks like keystone.dtsi is using the clock-ranges property in the aemif node to pass the clock to child nodes. Could we not do the same in da850.dtsi?

Bartosz, please try this instead of your patch.

FYI, this is just following the existing memory-controllers/ti-aemif.txt device tree bindings, so not a "hack".

---

arch/arm/boot/dts/da850.dtsi +2 -0
index 3a1f2ce..ff9d807 100644
@@ -796,6 +796,8 @@
  		ranges = <0 0 0x60000000 0x08000000
  			  1 0 0x68000000 0x00008000>;
  		clocks = <&psc0 3>;
+		clock-names = "aemif";
+		clock-ranges;
  		status = "disabled";
  	};
  	memctrl: memory-controller at b0000000 {

---

#6 lore raw

2018-02-06 19:25 GMT+01:00 David Lechner <[email protected]>:

Quoted 80 lines · David Lechner
Quoted 60 lines · Sekhar Nori
Quoted 58 lines · Bartosz Golaszewski
Quoted 41 lines

2018-02-06 12:07 GMT+01:00 Sekhar Nori <[email protected]>:

Quoted 30 lines · Bartosz Golaszewski
Quoted 17 lines

From: Bartosz Golaszewski <[email protected]>

Make nand work with the common clock framework by specifying which clock should be used and what name to look up.

---
  arch/arm/boot/dts/da850-evm.dts | 3 +++
  1 file changed, 3 insertions(+)
arch/arm/boot/dts/da850-evm.dts +0 -0
index a86a8a1816f2..2602ad8e99ee 100644

arch/arm/boot/dts/da850-evm.dts line 300

Quoted 5 lines
arch/arm/boot/dts/da850-evm.dts +2 -0
@@ -296,6 +296,9 @@
                       reg = <0 0x02000000 0x02000000
                              1 0x00000000 0x00008000>;
 
+                     clocks = <&psc0 3>;
+                     clock-names = "aemif";

Looks like this is being added only to satisfy the devm_clk_get() call in nand_davinci_probe() which I think is superfluous since we also enable the same clock in aemif_probe().

Quoted 7 lines

Perhaps the better solution is to drip the clk code in drivers/mtd/nand/davinci_nand.c and shift legacy code to start using drivers/memory/aemif.c as well? This way we can also drop arch/arm/mach-davinci/aemif.c

Thanks,
Sekhar

Quoted 5 lines

Yes, this sounds good, but I think we should leave it for later as an additional improvement, once everything else is in place. I think these patches should be applied together with David's series in order to not break the support on davinci boards and the aemif work would go in later as a follow-up. How about that?

No, I dont think we should add temporary hacks to DT to work around driver issues (I do think its a hack since the clock belongs to aemif module not NAND flash).

An easier driver hack might be to not treat devm_clk_get() failure in davinci_nand.c as catastrophic. It will safely fail in DT case and we should get the clock in legacy boot case.

Quoted 6 lines
Quoted 1 line

I think we are looking at a driver update dependency anyway.

It looks like keystone.dtsi is using the clock-ranges property in the aemif node to pass the clock to child nodes. Could we not do the same in da850.dtsi?

Bartosz, please try this instead of your patch.

FYI, this is just following the existing memory-controllers/ti-aemif.txt device tree bindings, so not a "hack".

---

arch/arm/boot/dts/da850.dtsi +0 -0
index 3a1f2ce..ff9d807 100644

arch/arm/boot/dts/da850.dtsi

Quoted 9 lines
arch/arm/boot/dts/da850.dtsi +2 -1
@@ -796,6 +796,8 @@
                ranges = <0 0 0x60000000 0x08000000
                          1 0 0x68000000 0x00008000>;
                clocks = <&psc0 3>;
+               clock-names = "aemif";
+               clock-ranges;
                status = "disabled";
        };
        memctrl: memory-controller at b0000000 {
---

Yes, this works. Sekhar: can we include it in David's series, while still keeping the plan to move legacy boards to using the aemif driver?

Best regards,
Bartosz

#7 lore raw
Quoted 86 lines · Bartosz Golaszewski

2018-02-06 19:25 GMT+01:00 David Lechner <[email protected]>:

Quoted 85 lines · David Lechner
Quoted 60 lines · Sekhar Nori
Quoted 58 lines · Bartosz Golaszewski
Quoted 41 lines

2018-02-06 12:07 GMT+01:00 Sekhar Nori <[email protected]>:

Quoted 30 lines · Bartosz Golaszewski
Quoted 17 lines

From: Bartosz Golaszewski <[email protected]>

Make nand work with the common clock framework by specifying which clock should be used and what name to look up.

---
  arch/arm/boot/dts/da850-evm.dts | 3 +++
  1 file changed, 3 insertions(+)
arch/arm/boot/dts/da850-evm.dts +0 -0
index a86a8a1816f2..2602ad8e99ee 100644

arch/arm/boot/dts/da850-evm.dts line 300

Quoted 5 lines
arch/arm/boot/dts/da850-evm.dts +2 -0
@@ -296,6 +296,9 @@
                       reg = <0 0x02000000 0x02000000
                              1 0x00000000 0x00008000>;
 
+                     clocks = <&psc0 3>;
+                     clock-names = "aemif";

Looks like this is being added only to satisfy the devm_clk_get() call in nand_davinci_probe() which I think is superfluous since we also enable the same clock in aemif_probe().

Quoted 7 lines

Perhaps the better solution is to drip the clk code in drivers/mtd/nand/davinci_nand.c and shift legacy code to start using drivers/memory/aemif.c as well? This way we can also drop arch/arm/mach-davinci/aemif.c

Thanks,
Sekhar

Quoted 5 lines

Yes, this sounds good, but I think we should leave it for later as an additional improvement, once everything else is in place. I think these patches should be applied together with David's series in order to not break the support on davinci boards and the aemif work would go in later as a follow-up. How about that?

No, I dont think we should add temporary hacks to DT to work around driver issues (I do think its a hack since the clock belongs to aemif module not NAND flash).

An easier driver hack might be to not treat devm_clk_get() failure in davinci_nand.c as catastrophic. It will safely fail in DT case and we should get the clock in legacy boot case.

Quoted 6 lines
Quoted 1 line

I think we are looking at a driver update dependency anyway.

It looks like keystone.dtsi is using the clock-ranges property in the aemif node to pass the clock to child nodes. Could we not do the same in da850.dtsi?

Bartosz, please try this instead of your patch.

FYI, this is just following the existing memory-controllers/ti-aemif.txt device tree bindings, so not a "hack".

---

arch/arm/boot/dts/da850.dtsi +2 -0
index 3a1f2ce..ff9d807 100644
@@ -796,6 +796,8 @@
                ranges = <0 0 0x60000000 0x08000000
                          1 0 0x68000000 0x00008000>;
                clocks = <&psc0 3>;
+               clock-names = "aemif";
+               clock-ranges;
Quoted 8 lines

arch/arm/boot/dts/da850.dtsi

Quoted 4 lines
arch/arm/boot/dts/da850.dtsi +0 -1
                status = "disabled";
        };
        memctrl: memory-controller at b0000000 {
---

Yes, this works. Sekhar: can we include it in David's series, while still keeping the plan to move legacy boards to using the aemif driver?

Okay. Fine with me. Actually the chipselect node already has clock-ranges defined, but that doesn't have any meaning unless its also included in aemif node.

Thanks,
Sekhar

#8 lore raw
In reply to Bartosz Golaszewski
I love your patch! Yet something to improve:

Hi Bartosz,

I love your patch! Yet something to improve:

[auto build test ERROR on robh/for-next]
[also build test ERROR on v4.15 next-20180209]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Bartosz-Golaszewski/ARM-dts-da850-evm-add-clock-properties-to-the-nand-node/20180208-105626
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: arm-sunxi_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm

All errors (new ones prefixed by >>):

>> ERROR: Input tree has errors, aborting (use -f to force output)

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 23273 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180211/5feae002/attachment-0001.gz>