mtd: nand: davinci: stop using pdev->id as chipselect
Subsystems (5)
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
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
@@ -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
PATCH 2/12 ARM: davinci: da830-evm: specify the chipselect in davinci_nand_pdata
In reply to Bartosz GolaszewskiFrom: 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
@@ -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
PATCH 3/12 ARM: davinci: da850-evm: specify the chipselect in davinci_nand_pdata
In reply to Bartosz GolaszewskiFrom: 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
@@ -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
PATCH 4/12 ARM: davinci: dm355-evm: specify the chipselect in davinci_nand_pdata
In reply to Bartosz GolaszewskiFrom: 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
@@ -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
PATCH 5/12 ARM: davinci: dm355-leopard: specify the chipselect in davinci_nand_pdata
In reply to Bartosz GolaszewskiFrom: 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
@@ -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
PATCH 6/12 ARM: davinci: dm365-evm: specify the chipselect in davinci_nand_pdata
In reply to Bartosz GolaszewskiFrom: 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
@@ -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
PATCH 7/12 ARM: davinci: dm644x-evm: specify the chipselect in davinci_nand_pdata
In reply to Bartosz GolaszewskiFrom: 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
@@ -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
PATCH 8/12 ARM: davinci: mityomapl138: specify the chipselect in davinci_nand_pdata
In reply to Bartosz GolaszewskiFrom: 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
@@ -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
PATCH 9/12 ARM: davinci: dm646x-evm: specify the chipselect in davinci_nand_pdata
In reply to Bartosz GolaszewskiFrom: 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
@@ -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
PATCH 10/12 ARM: davinci: neuros-osd2: specify the chipselect in davinci_nand_pdata
In reply to Bartosz GolaszewskiFrom: 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
@@ -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
PATCH 11/12 mtd: nand: davinci: stop using pdev->id as chipselect
In reply to Bartosz GolaszewskiFrom: 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
@@ -545,7 +545,7 @@ static struct davinci_nand_pdatareturn 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
PATCH 12/12 ARM: davinci: aemif: stop using pdev->id as nand chipselect
In reply to Bartosz GolaszewskiFrom: 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
@@ -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
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_deviceas 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
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_deviceas 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
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_deviceas 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 dataRaw 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
Re: [PATCH 01/12] mtd: nand: davinci: store the core chipselect number in platform data
In reply to Bartosz GolaszewskiQuoted 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_deviceas 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 theplatform_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
Signed-off-by Bartosz Golaszewski <[email protected]>
Thanks,
Sekhar
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_deviceas 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 theplatform_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_chipselmeans. 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
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_deviceas 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 dataRaw 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
Re: [PATCH 01/12] mtd: nand: davinci: store the core chipselect number in platform data
In reply to Sekhar NoriQuoted 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_deviceas 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 theplatform_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_chipselmeans. 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
@@ -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;
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_deviceas 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 dataRaw 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
Re: [PATCH 01/12] mtd: nand: davinci: store the core chipselect number in platform data
In reply to Sekhar NoriQuoted 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_deviceas 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 theplatform_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_chipselmeans. 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<--
commit533d93703fa717fdf74c4fb711c868c4fdc8b475(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 +0530mtd: 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
Boris Brezillon
Acked-byQuoted 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_deviceas 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
Re: [PATCH 01/12] mtd: nand: davinci: store the core chipselect number in platform data
In reply to Sekhar Nori2018-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_deviceas 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 theplatform_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_chipselmeans. 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<--
commit533d93703fa717fdf74c4fb711c868c4fdc8b475(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 +0530mtd: 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_deviceas 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 theplatform_data. Subsequent patches will convert the platforms to using this new field.Signed-off-by Bartosz Golaszewski <[email protected]>Signed-off-by Sekhar Nori <[email protected]>include/linux/platform_data/mtd-davinci.h +0
-0@@ -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
-0uint32_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
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_deviceas 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 theplatform_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_chipselmeans. 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<--
commit533d93703fa717fdf74c4fb711c868c4fdc8b475(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 +0530mtd: 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_deviceas 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 theplatform_data. Subsequent patches will convert the platforms to using this new field.Signed-off-by Bartosz Golaszewski <[email protected]>Signed-off-by Sekhar Nori <[email protected]>include/linux/platform_data/mtd-davinci.h +0
-0@@ -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
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_deviceas 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 dataRaw 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 ofgit://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci.git
(commit 7c4db57cdb00)
Thanks,
Sekhar