Skip to contentSkip to conversation

mtd: nand: davinci: stop using pdev->id as chipselect

PATCH In review Bartosz Golaszewski 3 participants 26 messages Apr 30, 2018 – May 3, 2018

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover mtd: nand: davinci: stop using pdev->id as chipselect

From: Bartosz Golaszewski <[email protected]>

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

This series adds a new field to davinci-nand platform data, then makes all board use it and finally modifies the two drivers that make use of it.

Bartosz Golaszewski (12):
mtd: nand: davinci: store the core chipselect number in platform data
ARM: davinci: da830-evm: specify the chipselect in davinci_nand_pdata
ARM: davinci: da850-evm: specify the chipselect in davinci_nand_pdata
ARM: davinci: dm355-evm: specify the chipselect in davinci_nand_pdata
ARM: davinci: dm355-leopard: specify the chipselect in
davinci_nand_pdata
ARM: davinci: dm365-evm: specify the chipselect in davinci_nand_pdata
ARM: davinci: dm644x-evm: specify the chipselect in davinci_nand_pdata
ARM: davinci: mityomapl138: specify the chipselect in
davinci_nand_pdata
ARM: davinci: dm646x-evm: specify the chipselect in davinci_nand_pdata
ARM: davinci: neuros-osd2: specify the chipselect in
davinci_nand_pdata
mtd: nand: davinci: stop using pdev->id as chipselect
ARM: davinci: aemif: stop using pdev->id as nand chipselect

 arch/arm/mach-davinci/aemif.c               | 8 ++++----
 arch/arm/mach-davinci/board-da830-evm.c     | 1 +
 arch/arm/mach-davinci/board-da850-evm.c     | 1 +
 arch/arm/mach-davinci/board-dm355-evm.c     | 1 +
 arch/arm/mach-davinci/board-dm355-leopard.c | 1 +
 arch/arm/mach-davinci/board-dm365-evm.c     | 1 +
 arch/arm/mach-davinci/board-dm644x-evm.c    | 1 +
 arch/arm/mach-davinci/board-dm646x-evm.c    | 1 +
 arch/arm/mach-davinci/board-mityomapl138.c  | 1 +
 arch/arm/mach-davinci/board-neuros-osd2.c   | 1 +
 drivers/mtd/nand/raw/davinci_nand.c         | 6 +++---
 include/linux/platform_data/mtd-davinci.h   | 2 ++
 12 files changed, 18 insertions(+), 7 deletions(-)
Signature · 1 line
2.17.0
#1 lore raw

PATCH 1/12 mtd: nand: davinci: store the core chipselect number in platform data

From: Bartosz Golaszewski <[email protected]>

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

This patch adds a new filed - core_chipsel - to the platform_data. Subsequent patches will convert the platforms to using this new field.

---
 include/linux/platform_data/mtd-davinci.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/platform_data/mtd-davinci.h +2 -0
