ARM: davinci: remove the mach-specific aemif driver - part 1
Subsystems (7)
cover ARM: davinci: remove the mach-specific aemif driver - part 1
From: Bartosz Golaszewski <[email protected]>
Hi Sekhar,
while waiting for David's updated series I prepared the first part of changes required to remove duplicate aemif support from mach-davinci.
I actually noticed that one of my previous changes from 2017 broke nand in legacy mode - the clock lookup no longer works. This series addresses it as well.
The first two patches fix the issue introduced in commit d8e22fb4ccac ("ARM: da850: add the nand dev_id to the clock lookup table").
Next two add support for board files to the aemif driver.
Last two add nand support to da850-lcdk in legacy mode and make da850-evm use the platform driver instead of the mach-specific one.
If this series gets accepted, I'll prepere a follow-up moving all other boards to the new platform driver.
Bartosz Golaszewski (6):
nand: davinci: rename the platform driver
ARM: davinci: update the nand driver names
memory: aemif: don't rely on kbuild for driver's name
memory: aemif: add support for board files
ARM: davinci: add aemif & nand support to da850-lcdk in legacy mode
ARM: davinci: use aemif platform driver in legacy mode for da850-evm
arch/arm/mach-davinci/board-da830-evm.c | 2 +- arch/arm/mach-davinci/board-da850-evm.c | 93 +++++++++++--------- arch/arm/mach-davinci/board-dm355-evm.c | 2 +- arch/arm/mach-davinci/board-dm355-leopard.c | 2 +- arch/arm/mach-davinci/board-dm365-evm.c | 2 +- arch/arm/mach-davinci/board-dm644x-evm.c | 2 +- arch/arm/mach-davinci/board-dm646x-evm.c | 2 +- arch/arm/mach-davinci/board-mityomapl138.c | 2 +- arch/arm/mach-davinci/board-neuros-osd2.c | 2 +- arch/arm/mach-davinci/board-omapl138-hawk.c | 132 ++++++++++++++++++++++++++++ arch/arm/mach-davinci/board-sffsdr.c | 2 +- drivers/memory/ti-aemif.c | 59 ++++++++----- drivers/mtd/nand/davinci_nand.c | 2 +- include/linux/platform_data/ti-aemif.h | 9 ++ 14 files changed, 240 insertions(+), 73 deletions(-)
Signature · 1 line
2.16.1
PATCH 1/6 nand: davinci: rename the platform driver
From: Bartosz Golaszewski <[email protected]>
Commit d8e22fb4ccac ("ARM: da850: add the nand dev_id to the clock lookup table") broke the nand support in board file mode for da850-based boards. Instead of reverting it and breaking the DT users in the process (due to clock lookup), rename the driver to match the clock table before renaming the users.
--- drivers/mtd/nand/davinci_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/davinci_nand.c +1 -1
@@ -865,7 +865,7 @@ static struct platform_driver nand_davinci_driver = { .probe = nand_davinci_probe, .remove = nand_davinci_remove, .driver = { - .name = "davinci_nand", + .name = "davinci-nand", .of_match_table = of_match_ptr(davinci_nand_of_match), }, };
Signature · 1 line
2.16.1
Re: [PATCH 1/6] nand: davinci: rename the platform driver
Hi Bartosz
Prefix should be "mtd: nand: davinci:"
Quoted 9 lines · On Fri, 16 Feb 2018 17:47:07 +0100 Bartosz Golaszewski <[email protected]> wrote:
From: Bartosz Golaszewski <[email protected]>
Commit
d8e22fb4ccac("ARM: da850: add the nanddev_idto the clock lookup table") broke the nand support in board file mode for da850-based boards. Instead of reverting it and breaking the DT users in the process (due to clock lookup), rename the driver to match the clock table before renaming the users.Fixes d8e22fb4ccac ("ARM: da850: add the nand dev_id to the clock lookup table")
You probably want Cc: <[email protected]> here.
Quoted 10 lines
Signed-off-by Bartosz Golaszewski <[email protected]>--- drivers/mtd/nand/davinci_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mtd/nand/davinci_nand.c +0
-0
drivers/mtd/nand/davinci_nand.c static struct platform_driver nand_davinci_driver = { · line 868
Quoted 5 lines
drivers/mtd/nand/davinci_nand.c +1
-1@@ -865,7 +865,7 @@ static struct platform_driver nand_davinci_driver = { .probe = nand_davinci_probe, .remove = nand_davinci_remove, .driver = { - .name = "davinci_nand", + .name = "davinci-nand",
And by doing that you're breaking C board files which are using the name with an underscore.
drivers/mtd/nand/davinci_nand.c static struct platform_driver nand_davinci_driver = { · line 871
Quoted 3 lines
drivers/mtd/nand/davinci_nand.c +0
-0.of_match_table = of_match_ptr(davinci_nand_of_match), }, };
Regards,
Boris
Signature · 3 lines
Boris Brezillon, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com
Re: [PATCH 1/6] nand: davinci: rename the platform driver
In reply to Bartosz GolaszewskiQuoted 19 lines · On Fri, 16 Feb 2018 17:47:07 +0100 Bartosz Golaszewski <[email protected]> wrote:
From: Bartosz Golaszewski <[email protected]>
Commit
d8e22fb4ccac("ARM: da850: add the nanddev_idto the clock lookup table") broke the nand support in board file mode for da850-based boards. Instead of reverting it and breaking the DT users in the process (due to clock lookup), rename the driver to match the clock table before renaming the users.Fixes d8e22fb4ccac ("ARM: da850: add the nand dev_id to the clock lookup table")Signed-off-by Bartosz Golaszewski <[email protected]>--- drivers/mtd/nand/davinci_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mtd/nand/davinci_nand.c +0
-0
drivers/mtd/nand/davinci_nand.c static struct platform_driver nand_davinci_driver = { · line 868
Quoted 5 lines
drivers/mtd/nand/davinci_nand.c +1
-1@@ -865,7 +865,7 @@ static struct platform_driver nand_davinci_driver = { .probe = nand_davinci_probe, .remove = nand_davinci_remove, .driver = { - .name = "davinci_nand", + .name = "davinci-nand",
Another side-effect of this change you should be aware of: by doing that you also break all users that were defining partitions through the cmdline using mtdparts=davinci_nand.0:<part-layout>.
Not sure this is a good idea ;-).
Quoted 3 lines
drivers/mtd/nand/davinci_nand.c +0
-0.of_match_table = of_match_ptr(davinci_nand_of_match), }, };
Signature · 3 lines
Boris Brezillon, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com
Re: [PATCH 1/6] nand: davinci: rename the platform driver
Quoted 32 lines · Boris Brezillon
Quoted 19 lines · On Fri, 16 Feb 2018 17:47:07 +0100 Bartosz Golaszewski <[email protected]> wrote:
From: Bartosz Golaszewski <[email protected]>
Commit
d8e22fb4ccac("ARM: da850: add the nanddev_idto the clock lookup table") broke the nand support in board file mode for da850-based boards. Instead of reverting it and breaking the DT users in the process (due to clock lookup), rename the driver to match the clock table before renaming the users.Fixes d8e22fb4ccac ("ARM: da850: add the nand dev_id to the clock lookup table")Signed-off-by Bartosz Golaszewski <[email protected]>--- drivers/mtd/nand/davinci_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mtd/nand/davinci_nand.c +0
-0drivers/mtd/nand/davinci_nand.c static struct platform_driver nand_davinci_driver = { · line 868
Quoted 5 lines
drivers/mtd/nand/davinci_nand.c +1
-1@@ -865,7 +865,7 @@ static struct platform_driver nand_davinci_driver = { .probe = nand_davinci_probe, .remove = nand_davinci_remove, .driver = { - .name = "davinci_nand", + .name = "davinci-nand",Another side-effect of this change you should be aware of: by doing that you also break all users that were defining partitions through the cmdline using mtdparts=davinci_nand.0:<part-layout>.
Quoted 1 line
Not sure this is a good idea ;-).
Also, once we move to the common clock framework, the AUXDATA that causes the DT clock lookup breakage you are trying to avoid will go away, so that won't be a reason for changing this either.
Re: [PATCH 1/6] nand: davinci: rename the platform driver
2018-02-16 20:22 GMT+01:00 David Lechner <[email protected]>:
Quoted 37 lines · Boris Brezillon
Quoted 36 lines
Quoted 21 lines · On Fri, 16 Feb 2018 17:47:07 +0100 Bartosz Golaszewski <[email protected]> wrote:
From: Bartosz Golaszewski <[email protected]>
Commit
d8e22fb4ccac("ARM: da850: add the nanddev_idto the clock lookup table") broke the nand support in board file mode for da850-based boards. Instead of reverting it and breaking the DT users in the process (due to clock lookup), rename the driver to match the clock table before renaming the users.Fixes d8e22fb4ccac ("ARM: da850: add the nand dev_id to the clock lookuptable")
Signed-off-by Bartosz Golaszewski <[email protected]>--- drivers/mtd/nand/davinci_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mtd/nand/davinci_nand.c +0
-0drivers/mtd/nand/davinci_nand.c static struct platform_driver nand_davinci_driver = { · line 868
Quoted 5 lines
drivers/mtd/nand/davinci_nand.c +1
-1@@ -865,7 +865,7 @@ static struct platform_driver nand_davinci_driver = { .probe = nand_davinci_probe, .remove = nand_davinci_remove, .driver = { - .name = "davinci_nand", + .name = "davinci-nand",Another side-effect of this change you should be aware of: by doing that you also break all users that were defining partitions through the cmdline using mtdparts=davinci_nand.0:<part-layout>.
Quoted 8 lines
Quoted 1 line
Not sure this is a good idea ;-).
Also, once we move to the common clock framework, the AUXDATA that causes the DT clock lookup breakage you are trying to avoid will go away, so that won't be a reason for changing this either.
Ok, let's wait for v7 of your series then and reiterate this one.
Best regards,
Bartosz Golaszewski
PATCH 2/6 ARM: davinci: update the nand driver names
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
Since commit d8e22fb4ccac ("ARM: da850: add the nand dev_id to the clock lookup table") we can no longer correctly lookup the nand clock when booting in legacy mode. Said commit added a dev_id to the nand clock which must match and it doesn't correspond with the device name which is "davinci_nand" instead of "davinci-nand".
The driver name has been changed. Update the board files.
--- arch/arm/mach-davinci/board-da830-evm.c | 2 +- arch/arm/mach-davinci/board-da850-evm.c | 2 +- arch/arm/mach-davinci/board-dm355-evm.c | 2 +- arch/arm/mach-davinci/board-dm355-leopard.c | 2 +- arch/arm/mach-davinci/board-dm365-evm.c | 2 +- arch/arm/mach-davinci/board-dm644x-evm.c | 2 +- arch/arm/mach-davinci/board-dm646x-evm.c | 2 +- arch/arm/mach-davinci/board-mityomapl138.c | 2 +- arch/arm/mach-davinci/board-neuros-osd2.c | 2 +- arch/arm/mach-davinci/board-sffsdr.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-)
arch/arm/mach-davinci/board-da830-evm.c +1 -1
@@ -348,7 +348,7 @@ static struct resource da830_evm_nand_resources[] = { };static struct platform_device da830_evm_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =1 , .dev = { .platform_data = &da830_evm_nand_pdata,
arch/arm/mach-davinci/board-da850-evm.c +1 -1
@@ -266,7 +266,7 @@ static struct resource da850_evm_nandflash_resource[] = { };static struct platform_device da850_evm_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =1 , .dev = { .platform_data = &da850_evm_nandflash_data,
arch/arm/mach-davinci/board-dm355-evm.c +1 -1
@@ -98,7 +98,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources),
arch/arm/mach-davinci/board-dm355-leopard.c +1 -1
@@ -93,7 +93,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources),
arch/arm/mach-davinci/board-dm365-evm.c +1 -1
@@ -159,7 +159,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources), .resource = davinci_nand_resources,
arch/arm/mach-davinci/board-dm644x-evm.c +1 -1
@@ -173,7 +173,7 @@ static struct resource davinci_evm_nandflash_resource[] = { };static struct platform_device davinci_evm_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .dev = { .platform_data = &davinci_evm_nandflash_data,
arch/arm/mach-davinci/board-dm646x-evm.c +1 -1
@@ -108,7 +108,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources),
arch/arm/mach-davinci/board-mityomapl138.c +1 -1
@@ -422,7 +422,7 @@ static struct resource mityomapl138_nandflash_resource[] = { };static struct platform_device mityomapl138_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =1 , .dev = { .platform_data = &mityomapl138_nandflash_data,
arch/arm/mach-davinci/board-neuros-osd2.c +1 -1
@@ -107,7 +107,7 @@ static struct resource davinci_ntosd2_nandflash_resource[] = { };static struct platform_device davinci_ntosd2_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .dev = { .platform_data = &davinci_ntosd2_nandflash_data,
arch/arm/mach-davinci/board-sffsdr.c +1 -1
@@ -83,7 +83,7 @@ static struct resource davinci_sffsdr_nandflash_resource[] = { };static struct platform_device davinci_sffsdr_nandflash_device = { - .name ="davinci_nand" ,/* Name of driver */ + .name ="davinci-nand" ,/* Name of driver */ .id =0 , .dev = { .platform_data = &davinci_sffsdr_nandflash_data,
Signature · 1 line
2.16.1
Re: [PATCH 2/6] ARM: davinci: update the nand driver names
Quoted 9 lines · On Fri, 16 Feb 2018 17:47:08 +0100 Bartosz Golaszewski <[email protected]> wrote:
From: Bartosz Golaszewski <[email protected]>
Since commit
d8e22fb4ccac("ARM: da850: add the nanddev_idto the clock lookup table") we can no longer correctly lookup the nand clock when booting in legacy mode. Said commit added adev_idto the nand clock which must match and it doesn't correspond with the device name which is "davinci_nand" instead of "davinci-nand".The driver name has been changed. Update the board files.
Should be squashed in patch 1, otherwise your patch series is not bisectable.
Quoted 146 lines
Fixes d8e22fb4ccac ("ARM: da850: add the nand dev_id to the clock lookup table")Signed-off-by Bartosz Golaszewski <[email protected]>--- arch/arm/mach-davinci/board-da830-evm.c | 2 +- arch/arm/mach-davinci/board-da850-evm.c | 2 +- arch/arm/mach-davinci/board-dm355-evm.c | 2 +- arch/arm/mach-davinci/board-dm355-leopard.c | 2 +- arch/arm/mach-davinci/board-dm365-evm.c | 2 +- arch/arm/mach-davinci/board-dm644x-evm.c | 2 +- arch/arm/mach-davinci/board-dm646x-evm.c | 2 +- arch/arm/mach-davinci/board-mityomapl138.c | 2 +- arch/arm/mach-davinci/board-neuros-osd2.c | 2 +- arch/arm/mach-davinci/board-sffsdr.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-)arch/arm/mach-davinci/board-da830-evm.c +1
-1@@ -348,7 +348,7 @@ static struct resource da830_evm_nand_resources[] = { };static struct platform_device da830_evm_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =1 , .dev = { .platform_data = &da830_evm_nand_pdata,arch/arm/mach-davinci/board-da850-evm.c +1
-1@@ -266,7 +266,7 @@ static struct resource da850_evm_nandflash_resource[] = { };static struct platform_device da850_evm_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =1 , .dev = { .platform_data = &da850_evm_nandflash_data,arch/arm/mach-davinci/board-dm355-evm.c +1
-1@@ -98,7 +98,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources),arch/arm/mach-davinci/board-dm355-leopard.c +1
-1@@ -93,7 +93,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources),arch/arm/mach-davinci/board-dm365-evm.c +1
-1@@ -159,7 +159,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources), .resource = davinci_nand_resources,arch/arm/mach-davinci/board-dm644x-evm.c +1
-1@@ -173,7 +173,7 @@ static struct resource davinci_evm_nandflash_resource[] = { };static struct platform_device davinci_evm_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .dev = { .platform_data = &davinci_evm_nandflash_data,arch/arm/mach-davinci/board-dm646x-evm.c +1
-1@@ -108,7 +108,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources),arch/arm/mach-davinci/board-mityomapl138.c +1
-1@@ -422,7 +422,7 @@ static struct resource mityomapl138_nandflash_resource[] = { };static struct platform_device mityomapl138_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =1 , .dev = { .platform_data = &mityomapl138_nandflash_data,arch/arm/mach-davinci/board-neuros-osd2.c +1
-1@@ -107,7 +107,7 @@ static struct resource davinci_ntosd2_nandflash_resource[] = { };static struct platform_device davinci_ntosd2_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .dev = { .platform_data = &davinci_ntosd2_nandflash_data,arch/arm/mach-davinci/board-sffsdr.c +1
-1@@ -83,7 +83,7 @@ static struct resource davinci_sffsdr_nandflash_resource[] = { };static struct platform_device davinci_sffsdr_nandflash_device = { - .name ="davinci_nand" ,/* Name of driver */ + .name ="davinci-nand" ,/* Name of driver */ .id =0 , .dev = { .platform_data = &davinci_sffsdr_nandflash_data,
Signature · 3 lines
Boris Brezillon, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com
Re: [PATCH 2/6] ARM: davinci: update the nand driver names
Quoted 11 lines · On Fri, 16 Feb 2018 19:33:07 +0100 Boris Brezillon…
Quoted 8 lines · On Fri, 16 Feb 2018 17:47:08 +0100 Bartosz Golaszewski <[email protected]> wrote:
From: Bartosz Golaszewski <[email protected]>
Since commit
d8e22fb4ccac("ARM: da850: add the nanddev_idto the clock lookup table") we can no longer correctly lookup the nand clock when booting in legacy mode. Said commit added adev_idto the nand clock which must match and it doesn't correspond with the device name which is "davinci_nand" instead of "davinci-nand".
Quoted 5 lines
Quoted 1 line
The driver name has been changed. Update the board files.
Should be squashed in patch 1, otherwise your patch series is not bisectable.
Okay, after reading the commit message a second time it seems bisectability is already broken anyway :-).
Quoted 149 lines
Quoted 146 lines
Fixes d8e22fb4ccac ("ARM: da850: add the nand dev_id to the clock lookup table")Signed-off-by Bartosz Golaszewski <[email protected]>--- arch/arm/mach-davinci/board-da830-evm.c | 2 +- arch/arm/mach-davinci/board-da850-evm.c | 2 +- arch/arm/mach-davinci/board-dm355-evm.c | 2 +- arch/arm/mach-davinci/board-dm355-leopard.c | 2 +- arch/arm/mach-davinci/board-dm365-evm.c | 2 +- arch/arm/mach-davinci/board-dm644x-evm.c | 2 +- arch/arm/mach-davinci/board-dm646x-evm.c | 2 +- arch/arm/mach-davinci/board-mityomapl138.c | 2 +- arch/arm/mach-davinci/board-neuros-osd2.c | 2 +- arch/arm/mach-davinci/board-sffsdr.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-)arch/arm/mach-davinci/board-da830-evm.c +1
-1@@ -348,7 +348,7 @@ static struct resource da830_evm_nand_resources[] = { };static struct platform_device da830_evm_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =1 , .dev = { .platform_data = &da830_evm_nand_pdata,arch/arm/mach-davinci/board-da850-evm.c +1
-1@@ -266,7 +266,7 @@ static struct resource da850_evm_nandflash_resource[] = { };static struct platform_device da850_evm_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =1 , .dev = { .platform_data = &da850_evm_nandflash_data,arch/arm/mach-davinci/board-dm355-evm.c +1
-1@@ -98,7 +98,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources),arch/arm/mach-davinci/board-dm355-leopard.c +1
-1@@ -93,7 +93,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources),arch/arm/mach-davinci/board-dm365-evm.c +1
-1@@ -159,7 +159,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources), .resource = davinci_nand_resources,arch/arm/mach-davinci/board-dm644x-evm.c +1
-1@@ -173,7 +173,7 @@ static struct resource davinci_evm_nandflash_resource[] = { };static struct platform_device davinci_evm_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .dev = { .platform_data = &davinci_evm_nandflash_data,arch/arm/mach-davinci/board-dm646x-evm.c +1
-1@@ -108,7 +108,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources),arch/arm/mach-davinci/board-mityomapl138.c +1
-1@@ -422,7 +422,7 @@ static struct resource mityomapl138_nandflash_resource[] = { };static struct platform_device mityomapl138_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =1 , .dev = { .platform_data = &mityomapl138_nandflash_data,arch/arm/mach-davinci/board-neuros-osd2.c +1
-1@@ -107,7 +107,7 @@ static struct resource davinci_ntosd2_nandflash_resource[] = { };static struct platform_device davinci_ntosd2_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .dev = { .platform_data = &davinci_ntosd2_nandflash_data,arch/arm/mach-davinci/board-sffsdr.c +1
-1@@ -83,7 +83,7 @@ static struct resource davinci_sffsdr_nandflash_resource[] = { };static struct platform_device davinci_sffsdr_nandflash_device = { - .name ="davinci_nand" ,/* Name of driver */ + .name ="davinci-nand" ,/* Name of driver */ .id =0 , .dev = { .platform_data = &davinci_sffsdr_nandflash_data,
Signature · 3 lines
Boris Brezillon, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com
Re: [PATCH 2/6] ARM: davinci: update the nand driver names
In reply to Bartosz GolaszewskiQuoted 43 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Since commit
d8e22fb4ccac("ARM: da850: add the nanddev_idto the clock lookup table") we can no longer correctly lookup the nand clock when booting in legacy mode. Said commit added adev_idto the nand clock which must match and it doesn't correspond with the device name which is "davinci_nand" instead of "davinci-nand".The driver name has been changed. Update the board files.
Fixes d8e22fb4ccac ("ARM: da850: add the nand dev_id to the clock lookup table")Signed-off-by Bartosz Golaszewski <[email protected]>--- arch/arm/mach-davinci/board-da830-evm.c | 2 +- arch/arm/mach-davinci/board-da850-evm.c | 2 +- arch/arm/mach-davinci/board-dm355-evm.c | 2 +- arch/arm/mach-davinci/board-dm355-leopard.c | 2 +- arch/arm/mach-davinci/board-dm365-evm.c | 2 +- arch/arm/mach-davinci/board-dm644x-evm.c | 2 +- arch/arm/mach-davinci/board-dm646x-evm.c | 2 +- arch/arm/mach-davinci/board-mityomapl138.c | 2 +- arch/arm/mach-davinci/board-neuros-osd2.c | 2 +- arch/arm/mach-davinci/board-sffsdr.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-)arch/arm/mach-davinci/board-da830-evm.c +1
-1@@ -348,7 +348,7 @@ static struct resource da830_evm_nand_resources[] = { };static struct platform_device da830_evm_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =1 , .dev = { .platform_data = &da830_evm_nand_pdata,arch/arm/mach-davinci/board-da850-evm.c +0
-0
arch/arm/mach-davinci/board-da850-evm.c static struct resource da850_evm_nandflash_resource[] = { · line 270
Quoted 6 lines
arch/arm/mach-davinci/board-da850-evm.c +1
-1@@ -266,7 +266,7 @@ static struct resource da850_evm_nandflash_resource[] = { };static struct platform_device da850_evm_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =1 ,
The clock lookup uses id == 0 ("davinci-nand.0"), so this is probably still broken unless you also change the id.
Quoted 72 lines
arch/arm/mach-davinci/board-da850-evm.c +0
-0.dev = { .platform_data = &da850_evm_nandflash_data,arch/arm/mach-davinci/board-dm355-evm.c +1
-1@@ -98,7 +98,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources),arch/arm/mach-davinci/board-dm355-leopard.c +1
-1@@ -93,7 +93,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources),arch/arm/mach-davinci/board-dm365-evm.c +1
-1@@ -159,7 +159,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources), .resource = davinci_nand_resources,arch/arm/mach-davinci/board-dm644x-evm.c +1
-1@@ -173,7 +173,7 @@ static struct resource davinci_evm_nandflash_resource[] = { };static struct platform_device davinci_evm_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .dev = { .platform_data = &davinci_evm_nandflash_data,arch/arm/mach-davinci/board-dm646x-evm.c +1
-1@@ -108,7 +108,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources),arch/arm/mach-davinci/board-mityomapl138.c +0
-0
arch/arm/mach-davinci/board-mityomapl138.c static struct resource mityomapl138_nandflash_resource[] = { · line 426
Quoted 6 lines
arch/arm/mach-davinci/board-mityomapl138.c +1
-1@@ -422,7 +422,7 @@ static struct resource mityomapl138_nandflash_resource[] = { };static struct platform_device mityomapl138_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =1 ,
Same here, id probably needs to be 0.
Quoted 21 lines
arch/arm/mach-davinci/board-mityomapl138.c +0
-0.dev = { .platform_data = &mityomapl138_nandflash_data,arch/arm/mach-davinci/board-neuros-osd2.c +1
-1@@ -107,7 +107,7 @@ static struct resource davinci_ntosd2_nandflash_resource[] = { };static struct platform_device davinci_ntosd2_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .dev = { .platform_data = &davinci_ntosd2_nandflash_data,arch/arm/mach-davinci/board-sffsdr.c +0
-0
arch/arm/mach-davinci/board-sffsdr.c static struct resource davinci_sffsdr_nandflash_resource[] = { · line 89
Quoted 8 lines
arch/arm/mach-davinci/board-sffsdr.c +1
-1@@ -83,7 +83,7 @@ static struct resource davinci_sffsdr_nandflash_resource[] = { };static struct platform_device davinci_sffsdr_nandflash_device = { - .name ="davinci_nand" ,/* Name of driver */ + .name ="davinci-nand" ,/* Name of driver */ .id =0 , .dev = { .platform_data = &davinci_sffsdr_nandflash_data,
Getting out of scope of this patch, but...
If there is only one nand device per board, then the id should probably be -1 instead of 0 for all of these boards.
Re: [PATCH 2/6] ARM: davinci: update the nand driver names
Quoted 168 lines · On Fri, 16 Feb 2018 13:14:14 -0600 David Lechner <[email protected]> wrote:
Quoted 43 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Since commit
d8e22fb4ccac("ARM: da850: add the nanddev_idto the clock lookup table") we can no longer correctly lookup the nand clock when booting in legacy mode. Said commit added adev_idto the nand clock which must match and it doesn't correspond with the device name which is "davinci_nand" instead of "davinci-nand".The driver name has been changed. Update the board files.
Fixes d8e22fb4ccac ("ARM: da850: add the nand dev_id to the clock lookup table")Signed-off-by Bartosz Golaszewski <[email protected]>--- arch/arm/mach-davinci/board-da830-evm.c | 2 +- arch/arm/mach-davinci/board-da850-evm.c | 2 +- arch/arm/mach-davinci/board-dm355-evm.c | 2 +- arch/arm/mach-davinci/board-dm355-leopard.c | 2 +- arch/arm/mach-davinci/board-dm365-evm.c | 2 +- arch/arm/mach-davinci/board-dm644x-evm.c | 2 +- arch/arm/mach-davinci/board-dm646x-evm.c | 2 +- arch/arm/mach-davinci/board-mityomapl138.c | 2 +- arch/arm/mach-davinci/board-neuros-osd2.c | 2 +- arch/arm/mach-davinci/board-sffsdr.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-)arch/arm/mach-davinci/board-da830-evm.c +1
-1@@ -348,7 +348,7 @@ static struct resource da830_evm_nand_resources[] = { };static struct platform_device da830_evm_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =1 , .dev = { .platform_data = &da830_evm_nand_pdata,arch/arm/mach-davinci/board-da850-evm.c +0
-0arch/arm/mach-davinci/board-da850-evm.c static struct resource da850_evm_nandflash_resource[] = { · line 270
Quoted 6 lines
arch/arm/mach-davinci/board-da850-evm.c +1
-1@@ -266,7 +266,7 @@ static struct resource da850_evm_nandflash_resource[] = { };static struct platform_device da850_evm_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =1 ,The clock lookup uses id == 0 ("davinci-nand.0"), so this is probably still broken unless you also change the id.
Quoted 72 lines
arch/arm/mach-davinci/board-da850-evm.c +0
-0.dev = { .platform_data = &da850_evm_nandflash_data,arch/arm/mach-davinci/board-dm355-evm.c +1
-1@@ -98,7 +98,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources),arch/arm/mach-davinci/board-dm355-leopard.c +1
-1@@ -93,7 +93,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources),arch/arm/mach-davinci/board-dm365-evm.c +1
-1@@ -159,7 +159,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources), .resource = davinci_nand_resources,arch/arm/mach-davinci/board-dm644x-evm.c +1
-1@@ -173,7 +173,7 @@ static struct resource davinci_evm_nandflash_resource[] = { };static struct platform_device davinci_evm_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .dev = { .platform_data = &davinci_evm_nandflash_data,arch/arm/mach-davinci/board-dm646x-evm.c +1
-1@@ -108,7 +108,7 @@ static struct resource davinci_nand_resources[] = { };static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .num_resources =ARRAY_SIZE (davinci_nand_resources),arch/arm/mach-davinci/board-mityomapl138.c +0
-0arch/arm/mach-davinci/board-mityomapl138.c static struct resource mityomapl138_nandflash_resource[] = { · line 426
Quoted 6 lines
arch/arm/mach-davinci/board-mityomapl138.c +1
-1@@ -422,7 +422,7 @@ static struct resource mityomapl138_nandflash_resource[] = { };static struct platform_device mityomapl138_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =1 ,Same here, id probably needs to be 0.
Quoted 21 lines
arch/arm/mach-davinci/board-mityomapl138.c +0
-0.dev = { .platform_data = &mityomapl138_nandflash_data,arch/arm/mach-davinci/board-neuros-osd2.c +1
-1@@ -107,7 +107,7 @@ static struct resource davinci_ntosd2_nandflash_resource[] = { };static struct platform_device davinci_ntosd2_nandflash_device = { - .name ="davinci_nand" , + .name ="davinci-nand" , .id =0 , .dev = { .platform_data = &davinci_ntosd2_nandflash_data,arch/arm/mach-davinci/board-sffsdr.c +0
-0arch/arm/mach-davinci/board-sffsdr.c static struct resource davinci_sffsdr_nandflash_resource[] = { · line 89
Quoted 8 lines
arch/arm/mach-davinci/board-sffsdr.c +1
-1@@ -83,7 +83,7 @@ static struct resource davinci_sffsdr_nandflash_resource[] = { };static struct platform_device davinci_sffsdr_nandflash_device = { - .name ="davinci_nand" ,/* Name of driver */ + .name ="davinci-nand" ,/* Name of driver */ .id =0 , .dev = { .platform_data = &davinci_sffsdr_nandflash_data,Getting out of scope of this patch, but...
Quoted 3 lines
If there is only one nand device per board, then the id should probably be -1 instead of 0 for all of these boards.
Note that doing that is also breaking mtdparts users, because the mtdparts definition expected by the kernel would become mtdparts=davinci-nand:<part-layout> instead of mtdparts=davinci_nand.0:<part-layout>.
Signature · 3 lines
Boris Brezillon, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com
PATCH 3/6 memory: aemif: don't rely on kbuild for driver's name
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
We want to use aemif from board files. Use a static name in the driver's code.
--- drivers/memory/ti-aemif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/memory/ti-aemif.c +1 -1
@@ -422,7 +422,7 @@ static struct platform_driver aemif_driver = { .probe = aemif_probe, .remove = aemif_remove, .driver = { - .name = KBUILD_MODNAME, + .name = "ti-aemif", .of_match_table = of_match_ptr(aemif_of_match), }, };
Signature · 1 line
2.16.1
PATCH 4/6 memory: aemif: add support for board files
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
Currently aemif is supported in two places separately. By the platform driver in drivers/memory and by a hand crafted driver in mach-davinci.
We want to drop the latter but also keep the legacy mode. Add support for board files to the aemif driver.
The new structure in platform data currently only contains the chip select number, since currently existing users don't require anything else, but it can be extended in the future.
--- drivers/memory/ti-aemif.c | 57 ++++++++++++++++++++++------------ include/linux/platform_data/ti-aemif.h | 9 ++++++ 2 files changed, 46 insertions(+), 20 deletions(-)
drivers/memory/ti-aemif.c +37 -20
@@ -339,9 +339,6 @@ static int aemif_probe(struct platform_device *pdev)struct aemif_platform_data *pdata;struct of_dev_auxdata *dev_lookup; -if (np ==NULL ) -return 0 ; - aemif =devm_kzalloc (dev,sizeof (*aemif),GFP_KERNEL );if (!aemif)return -ENOMEM ;
@@ -363,8 +360,10 @@ static int aemif_probe(struct platform_device *pdev) aemif->clk_rate =clk_get_rate (aemif->clk) /MSEC_PER_SEC ; -if (of_device_is_compatible (np,"ti,da850-aemif" )) +if (np &&of_device_is_compatible (np,"ti,da850-aemif" )) aemif->cs_offset =2 ; +else if (pdata) + aemif->cs_offset = pdata->cs_offset; res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); aemif->base =devm_ioremap_resource (dev, res);
@@ -373,15 +372,23 @@ static int aemif_probe(struct platform_device *pdev) goto error; } -/* -* For every controller device node, there is a cs device node that -* describe the bus configuration parameters. This functions iterate -* over these nodes and update the cs data array. -*/ -for_each_available_child_of_node (np, child_np) { - ret =of_aemif_parse_abus_config (pdev, child_np); -if (ret <0 ) - goto error; +if (np) { +/* +* For every controller device node, there is a cs device node +* that describe the bus configuration parameters. This +* functions iterate over these nodes and update the cs data +* array. +*/ +for_each_available_child_of_node (np, child_np) { + ret =of_aemif_parse_abus_config (pdev, child_np); +if (ret <0 ) + goto error; + } + }else if (pdata && pdata->num_abus_data >0 ) { +for (i =0 ; i < pdata->num_abus_data; i++, aemif->num_cs++) { + aemif->cs_data[i].cs = pdata->abus_data->cs; +aemif_get_hw_params (pdev, i); + } }for (i =0 ; i < aemif->num_cs; i++) {
@@ -394,14 +401,24 @@ static int aemif_probe(struct platform_device *pdev) }/* -* Create a child devices explicitly from here to -* guarantee that the child will be probed after the AEMIF timing -* parameters are set. +* Create a child devices explicitly from here to guarantee that the +* child will be probed after the AEMIF timing parameters are set. */ -for_each_available_child_of_node (np, child_np) { - ret =of_platform_populate (child_np,NULL , dev_lookup, dev); -if (ret <0 ) - goto error; +if (np) { +for_each_available_child_of_node (np, child_np) { + ret =of_platform_populate (child_np,NULL , + dev_lookup, dev); +if (ret <0 ) + goto error; + } + }else { +for (i =0 ; i < pdata->num_sub_devices; i++) { + ret =platform_device_register (&pdata->sub_devices[i]); +if (ret) { +dev_warn (dev,"Error register sub device %s\n" , + pdata->sub_devices[i].name); + } + } }return 0 ;
include/linux/platform_data/ti-aemif.h +9 -0
@@ -16,8 +16,17 @@#include <linux/of_platform.h> +struct aemif_abus_data { +u32 cs; +}; +struct aemif_platform_data {struct of_dev_auxdata *dev_lookup; +u32 cs_offset; +struct aemif_abus_data *abus_data; +size_t num_abus_data; +struct platform_device *sub_devices; +size_t num_sub_devices; };#endif /* __TI_DAVINCI_AEMIF_DATA_H__ */
Signature · 1 line
2.16.1
PATCH 5/6 ARM: davinci: add aemif & nand support to da850-lcdk in legacy mode
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
We now have support for aemif & nand from board files. As an example add support for nand to da850-lcdk in legacy mode.
--- arch/arm/mach-davinci/board-omapl138-hawk.c | 132 ++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+)
arch/arm/mach-davinci/board-omapl138-hawk.c +132 -0
@@ -16,6 +16,11 @@#include <linux/gpio.h> #include <linux/gpio/machine.h> #include <linux/platform_data/gpio-davinci.h> +#include <linux/platform_data/ti-aemif.h> +#include <linux/mtd/rawnand.h> +#include <linux/mtd/partitions.h> +#include <linux/platform_data/mtd-davinci.h> +#include <linux/platform_data/mtd-davinci-aemif.h> #include <linux/regulator/machine.h> #include <asm/mach-types.h>
@@ -162,6 +167,129 @@ static __init void omapl138_hawk_mmc_init(void)gpiod_remove_lookup_table (&mmc_gpios_table); } +static struct mtd_partition omapl138_hawk_nandflash_partition[] = { + { + .name ="u-boot env" , + .offset =0 , + .size =SZ_128K , + .mask_flags =MTD_WRITEABLE , + }, + { + .name ="u-boot" , + .offset =MTDPART_OFS_APPEND , + .size =SZ_128K , + .mask_flags =MTD_WRITEABLE , + }, + { + .name ="free space" , + .offset =MTDPART_OFS_APPEND , + .size =MTDPART_SIZ_FULL , + .mask_flags =0 , + }, +}; + +static struct davinci_aemif_timing omapl138_hawk_nandflash_timing = { + .wsetup =24 , + .wstrobe =21 , + .whold =14 , + .rsetup =19 , + .rstrobe =50 , + .rhold =0 , + .ta =20 , +}; + +static struct davinci_nand_pdata omapl138_hawk_nandflash_data = { + .parts = omapl138_hawk_nandflash_partition, + .nr_parts =ARRAY_SIZE (omapl138_hawk_nandflash_partition), + .ecc_mode =NAND_ECC_HW , + .ecc_bits =4 , + .bbt_options =NAND_BBT_USE_FLASH , + .options =NAND_BUSWIDTH_16 , + .timing = &omapl138_hawk_nandflash_timing, + .mask_chipsel =0 , + .mask_ale =0 , + .mask_cle =0 , +}; + +static struct resource omapl138_hawk_nandflash_resource[] = { + { + .start =DA8XX_AEMIF_CS3_BASE , + .end =DA8XX_AEMIF_CS3_BASE +SZ_32M , + .flags =IORESOURCE_MEM , + }, + { + .start =DA8XX_AEMIF_CTL_BASE , + .end =DA8XX_AEMIF_CTL_BASE +SZ_32K , + .flags =IORESOURCE_MEM , + }, +}; + +static struct resource omapl138_hawk_aemif_resource[] = { + { + .start =DA8XX_AEMIF_CTL_BASE , + .end =DA8XX_AEMIF_CTL_BASE +SZ_32K , + .flags =IORESOURCE_MEM , + } +}; + +static struct aemif_abus_data omapl138_hawk_aemif_abus_data[] = { + { + .cs =3 , + } +}; + +static struct platform_device omapl138_hawk_aemif_devices[] = { + { + .name ="davinci-nand" , + .id =1 , + .dev = { + .platform_data = &omapl138_hawk_nandflash_data, + }, + .resource = omapl138_hawk_nandflash_resource, + .num_resources =ARRAY_SIZE (omapl138_hawk_nandflash_resource), + .id =0 , + } +}; + +static struct aemif_platform_data omapl138_hawk_aemif_pdata = { + .cs_offset =2 , + .abus_data = omapl138_hawk_aemif_abus_data, + .num_abus_data =ARRAY_SIZE (omapl138_hawk_aemif_abus_data), + .sub_devices = omapl138_hawk_aemif_devices, + .num_sub_devices =ARRAY_SIZE (omapl138_hawk_aemif_devices), +}; + +static struct platform_device omapl138_hawk_aemif_device = { + .name ="ti-aemif" , + .dev = { + .platform_data = &omapl138_hawk_aemif_pdata, + }, + .resource = omapl138_hawk_aemif_resource, + .num_resources =ARRAY_SIZE (omapl138_hawk_aemif_resource), + .id =-1 , +}; + +static const short omapl138_hawk_nand_pins[] = { +DA850_EMA_WAIT_1 ,DA850_NEMA_OE ,DA850_NEMA_WE ,DA850_NEMA_CS_3 , +DA850_EMA_D_0 ,DA850_EMA_D_1 ,DA850_EMA_D_2 ,DA850_EMA_D_3 , +DA850_EMA_D_4 ,DA850_EMA_D_5 ,DA850_EMA_D_6 ,DA850_EMA_D_7 , +DA850_EMA_D_8 ,DA850_EMA_D_9 ,DA850_EMA_D_10 ,DA850_EMA_D_11 , +DA850_EMA_D_12 ,DA850_EMA_D_13 ,DA850_EMA_D_14 ,DA850_EMA_D_15 , +DA850_EMA_A_1 ,DA850_EMA_A_2 , +-1 +}; + +static int omapl138_hawk_register_aemif (void ) +{ +int ret; + + ret =davinci_cfg_reg_list (omapl138_hawk_nand_pins); +if (ret) +pr_warn ("%s: NAND mux setup failed: %d\n" , __func__, ret); + +return platform_device_register (&omapl138_hawk_aemif_device); +} +static irqreturn_t omapl138_hawk_usb_ocic_irq (int irq,void *dev_id);static da8xx_ocic_handler_t hawk_usb_ocic_handler;
@@ -301,6 +429,10 @@ static __init void omapl138_hawk_init(void)omapl138_hawk_usb_init (); + ret =omapl138_hawk_register_aemif (); +if (ret) +pr_warn ("%s: aemif registration failed: %d\n" , __func__, ret); + ret =da8xx_register_watchdog ();if (ret) pr_warn("%s: watchdog registration failed: %d\n",
Signature · 1 line
2.16.1
PATCH 6/6 ARM: davinci: use aemif platform driver in legacy mode for da850-evm
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
We now support board files in aemif. Use the platform driver instead of the handcrafted API in da850-evm.
--- arch/arm/mach-davinci/board-da850-evm.c | 93 ++++++++++++++++++--------------- 1 file changed, 51 insertions(+), 42 deletions(-)
arch/arm/mach-davinci/board-da850-evm.c +51 -42
@@ -33,6 +33,7 @@#include <linux/platform_data/gpio-davinci.h> #include <linux/platform_data/mtd-davinci.h> #include <linux/platform_data/mtd-davinci-aemif.h> +#include <linux/platform_data/ti-aemif.h> #include <linux/platform_data/spi-davinci.h> #include <linux/platform_data/uio_pruss.h> #include <linux/regulator/machine.h>
@@ -185,16 +186,6 @@ static struct resource da850_evm_norflash_resource[] = { }, }; -static struct platform_device da850_evm_norflash_device = { - .name ="physmap-flash" , - .id =0 , - .dev = { - .platform_data = &da850_evm_norflash_data, - }, - .num_resources =1 , - .resource = da850_evm_norflash_resource, -}; -/* DA850/OMAP-L138 EVM includes a 512 MByte large-page NAND flash * (128K blocks). It may be used instead of the (default) SPI flash * to boot, using TI's tools to install the secondary boot loader
@@ -265,37 +256,58 @@ static struct resource da850_evm_nandflash_resource[] = { }, }; -static struct platform_device da850_evm_nandflash_device = { - .name ="davinci-nand" , - .id =1 , - .dev = { - .platform_data = &da850_evm_nandflash_data, - }, - .num_resources =ARRAY_SIZE (da850_evm_nandflash_resource), - .resource = da850_evm_nandflash_resource, +static struct resource da850_evm_aemif_resource[] = { + { + .start =DA8XX_AEMIF_CTL_BASE , + .end =DA8XX_AEMIF_CTL_BASE +SZ_32K , + .flags =IORESOURCE_MEM , + } }; -static struct platform_device *da850_evm_devices[] = { - &da850_evm_nandflash_device, - &da850_evm_norflash_device, +static struct aemif_abus_data da850_evm_aemif_abus_data[] = { + { + .cs =3 , + } }; -#define DA8XX_AEMIF_CE2CFG_OFFSET 0x10 -#define DA8XX_AEMIF_ASIZE_16BIT 0x1 - -static void __init da850_evm_init_nor (void ) -{ -void __iomem *aemif_addr; - - aemif_addr =ioremap (DA8XX_AEMIF_CTL_BASE ,SZ_32K ); +static struct platform_device da850_evm_aemif_devices[] = { + { + .name ="davinci-nand" , + .id =1 , + .dev = { + .platform_data = &da850_evm_nandflash_data, + }, + .num_resources =ARRAY_SIZE (da850_evm_nandflash_resource), + .resource = da850_evm_nandflash_resource, + }, + { + .name ="physmap-flash" , + .id =0 , + .dev = { + .platform_data = &da850_evm_norflash_data, + }, + .num_resources =1 , + .resource = da850_evm_norflash_resource, + } +}; -/* Configure data bus width of CS2 to 16 bit */ -writel (readl (aemif_addr +DA8XX_AEMIF_CE2CFG_OFFSET ) | -DA8XX_AEMIF_ASIZE_16BIT , - aemif_addr +DA8XX_AEMIF_CE2CFG_OFFSET ); +static struct aemif_platform_data da850_evm_aemif_pdata = { + .cs_offset =2 , + .abus_data = da850_evm_aemif_abus_data, + .num_abus_data =ARRAY_SIZE (da850_evm_aemif_abus_data), + .sub_devices = da850_evm_aemif_devices, + .num_sub_devices =ARRAY_SIZE (da850_evm_aemif_devices), +}; -iounmap (aemif_addr); -} +static struct platform_device da850_evm_aemif_device = { + .name ="ti-aemif" , + .dev = { + .platform_data = &da850_evm_aemif_pdata, + }, + .resource = da850_evm_aemif_resource, + .num_resources =ARRAY_SIZE (da850_evm_aemif_resource), + .id =-1 , +};static const short da850_evm_nand_pins[] = {DA850_EMA_D_0 ,DA850_EMA_D_1 ,DA850_EMA_D_2 ,DA850_EMA_D_3 ,
@@ -338,13 +350,10 @@ static inline void da850_evm_setup_nor_nand(void)pr_warn ("%s: NOR mux setup failed: %d\n" , __func__, ret); -da850_evm_init_nor (); - -platform_add_devices (da850_evm_devices, -ARRAY_SIZE (da850_evm_devices)); - -if (davinci_aemif_setup (&da850_evm_nandflash_device)) -pr_warn ("%s: Cannot configure AEMIF.\n" , __func__); + ret =platform_device_register (&da850_evm_aemif_device); +if (ret) +pr_warn ("%s: registering aemif failed: %d\n" , + __func__, ret); } }
Signature · 1 line
2.16.1