index f1a2cf655bdb..879a59f97dac 100644
@@ -56,6 +56,8 @@ struct davinci_nand_pdata {		/* platform_data */
 	uint32_t		mask_ale;
 	uint32_t		mask_cle;
 
+	uint32_t		core_chipsel;
+
 	/* for packages using two chipselects */
 	uint32_t		mask_chipsel;
 
Signature · 1 line
2.17.0
#2 lore raw

Re: [PATCH 01/12] mtd: nand: davinci: store the core chipselect number in platform data

Quoted 11 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

This patch adds a new filed - core_chipsel - to the platform_data.

s/filed/field

Quoted 1 line

Subsequent patches will convert the platforms to using this new field.

Can you add a comment for this new field too, like how we have for most other fields?

Curious on what 'core' in core_chipsel means. Something to do with chip-select offset we have on DA850?

Quoted 2 lines

Thanks,
Sekhar

#3 lore raw

Re: [PATCH 01/12] mtd: nand: davinci: store the core chipselect number in platform data

Quoted 15 lines · Sekhar Nori
Quoted 11 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

This patch adds a new filed - core_chipsel - to the platform_data.

s/filed/field

Quoted 7 lines
Quoted 1 line

Subsequent patches will convert the platforms to using this new field.

Can you add a comment for this new field too, like how we have for most other fields?

Curious on what 'core' in core_chipsel means. Something to do with chip-select offset we have on DA850?

Looks like you may have just picked the terminology from DaVinci NAND driver (introduced back in 2009). But in this context, it means the 0-indexed chip-select number that of the asynchronous memory interface to which the NAND device is connected.

So, may be a comment here will suffice.

Thanks,
Sekhar

#4 lore raw

Re: [PATCH 01/12] mtd: nand: davinci: store the core chipselect number in platform data

Quoted 24 lines · Sekhar Nori
Quoted 15 lines · Sekhar Nori
Quoted 11 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

This patch adds a new filed - core_chipsel - to the platform_data.

s/filed/field

Quoted 7 lines
Quoted 1 line

Subsequent patches will convert the platforms to using this new field.

Can you add a comment for this new field too, like how we have for most other fields?

Curious on what 'core' in core_chipsel means. Something to do with chip-select offset we have on DA850?

Quoted 6 lines

Looks like you may have just picked the terminology from DaVinci NAND driver (introduced back in 2009). But in this context, it means the 0-indexed chip-select number that of the asynchronous memory interface to which the NAND device is connected.

So, may be a comment here will suffice.

This is what I committed:

--8<--
commit 533d93703fa717fdf74c4fb711c868c4fdc8b475 (HEAD -> refs/heads/v4.18/nand-cs-simplification)

Author:     Bartosz Golaszewski <[email protected]>
AuthorDate: Mon Apr 30 10:24:42 2018 +0200
Commit:     Sekhar Nori <[email protected]>
CommitDate: Tue May 1 15:57:47 2018 +0530

mtd: nand: davinci: store the core chipselect number in platform data

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

This patch adds a new field - core_chipsel - to the platform_data. Subsequent patches will convert the platforms to using this new field.

include/linux/platform_data/mtd-davinci.h +10 -0
index f1a2cf655bdb..1bbfa27cccb4 100644
@@ -56,6 +56,16 @@ struct davinci_nand_pdata {		/* platform_data */
 	uint32_t		mask_ale;
 	uint32_t		mask_cle;
 
+	/*
+	 * 0-indexed chip-select number of the asynchronous
+	 * interface to which the NAND device has been connected.
+	 *
+	 * So, if you have NAND connected to CS3 of DA850, you
+	 * will pass '1' here. Since the asynchronous interface
+	 * on DA850 starts from CS2.
+	 */
+	uint32_t		core_chipsel;
+
 	/* for packages using two chipselects */
 	uint32_t		mask_chipsel;
 
#5 lore raw

Re: [PATCH 01/12] mtd: nand: davinci: store the core chipselect number in platform data

Quoted 34 lines · Sekhar Nori
Quoted 24 lines · Sekhar Nori
Quoted 15 lines · Sekhar Nori
Quoted 11 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

This patch adds a new filed - core_chipsel - to the platform_data.

s/filed/field

Quoted 7 lines
Quoted 1 line

Subsequent patches will convert the platforms to using this new field.

Can you add a comment for this new field too, like how we have for most other fields?

Curious on what 'core' in core_chipsel means. Something to do with chip-select offset we have on DA850?

Quoted 6 lines

Looks like you may have just picked the terminology from DaVinci NAND driver (introduced back in 2009). But in this context, it means the 0-indexed chip-select number that of the asynchronous memory interface to which the NAND device is connected.

So, may be a comment here will suffice.

This is what I committed:

Quoted 8 lines

--8<--
commit 533d93703fa717fdf74c4fb711c868c4fdc8b475 (HEAD -> refs/heads/v4.18/nand-cs-simplification)

Author:     Bartosz Golaszewski <[email protected]>
AuthorDate: Mon Apr 30 10:24:42 2018 +0200
Commit:     Sekhar Nori <[email protected]>
CommitDate: Tue May 1 15:57:47 2018 +0530

mtd: nand: davinci: store the core chipselect number in platform data

Missed the rawnand prefix here. Sigh. Here is the fixed headline.

mtd: rawnand: davinci: store the core chipselect number in platform data

Thanks,
Sekhar

#6 lore raw

Re: [PATCH 01/12] mtd: nand: davinci: store the core chipselect number in platform data

In reply to Sekhar Nori

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

Quoted 25 lines · Sekhar Nori
Quoted 24 lines · Sekhar Nori
Quoted 22 lines · Bartosz Golaszewski
Quoted 11 lines

From: Bartosz Golaszewski <[email protected]>

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

This patch adds a new filed - core_chipsel - to the platform_data.

s/filed/field

Quoted 1 line

Subsequent patches will convert the platforms to using this new field.

Can you add a comment for this new field too, like how we have for most other fields?

Curious on what 'core' in core_chipsel means. Something to do with chip-select offset we have on DA850?

Quoted 9 lines
Quoted 6 lines

Looks like you may have just picked the terminology from DaVinci NAND driver (introduced back in 2009). But in this context, it means the 0-indexed chip-select number that of the asynchronous memory interface to which the NAND device is connected.

So, may be a comment here will suffice.

This is what I committed:

I don't see it in your tree yet.

Quoted 29 lines

--8<--
commit 533d93703fa717fdf74c4fb711c868c4fdc8b475 (HEAD -> refs/heads/v4.18/nand-cs-simplification)

Author:     Bartosz Golaszewski <[email protected]>
AuthorDate: Mon Apr 30 10:24:42 2018 +0200
Commit:     Sekhar Nori <[email protected]>
CommitDate: Tue May 1 15:57:47 2018 +0530

mtd: nand: davinci: store the core chipselect number in platform data

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

This patch adds a new field - core_chipsel - to the platform_data. Subsequent patches will convert the platforms to using this new field.

include/linux/platform_data/mtd-davinci.h +0 -0
index f1a2cf655bdb..1bbfa27cccb4 100644
@@ -56,6 +56,16 @@ struct davinci_nand_pdata {          /* platform_data */
        uint32_t                mask_ale;

include/linux/platform_data/mtd-davinci.h struct davinci_nand_pdata { /* platform_data */ · line 66

Quoted 10 lines
include/linux/platform_data/mtd-davinci.h +8 -0
        uint32_t                mask_cle;
 
+       /*
+        * 0-indexed chip-select number of the asynchronous
+        * interface to which the NAND device has been connected.
+        *
+        * So, if you have NAND connected to CS3 of DA850, you
+        * will pass '1' here. Since the asynchronous interface
+        * on DA850 starts from CS2.
+        */

Maybe we should add that on all other DaVinci SoCs the async interface starts from CS0?

include/linux/platform_data/mtd-davinci.h struct davinci_nand_pdata { /* platform_data */ · line 71

Quoted 6 lines
include/linux/platform_data/mtd-davinci.h +2 -0
+       uint32_t                core_chipsel;
+
        /* for packages using two chipselects */
        uint32_t                mask_chipsel;
 

Thanks,
Bart

#7 lore raw

Re: [PATCH 01/12] mtd: nand: davinci: store the core chipselect number in platform data

Quoted 31 lines · Bartosz Golaszewski

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

Quoted 30 lines · Sekhar Nori
Quoted 29 lines · Sekhar Nori
Quoted 15 lines · Bartosz Golaszewski
Quoted 11 lines

From: Bartosz Golaszewski <[email protected]>

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

This patch adds a new filed - core_chipsel - to the platform_data.

s/filed/field

Quoted 7 lines
Quoted 1 line

Subsequent patches will convert the platforms to using this new field.

Can you add a comment for this new field too, like how we have for most other fields?

Curious on what 'core' in core_chipsel means. Something to do with chip-select offset we have on DA850?

Looks like you may have just picked the terminology from DaVinci NAND driver (introduced back in 2009). But in this context, it means the 0-indexed chip-select number that of the asynchronous memory interface to which the NAND device is connected.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

So, may be a comment here will suffice.

This is what I committed:

I don't see it in your tree yet.

I pushed it out now. Wanted to do some basic testing.

Quoted 32 lines
Quoted 32 lines

--8<--
commit 533d93703fa717fdf74c4fb711c868c4fdc8b475 (HEAD -> refs/heads/v4.18/nand-cs-simplification)

Author:     Bartosz Golaszewski <[email protected]>
AuthorDate: Mon Apr 30 10:24:42 2018 +0200
Commit:     Sekhar Nori <[email protected]>
CommitDate: Tue May 1 15:57:47 2018 +0530

mtd: nand: davinci: store the core chipselect number in platform data

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

This patch adds a new field - core_chipsel - to the platform_data. Subsequent patches will convert the platforms to using this new field.

include/linux/platform_data/mtd-davinci.h +0 -0
index f1a2cf655bdb..1bbfa27cccb4 100644
@@ -56,6 +56,16 @@ struct davinci_nand_pdata {          /* platform_data */
        uint32_t                mask_ale;
        uint32_t                mask_cle;
 
Quoted 11 lines

include/linux/platform_data/mtd-davinci.h struct davinci_nand_pdata { /* platform_data */ · line 66

Quoted 8 lines
include/linux/platform_data/mtd-davinci.h +8 -0
+       /*
+        * 0-indexed chip-select number of the asynchronous
+        * interface to which the NAND device has been connected.
+        *
+        * So, if you have NAND connected to CS3 of DA850, you
+        * will pass '1' here. Since the asynchronous interface
+        * on DA850 starts from CS2.
+        */

Maybe we should add that on all other DaVinci SoCs the async interface starts from CS0?

I just intended it to be an example (and chose the more confusing one). I had already created the tree, not just pushed it out, so I went with what I already have.

Thanks,
Sekhar

#8 lore raw

PATCH 2/12 ARM: davinci: da830-evm: specify the chipselect in davinci_nand_pdata

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We now have the core_chipsel field in davinci_nand_pdata. Use it instead of the platform_device id number.

---
 arch/arm/mach-davinci/board-da830-evm.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-davinci/board-da830-evm.c +1 -0
index d283faefaf97..7cfb6f7e39e7 100644
@@ -304,6 +304,7 @@ static struct davinci_aemif_timing da830_evm_nandflash_timing = {
 };
 
 static struct davinci_nand_pdata da830_evm_nand_pdata = {
+	.core_chipsel	= 1,
 	.parts		= da830_evm_nand_partitions,
 	.nr_parts	= ARRAY_SIZE(da830_evm_nand_partitions),
 	.ecc_mode	= NAND_ECC_HW,
Signature · 1 line
2.17.0
#9 lore raw

PATCH 3/12 ARM: davinci: da850-evm: specify the chipselect in davinci_nand_pdata

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We now have the core_chipsel field in davinci_nand_pdata. Use it instead of the platform_device id number.

---
 arch/arm/mach-davinci/board-da850-evm.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-davinci/board-da850-evm.c +1 -0
index 78a670aafea0..9f8041a0cf67 100644
@@ -244,6 +244,7 @@ static struct davinci_aemif_timing da850_evm_nandflash_timing = {
 };
 
 static struct davinci_nand_pdata da850_evm_nandflash_data = {
+	.core_chipsel	= 1,
 	.parts		= da850_evm_nandflash_partition,
 	.nr_parts	= ARRAY_SIZE(da850_evm_nandflash_partition),
 	.ecc_mode	= NAND_ECC_HW,
Signature · 1 line
2.17.0
#10 lore raw

PATCH 4/12 ARM: davinci: dm355-evm: specify the chipselect in davinci_nand_pdata

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We now have the core_chipsel field in davinci_nand_pdata. Use it instead of the platform_device id number.

---
 arch/arm/mach-davinci/board-dm355-evm.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-davinci/board-dm355-evm.c +1 -0
index ea03ddcd35f5..ecd67a978aad 100644
@@ -77,6 +77,7 @@ static struct mtd_partition davinci_nand_partitions[] = {
 };
 
 static struct davinci_nand_pdata davinci_nand_data = {
+	.core_chipsel		= 0,
 	.mask_chipsel		= BIT(14),
 	.parts			= davinci_nand_partitions,
 	.nr_parts		= ARRAY_SIZE(davinci_nand_partitions),
Signature · 1 line
2.17.0
#11 lore raw

PATCH 5/12 ARM: davinci: dm355-leopard: specify the chipselect in davinci_nand_pdata

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We now have the core_chipsel field in davinci_nand_pdata. Use it instead of the platform_device id number.

---
 arch/arm/mach-davinci/board-dm355-leopard.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-davinci/board-dm355-leopard.c +1 -0
index 09f82160bbed..0fdf1d03eb11 100644
@@ -72,6 +72,7 @@ static struct mtd_partition davinci_nand_partitions[] = {
 };
 
 static struct davinci_nand_pdata davinci_nand_data = {
+	.core_chipsel		= 0,
 	.mask_chipsel		= BIT(14),
 	.parts			= davinci_nand_partitions,
 	.nr_parts		= ARRAY_SIZE(davinci_nand_partitions),
Signature · 1 line
2.17.0
#12 lore raw

PATCH 6/12 ARM: davinci: dm365-evm: specify the chipselect in davinci_nand_pdata

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We now have the core_chipsel field in davinci_nand_pdata. Use it instead of the platform_device id number.

---
 arch/arm/mach-davinci/board-dm365-evm.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-davinci/board-dm365-evm.c +1 -0
index 36b69a131cfa..307e88d99dd3 100644
@@ -138,6 +138,7 @@ static struct mtd_partition davinci_nand_partitions[] = {
 };
 
 static struct davinci_nand_pdata davinci_nand_data = {
+	.core_chipsel		= 0,
 	.mask_chipsel		= BIT(14),
 	.parts			= davinci_nand_partitions,
 	.nr_parts		= ARRAY_SIZE(davinci_nand_partitions),
Signature · 1 line
2.17.0
#13 lore raw

PATCH 7/12 ARM: davinci: dm644x-evm: specify the chipselect in davinci_nand_pdata

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We now have the core_chipsel field in davinci_nand_pdata. Use it instead of the platform_device id number.

---
 arch/arm/mach-davinci/board-dm644x-evm.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-davinci/board-dm644x-evm.c +1 -0
index 190a28cc91bd..f76e22069e4b 100644
@@ -152,6 +152,7 @@ static struct davinci_aemif_timing davinci_evm_nandflash_timing = {
 };
 
 static struct davinci_nand_pdata davinci_evm_nandflash_data = {
+	.core_chipsel	= 0,
 	.parts		= davinci_evm_nandflash_partition,
 	.nr_parts	= ARRAY_SIZE(davinci_evm_nandflash_partition),
 	.ecc_mode	= NAND_ECC_HW,
Signature · 1 line
2.17.0
#14 lore raw

PATCH 8/12 ARM: davinci: mityomapl138: specify the chipselect in davinci_nand_pdata

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We now have the core_chipsel field in davinci_nand_pdata. Use it instead of the platform_device id number.

---
 arch/arm/mach-davinci/board-mityomapl138.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-davinci/board-mityomapl138.c +1 -0
index f442784eded3..2cce0d7d2f2a 100644
@@ -400,6 +400,7 @@ static struct mtd_partition mityomapl138_nandflash_partition[] = {
 };
 
 static struct davinci_nand_pdata mityomapl138_nandflash_data = {
+	.core_chipsel	= 1,
 	.parts		= mityomapl138_nandflash_partition,
 	.nr_parts	= ARRAY_SIZE(mityomapl138_nandflash_partition),
 	.ecc_mode	= NAND_ECC_HW,
Signature · 1 line
2.17.0
#15 lore raw

PATCH 9/12 ARM: davinci: dm646x-evm: specify the chipselect in davinci_nand_pdata

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We now have the core_chipsel field in davinci_nand_pdata. Use it instead of the platform_device id number.

---
 arch/arm/mach-davinci/board-dm646x-evm.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-davinci/board-dm646x-evm.c +1 -0
index d672804df817..37c9e0ee4dcc 100644
@@ -84,6 +84,7 @@ static struct davinci_aemif_timing dm6467tevm_nandflash_timing = {
 };
 
 static struct davinci_nand_pdata davinci_nand_data = {
+	.core_chipsel		= 0,
 	.mask_cle 		= 0x80000,
 	.mask_ale 		= 0x40000,
 	.parts			= davinci_nand_partitions,
Signature · 1 line
2.17.0
#16 lore raw

PATCH 10/12 ARM: davinci: neuros-osd2: specify the chipselect in davinci_nand_pdata

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We now have the core_chipsel field in davinci_nand_pdata. Use it instead of the platform_device id number.

---
 arch/arm/mach-davinci/board-neuros-osd2.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-davinci/board-neuros-osd2.c +1 -0
index 06e7f592b62b..353f9e5a1454 100644
@@ -87,6 +87,7 @@ static struct mtd_partition davinci_ntosd2_nandflash_partition[] = {
 };
 
 static struct davinci_nand_pdata davinci_ntosd2_nandflash_data = {
+	.core_chipsel	= 0,
 	.parts		= davinci_ntosd2_nandflash_partition,
 	.nr_parts	= ARRAY_SIZE(davinci_ntosd2_nandflash_partition),
 	.ecc_mode	= NAND_ECC_HW,
Signature · 1 line
2.17.0
#17 lore raw

PATCH 11/12 mtd: nand: davinci: stop using pdev->id as chipselect

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

All platform now use the core_chipsel field in platform data. Stop using pdev->id in the driver.

---
 drivers/mtd/nand/raw/davinci_nand.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mtd/nand/raw/davinci_nand.c +3 -3
index 7255a0d94374..cd12e5abafde 100644
@@ -545,7 +545,7 @@ static struct davinci_nand_pdata
 			return ERR_PTR(-ENOMEM);
 		if (!of_property_read_u32(pdev->dev.of_node,
 			"ti,davinci-chipselect", &prop))
-			pdev->id = prop;
+			pdata->core_chipsel = prop;
 		else
 			return ERR_PTR(-EINVAL);
 
@@ -627,7 +627,7 @@ static int nand_davinci_probe(struct platform_device *pdev)
 		return -ENODEV;
 
 	/* which external chipselect will we be managing? */
-	if (pdev->id < 0 || pdev->id > 3)
+	if (pdata->core_chipsel < 0 || pdata->core_chipsel > 3)
 		return -ENODEV;
 
 	info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
@@ -683,7 +683,7 @@ static int nand_davinci_probe(struct platform_device *pdev)
 	info->ioaddr		= (uint32_t __force) vaddr;
 
 	info->current_cs	= info->ioaddr;
-	info->core_chipsel	= pdev->id;
+	info->core_chipsel	= pdata->core_chipsel;
 	info->mask_chipsel	= pdata->mask_chipsel;
 
 	/* use nandboot-capable ALE/CLE masks by default */
Signature · 1 line
2.17.0
#18 lore raw

PATCH 12/12 ARM: davinci: aemif: stop using pdev->id as nand chipselect

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

All platforms now use the core_chipsel field in platform_data. Stop using pdev->id in the aemif code.

---
 arch/arm/mach-davinci/aemif.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-davinci/aemif.c +4 -4
index ff8b7e76b6e9..e4ab3f3a2a1f 100644
@@ -189,7 +189,7 @@ int davinci_aemif_setup(struct platform_device *pdev)
 	 * Setup Async configuration register in case we did not boot
 	 * from NAND and so bootloader did not bother to set it up.
 	 */
-	val = davinci_aemif_readl(base, A1CR_OFFSET + pdev->id * 4);
+	val = davinci_aemif_readl(base, A1CR_OFFSET + pdata->core_chipsel * 4);
 	/*
 	 * Extended Wait is not valid and Select Strobe mode is not
 	 * used
@@ -198,13 +198,13 @@ int davinci_aemif_setup(struct platform_device *pdev)
 	if (pdata->options & NAND_BUSWIDTH_16)
 		val |= 0x1;
 
-	davinci_aemif_writel(base, A1CR_OFFSET + pdev->id * 4, val);
+	davinci_aemif_writel(base, A1CR_OFFSET + pdata->core_chipsel * 4, val);
 
 	clkrate = clk_get_rate(clk);
 
 	if (pdata->timing)
-		ret = davinci_aemif_setup_timing(pdata->timing, base, pdev->id,
-						 clkrate);
+		ret = davinci_aemif_setup_timing(pdata->timing, base,
+						 pdata->core_chipsel, clkrate);
 
 	if (ret < 0)
 		dev_dbg(&pdev->dev, "NAND timing values setup fail\n");
Signature · 1 line
2.17.0
#19 lore raw
In reply to Bartosz Golaszewski

Hi Bartosz,

Quoted 10 lines · On Mon, 30 Apr 2018 10:24:41 +0200 Bartosz Golaszewski <[email protected]> wrote:

From: Bartosz Golaszewski <[email protected]>

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

Quoted 6 lines

This series adds a new field to davinci-nand platform data, then makes all board use it and finally modifies the two drivers that make use of it.

Bartosz Golaszewski (12):
mtd: nand: davinci: store the core chipselect number in platform data

Raw NAND related patches (that is, everything that is not onenand or SPI NAND) should use the "mtd: rawnand: " prefix now. Other than that, I'm fine with the patch series, just let me know how you want to have it merged (through the MTD tree or the davinci tree).

Thanks,

Boris

#20 lore raw

2018-04-30 12:09 GMT+02:00 Boris Brezillon <[email protected]>:

Quoted 22 lines

Hi Bartosz,

Quoted 10 lines · On Mon, 30 Apr 2018 10:24:41 +0200 Bartosz Golaszewski <[email protected]> wrote:

From: Bartosz Golaszewski <[email protected]>

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

Quoted 6 lines

This series adds a new field to davinci-nand platform data, then makes all board use it and finally modifies the two drivers that make use of it.

Bartosz Golaszewski (12):
mtd: nand: davinci: store the core chipselect number in platform data

Quoted 8 lines

Raw NAND related patches (that is, everything that is not onenand or SPI NAND) should use the "mtd: rawnand: " prefix now. Other than that, I'm fine with the patch series, just let me know how you want to have it merged (through the MTD tree or the davinci tree).

Thanks,

Boris

I think Sekhar could pick all those patches up for 4.18.

Sekhar - do you want me to resend the series with the commit message changed as requested by Boris, or can you fix it when applying the series?

Best regards,
Bartosz Golaszewski

#21 lore raw
Quoted 28 lines · On Mon, 30 Apr 2018 18:45:06 +0200 Bartosz Golaszewski <[email protected]> wrote:

2018-04-30 12:09 GMT+02:00 Boris Brezillon <[email protected]>:

Quoted 27 lines

Hi Bartosz,

Quoted 10 lines · On Mon, 30 Apr 2018 10:24:41 +0200 Bartosz Golaszewski <[email protected]> wrote:

From: Bartosz Golaszewski <[email protected]>

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

Quoted 6 lines

This series adds a new field to davinci-nand platform data, then makes all board use it and finally modifies the two drivers that make use of it.

Bartosz Golaszewski (12):
mtd: nand: davinci: store the core chipselect number in platform data

Raw NAND related patches (that is, everything that is not onenand or SPI NAND) should use the "mtd: rawnand: " prefix now. Other than that, I'm fine with the patch series, just let me know how you want to have it merged (through the MTD tree or the davinci tree).

Quoted 5 lines
Quoted 3 lines

Thanks,

Boris

I think Sekhar could pick all those patches up for 4.18.

Okay, then I'd need an immutable branch containing these changes.

Quoted 7 lines

Sekhar - do you want me to resend the series with the commit message changed as requested by Boris, or can you fix it when applying the series?

Best regards,
Bartosz Golaszewski

#22 lore raw
Quoted 31 lines · Boris Brezillon
Quoted 28 lines · On Mon, 30 Apr 2018 18:45:06 +0200 Bartosz Golaszewski <[email protected]> wrote:

2018-04-30 12:09 GMT+02:00 Boris Brezillon <[email protected]>:

Quoted 27 lines

Hi Bartosz,

Quoted 10 lines · On Mon, 30 Apr 2018 10:24:41 +0200 Bartosz Golaszewski <[email protected]> wrote:

From: Bartosz Golaszewski <[email protected]>

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

Quoted 6 lines

This series adds a new field to davinci-nand platform data, then makes all board use it and finally modifies the two drivers that make use of it.

Bartosz Golaszewski (12):
mtd: nand: davinci: store the core chipselect number in platform data

Raw NAND related patches (that is, everything that is not onenand or SPI NAND) should use the "mtd: rawnand: " prefix now. Other than that, I'm fine with the patch series, just let me know how you want to have it merged (through the MTD tree or the davinci tree).

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Thanks,

Boris

I think Sekhar could pick all those patches up for 4.18.

Okay, then I'd need an immutable branch containing these changes.

Boris, sure!

Quoted 5 lines
Quoted 5 lines

Sekhar - do you want me to resend the series with the commit message changed as requested by Boris, or can you fix it when applying the series?

Bartosz, No need to resend. I also wanted couple of changes on 1/12 which I can do locally too.

Thanks,
Sekhar

#23 lore raw
In reply to Boris Brezillon

Hi Boris,

Quoted 31 lines · Boris Brezillon
Quoted 28 lines · On Mon, 30 Apr 2018 18:45:06 +0200 Bartosz Golaszewski <[email protected]> wrote:

2018-04-30 12:09 GMT+02:00 Boris Brezillon <[email protected]>:

Quoted 27 lines

Hi Bartosz,

Quoted 10 lines · On Mon, 30 Apr 2018 10:24:41 +0200 Bartosz Golaszewski <[email protected]> wrote:

From: Bartosz Golaszewski <[email protected]>

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

Quoted 6 lines

This series adds a new field to davinci-nand platform data, then makes all board use it and finally modifies the two drivers that make use of it.

Bartosz Golaszewski (12):
mtd: nand: davinci: store the core chipselect number in platform data

Raw NAND related patches (that is, everything that is not onenand or SPI NAND) should use the "mtd: rawnand: " prefix now. Other than that, I'm fine with the patch series, just let me know how you want to have it merged (through the MTD tree or the davinci tree).

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Thanks,

Boris

I think Sekhar could pick all those patches up for 4.18.

Okay, then I'd need an immutable branch containing these changes.

You can use branch v4.18/nand-cs-simplification of
git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci.git
(commit 7c4db57cdb00)

Thanks,
Sekhar

#24 lore raw
In reply to Boris Brezillon
Quoted 19 lines · Boris Brezillon

Hi Bartosz,

Quoted 14 lines · On Mon, 30 Apr 2018 10:24:41 +0200 Bartosz Golaszewski <[email protected]> wrote:

From: Bartosz Golaszewski <[email protected]>

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

This series adds a new field to davinci-nand platform data, then makes all board use it and finally modifies the two drivers that make use of it.

Quoted 6 lines
Quoted 2 lines

Bartosz Golaszewski (12):
mtd: nand: davinci: store the core chipselect number in platform data

Raw NAND related patches (that is, everything that is not onenand or SPI NAND) should use the "mtd: rawnand: " prefix now. Other than that, I'm fine with the patch series, just let me know how you want to have it

Hi Boris, should I convert the "I'm fine" to some sort of formal tag? If yes, what is the tag and for which patches?

Thanks,
Sekhar

#25 lore raw
Quoted 23 lines · On Tue, 1 May 2018 16:01:42 +0530 Sekhar Nori <[email protected]> wrote:
Quoted 22 lines · Boris Brezillon

Hi Bartosz,

Quoted 16 lines · On Mon, 30 Apr 2018 10:24:41 +0200 Bartosz Golaszewski <[email protected]> wrote:

From: Bartosz Golaszewski <[email protected]>

We have the 'ti,davinci-chipselect' property in the device tree, but when using platform data the driver silently uses the id field of struct platform_device as the chipselect. This is confusing and we almost broke the nand support again recently after converting the platform to common clock framework (which changed the device id in the clock lookup - the problem is gone now that we no longer acquire the clock in the nand driver.

This series adds a new field to davinci-nand platform data, then makes all board use it and finally modifies the two drivers that make use of it.

Bartosz Golaszewski (12):
mtd: nand: davinci: store the core chipselect number in platform data

Quoted 6 lines
Quoted 3 lines

Raw NAND related patches (that is, everything that is not onenand or SPI NAND) should use the "mtd: rawnand: " prefix now. Other than that, I'm fine with the patch series, just let me know how you want to have it

Hi Boris, should I convert the "I'm fine" to some sort of formal tag? If yes, what is the tag and for which patches?

Yep, you can add

on patches 1 and 11.

Thanks,

Boris