ARM: davinci: remove duplicate aemif support
Subsystems (5)
v3 cover ARM: davinci: remove duplicate aemif support
From: Bartosz Golaszewski <[email protected]>
This series moves all aemif/nand users to using the ti-aemif platform driver located in drivers/memory instead of the older API located in mach-davinci.
First five patches add necessary changes to the clock driver. Next seven convert the board files to using the ti-aemif driver. Last patch removes now dead code.
v1 -> v2:
- added missing clock lookups for ti-aemif where needed
- removed an unnecessary davinci_nand clock lookup from psc-da850
- moved the .id field initialization of aemif platform devices next to .name
- tweaked the commit message for the last patch
v2 -> v3:
- in patch 6: change the davinci_nand device's id to -1 and keep the includes sorted
Bartosz Golaszewski (13):
clk: davinci: psc-da850: remove the 'davinci_nand.0" lookup
clk: davinci: psc-dm365: use two lookup entries for the aemif clock
clk: davinci: psc-dm644x: use two lookup entries for the aemif clock
clk: davinci: psc-dm646x: use two lookup entries for the aemif clock
clk: davinci: psc-da830: add a lookup entry for aemif clock
ARM: davinci: omapl138-hawk: add aemif & nand support
ARM: davinci: da850-evm: use aemif platform driver in legacy mode
ARM: davinci: dm365-evm: use the ti-aemif soc driver
ARM: davinci: dm644x-evm: use aemif platform driver
ARM: davinci: da830-evm: use aemif platform driver
ARM: davinci: dm646x-evm: use aemif platform driver
ARM: davinci: mityomapl138: use aemif platform driver
ARM: davinci: unduplicate aemif support
arch/arm/mach-davinci/Makefile | 2 +- arch/arm/mach-davinci/aemif.c | 218 ------------------ arch/arm/mach-davinci/board-da830-evm.c | 56 ++++- arch/arm/mach-davinci/board-da850-evm.c | 93 ++++---- arch/arm/mach-davinci/board-dm365-evm.c | 59 +++-- arch/arm/mach-davinci/board-dm644x-evm.c | 55 +++-- arch/arm/mach-davinci/board-dm646x-evm.c | 52 ++++- arch/arm/mach-davinci/board-mityomapl138.c | 55 +++-- arch/arm/mach-davinci/board-omapl138-hawk.c | 132 +++++++++++ drivers/clk/davinci/psc-da830.c | 3 +- drivers/clk/davinci/psc-da850.c | 3 +- drivers/clk/davinci/psc-dm365.c | 3 +- drivers/clk/davinci/psc-dm644x.c | 3 +- drivers/clk/davinci/psc-dm646x.c | 3 +- .../linux/platform_data/mtd-davinci-aemif.h | 1 - 15 files changed, 407 insertions(+), 331 deletions(-) delete mode 100644 arch/arm/mach-davinci/aemif.c
Signature · 1 line
2.17.1
PATCH v3 1/13 clk: davinci: psc-da850: remove the 'davinci_nand.0" lookup
From: Bartosz Golaszewski <[email protected]>
Since commit a8e3923ab571 ("mtd: rawnand: davinci: don't acquire and enable clock") we no longer acquire the aemif clock from the davinci nand driver - we only do it from the ti-aemif driver. Remove the nand entry from the psc lookup table.
--- drivers/clk/davinci/psc-da850.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/clk/davinci/psc-da850.c +1 -2
@@ -16,8 +16,7 @@#include "psc.h" -LPSC_CLKDEV2 (emifa_clkdev,NULL ,"ti-aemif" , -"aemif" ,"davinci_nand.0" ); +LPSC_CLKDEV1 (emifa_clkdev,NULL ,"ti-aemif" );LPSC_CLKDEV1 (spi0_clkdev,NULL ,"spi_davinci.0" );LPSC_CLKDEV1 (mmcsd0_clkdev,NULL ,"da830-mmc.0" );LPSC_CLKDEV1 (uart0_clkdev,NULL ,"serial8250.0" );
Signature · 1 line
2.17.1
Re: [PATCH v3 01/13] clk: davinci: psc-da850: remove the 'davinci_nand.0" lookup
Quoted 10 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Since commit
a8e3923ab571("mtd: rawnand: davinci: don't acquire and enable clock") we no longer acquire the aemif clock from the davinci nand driver - we only do it from the ti-aemif driver. Remove the nand entry from the psc lookup table.Signed-off-by Bartosz Golaszewski <[email protected]>Reviewed-by David Lechner <[email protected]>---
Applied to clk-davinci-4.19.
Thanks.
PATCH v3 2/13 clk: davinci: psc-dm365: use two lookup entries for the aemif clock
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
We want to be able to get the clock both from the board file by its con_id and from the aemif driver by dev_id.
--- drivers/clk/davinci/psc-dm365.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/clk/davinci/psc-dm365.c +2 -1
@@ -21,7 +21,8 @@ LPSC_CLKDEV1(mmcsd1_clkdev, NULL, "da830-mmc.1");LPSC_CLKDEV1 (asp0_clkdev,NULL ,"davinci-mcbsp" );LPSC_CLKDEV1 (usb_clkdev,"usb" ,NULL );LPSC_CLKDEV1 (spi2_clkdev,NULL ,"spi_davinci.2" ); -LPSC_CLKDEV1 (aemif_clkdev,"aemif" ,NULL ); +LPSC_CLKDEV2 (aemif_clkdev,"aemif" ,NULL , +NULL ,"ti-aemif" );LPSC_CLKDEV1 (mmcsd0_clkdev,NULL ,"da830-mmc.0" );LPSC_CLKDEV1 (i2c_clkdev,NULL ,"i2c_davinci.1" );LPSC_CLKDEV1 (uart0_clkdev,NULL ,"serial8250.0" );
Signature · 1 line
2.17.1
Re: [PATCH v3 02/13] clk: davinci: psc-dm365: use two lookup entries for the aemif clock
Quoted 8 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
We want to be able to get the clock both from the board file by its
con_idand from the aemif driver bydev_id.Signed-off-by Bartosz Golaszewski <[email protected]>Reviewed-by David Lechner <[email protected]>---
Applied to clk-davinci-4.19.
Thanks.
PATCH v3 3/13 clk: davinci: psc-dm644x: use two lookup entries for the aemif clock
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
We want to be able to get the clock both from the board file by its con_id and from the aemif driver by dev_id.
--- drivers/clk/davinci/psc-dm644x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/clk/davinci/psc-dm644x.c +2 -1
@@ -21,7 +21,8 @@ LPSC_CLKDEV2(emac_clkdev, NULL, "davinci_emac.1", "fck", "davinci_mdio.0");LPSC_CLKDEV1 (usb_clkdev,"usb" ,NULL );LPSC_CLKDEV1 (ide_clkdev,NULL ,"palm_bk3710" ); -LPSC_CLKDEV1 (aemif_clkdev,"aemif" ,NULL ); +LPSC_CLKDEV2 (aemif_clkdev,"aemif" ,NULL , +NULL ,"ti-aemif" );LPSC_CLKDEV1 (mmcsd_clkdev,NULL ,"dm6441-mmc.0" );LPSC_CLKDEV1 (asp0_clkdev,NULL ,"davinci-mcbsp" );LPSC_CLKDEV1 (i2c_clkdev,NULL ,"i2c_davinci.1" );
Signature · 1 line
2.17.1
Re: [PATCH v3 03/13] clk: davinci: psc-dm644x: use two lookup entries for the aemif clock
Quoted 8 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
We want to be able to get the clock both from the board file by its
con_idand from the aemif driver bydev_id.Signed-off-by Bartosz Golaszewski <[email protected]>Reviewed-by David Lechner <[email protected]>---
Applied to clk-davinci-4.19.
Thanks.
PATCH v3 4/13 clk: davinci: psc-dm646x: use two lookup entries for the aemif clock
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
We want to be able to get the clock both from the board file by its con_id and from the aemif driver by dev_id.
--- drivers/clk/davinci/psc-dm646x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/clk/davinci/psc-dm646x.c +2 -1
@@ -18,7 +18,8 @@LPSC_CLKDEV1 (ide_clkdev,NULL ,"palm_bk3710" );LPSC_CLKDEV2 (emac_clkdev,NULL ,"davinci_emac.1" ,"fck" ,"davinci_mdio.0" ); -LPSC_CLKDEV1 (aemif_clkdev,"aemif" ,NULL ); +LPSC_CLKDEV2 (aemif_clkdev,"aemif" ,NULL , +NULL ,"ti-aemif" );LPSC_CLKDEV1 (mcasp0_clkdev,NULL ,"davinci-mcasp.0" );LPSC_CLKDEV1 (mcasp1_clkdev,NULL ,"davinci-mcasp.1" );LPSC_CLKDEV1 (uart0_clkdev,NULL ,"serial8250.0" );
Signature · 1 line
2.17.1
Re: [PATCH v3 04/13] clk: davinci: psc-dm646x: use two lookup entries for the aemif clock
Quoted 8 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
We want to be able to get the clock both from the board file by its
con_idand from the aemif driver bydev_id.Signed-off-by Bartosz Golaszewski <[email protected]>Reviewed-by David Lechner <[email protected]>---
Applied to clk-davinci-4.19.
Thanks.
PATCH v3 5/13 clk: davinci: psc-da830: add a lookup entry for aemif clock
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
We want to use the ti-aemif platform driver for da830-evm. To make it work we need a lookup entry for the aemif clock.
--- drivers/clk/davinci/psc-da830.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/clk/davinci/psc-da830.c +2 -1
@@ -14,6 +14,7 @@#include "psc.h" +LPSC_CLKDEV1 (aemif_clkdev,NULL ,"ti-aemif" );LPSC_CLKDEV1 (spi0_clkdev,NULL ,"spi_davinci.0" );LPSC_CLKDEV1 (mmcsd_clkdev,NULL ,"da830-mmc.0" );LPSC_CLKDEV1 (uart0_clkdev,NULL ,"serial8250.0" );
@@ -22,7 +23,7 @@ static const struct davinci_lpsc_clk_info da830_psc0_info[] = {LPSC (0 ,0 , tpcc, pll0_sysclk2,NULL ,LPSC_ALWAYS_ENABLED ),LPSC (1 ,0 , tptc0, pll0_sysclk2,NULL ,LPSC_ALWAYS_ENABLED ),LPSC (2 ,0 , tptc1, pll0_sysclk2,NULL ,LPSC_ALWAYS_ENABLED ), -LPSC (3 ,0 , aemif, pll0_sysclk3,NULL ,LPSC_ALWAYS_ENABLED ), +LPSC (3 ,0 , aemif, pll0_sysclk3, aemif_clkdev,LPSC_ALWAYS_ENABLED ),LPSC (4 ,0 , spi0, pll0_sysclk2, spi0_clkdev,0 ),LPSC (5 ,0 , mmcsd, pll0_sysclk2, mmcsd_clkdev,0 ), LPSC(6, 0, aintc, pll0_sysclk4, NULL, LPSC_ALWAYS_ENABLED),
Signature · 1 line
2.17.1
Re: [PATCH v3 05/13] clk: davinci: psc-da830: add a lookup entry for aemif clock
Quoted 8 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
We want to use the ti-aemif platform driver for da830-evm. To make it work we need a lookup entry for the aemif clock.
Signed-off-by Bartosz Golaszewski <[email protected]>Reviewed-by David Lechner <[email protected]>---
Applied to clk-davinci-4.19.
Thanks.
PATCH v3 6/13 ARM: davinci: omapl138-hawk: add aemif & nand support
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-hawk.
--- arch/arm/mach-davinci/board-omapl138-hawk.c | 132 ++++++++++++++++++++ 1 file changed, 132 insertions(+)
arch/arm/mach-davinci/board-omapl138-hawk.c +132 -0
@@ -15,7 +15,12 @@#include <linux/interrupt.h> #include <linux/gpio.h> #include <linux/gpio/machine.h> +#include <linux/mtd/partitions.h> +#include <linux/mtd/rawnand.h> #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/regulator/machine.h> #include <asm/mach-types.h>
@@ -166,6 +171,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_512K , + .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 = { + .core_chipsel =1 , + .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), + } +}; + +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" , + .id =-1 , + .dev = { + .platform_data = &omapl138_hawk_aemif_pdata, + }, + .resource = omapl138_hawk_aemif_resource, + .num_resources =ARRAY_SIZE (omapl138_hawk_aemif_resource), +}; + +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;
@@ -298,6 +426,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.17.1
PATCH v3 7/13 ARM: davinci: da850-evm: use aemif platform driver in legacy mode
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
We now support board files in the aemif driver. Register a platform device instead of using 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
@@ -266,37 +257,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" , + .id =-1 , + .dev = { + .platform_data = &da850_evm_aemif_pdata, + }, + .resource = da850_evm_aemif_resource, + .num_resources =ARRAY_SIZE (da850_evm_aemif_resource), +};static const short da850_evm_nand_pins[] = {DA850_EMA_D_0 ,DA850_EMA_D_1 ,DA850_EMA_D_2 ,DA850_EMA_D_3 ,
@@ -339,13 +351,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.17.1
PATCH v3 8/13 ARM: davinci: dm365-evm: use the ti-aemif soc driver
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
We now support board files in the aemif driver. Register a platform device instead of using the handcrafted API in dm365-evm.
--- arch/arm/mach-davinci/board-dm365-evm.c | 59 +++++++++++++++++++------ 1 file changed, 46 insertions(+), 13 deletions(-)
arch/arm/mach-davinci/board-dm365-evm.c +46 -13
@@ -28,6 +28,7 @@#include <linux/spi/spi.h> #include <linux/spi/eeprom.h> #include <linux/v4l2-dv-timings.h> +#include <linux/platform_data/ti-aemif.h> #include <asm/mach-types.h> #include <asm/mach/arch.h>
@@ -159,14 +160,47 @@ static struct resource davinci_nand_resources[] = { }, }; -static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , - .id =0 , - .num_resources =ARRAY_SIZE (davinci_nand_resources), - .resource = davinci_nand_resources, - .dev = { - .platform_data = &davinci_nand_data, +static struct platform_device davinci_aemif_devices[] = { + { + .name ="davinci_nand" , + .id =0 , + .num_resources =ARRAY_SIZE (davinci_nand_resources), + .resource = davinci_nand_resources, + .dev = { + .platform_data = &davinci_nand_data, + }, + } +}; + +static struct resource davinci_aemif_resources[] = { + { + .start =DM365_ASYNC_EMIF_CONTROL_BASE , + .end =DM365_ASYNC_EMIF_CONTROL_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, +}; + +static struct aemif_abus_data da850_evm_aemif_abus_data[] = { + { + .cs =1 , + }, +}; + +static struct aemif_platform_data davinci_aemif_pdata = { + .abus_data = da850_evm_aemif_abus_data, + .num_abus_data =ARRAY_SIZE (da850_evm_aemif_abus_data), + .sub_devices = davinci_aemif_devices, + .num_sub_devices =ARRAY_SIZE (davinci_aemif_devices), +}; + +static struct platform_device davinci_aemif_device = { + .name ="ti-aemif" , + .id =-1 , + .dev = { + .platform_data = &davinci_aemif_pdata, }, + .resource = davinci_aemif_resources, + .num_resources =ARRAY_SIZE (davinci_aemif_resources), };static struct at24_platform_data eeprom_info = {
@@ -537,10 +571,6 @@ static void __init evm_init_i2c(void)i2c_register_board_info (1 , i2c_info,ARRAY_SIZE (i2c_info)); } -static struct platform_device *dm365_evm_nand_devices[]__initdata = { - &davinci_nand_device, -}; -static inline int have_leds (void ) {#ifdef CONFIG_LEDS_CLASS
@@ -628,6 +658,7 @@ static void __init evm_init_cpld(void)u8 mux, resets;const char *label;struct clk *aemif_clk; +int rc;/* Make sure we can configure the CPLD through CS1. Then * leave it on for later access to MMC and LED registers.
@@ -660,8 +691,10 @@ static void __init evm_init_cpld(void)/* external keypad mux */ mux |=BIT (7 ); -platform_add_devices (dm365_evm_nand_devices, -ARRAY_SIZE (dm365_evm_nand_devices)); + rc =platform_device_register (&davinci_aemif_device); +if (rc) +pr_warn ("%s(): error registering the aemif device: %d\n" , + __func__, rc); }else {/* no OneNAND support yet */ }
Signature · 1 line
2.17.1
PATCH v3 9/13 ARM: davinci: dm644x-evm: use aemif platform driver
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
We now support board files in the aemif driver. Register a platform device instead of using the handcrafted API in dm644x-evm.
--- arch/arm/mach-davinci/board-dm644x-evm.c | 55 ++++++++++++++++++------ 1 file changed, 42 insertions(+), 13 deletions(-)
arch/arm/mach-davinci/board-dm644x-evm.c +42 -13
@@ -42,6 +42,7 @@#include <linux/platform_data/mmc-davinci.h> #include <linux/platform_data/usb-davinci.h> #include <linux/platform_data/mtd-davinci-aemif.h> +#include <linux/platform_data/ti-aemif.h> #include "davinci.h"
@@ -174,14 +175,47 @@ static struct resource davinci_evm_nandflash_resource[] = { }, }; -static struct platform_device davinci_evm_nandflash_device = { - .name ="davinci_nand" , - .id =0 , - .dev = { - .platform_data = &davinci_evm_nandflash_data, +static struct resource davinci_evm_aemif_resource[] = { + { + .start =DM644X_ASYNC_EMIF_CONTROL_BASE , + .end =DM644X_ASYNC_EMIF_CONTROL_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , }, - .num_resources =ARRAY_SIZE (davinci_evm_nandflash_resource), - .resource = davinci_evm_nandflash_resource, +}; + +static struct aemif_abus_data davinci_evm_aemif_abus_data[] = { + { + .cs =1 , + }, +}; + +static struct platform_device davinci_evm_nandflash_devices[] = { + { + .name ="davinci_nand" , + .id =0 , + .dev = { + .platform_data = &davinci_evm_nandflash_data, + }, + .num_resources =ARRAY_SIZE (davinci_evm_nandflash_resource), + .resource = davinci_evm_nandflash_resource, + }, +}; + +static struct aemif_platform_data davinci_evm_aemif_pdata = { + .abus_data = davinci_evm_aemif_abus_data, + .num_abus_data =ARRAY_SIZE (davinci_evm_aemif_abus_data), + .sub_devices = davinci_evm_nandflash_devices, + .num_sub_devices =ARRAY_SIZE (davinci_evm_nandflash_devices), +}; + +static struct platform_device davinci_evm_aemif_device = { + .name ="ti-aemif" , + .id =-1 , + .dev = { + .platform_data = &davinci_evm_aemif_pdata, + }, + .resource = davinci_evm_aemif_resource, + .num_resources =ARRAY_SIZE (davinci_evm_aemif_resource), };static u64 davinci_fb_dma_mask =DMA_BIT_MASK (32 );
@@ -795,12 +829,7 @@ static __init void davinci_evm_init(void)/* only one device will be jumpered and detected */ if (HAS_NAND ) { -platform_device_register (&davinci_evm_nandflash_device); - -if (davinci_aemif_setup (&davinci_evm_nandflash_device)) -pr_warn ("%s: Cannot configure AEMIF\n" , - __func__); - +platform_device_register (&davinci_evm_aemif_device);#ifdef CONFIG_I2C evm_leds[7 ].default_trigger ="nand-disk" ;#endif
Signature · 1 line
2.17.1
PATCH v3 10/13 ARM: davinci: da830-evm: use aemif platform driver
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
We now support board files in the aemif driver. Register a platform device instead of using the handcrafted API in da830-evm.
--- arch/arm/mach-davinci/board-da830-evm.c | 56 +++++++++++++++++++------ 1 file changed, 44 insertions(+), 12 deletions(-)
arch/arm/mach-davinci/board-da830-evm.c +44 -12
@@ -28,6 +28,7 @@#include <linux/platform_data/mtd-davinci-aemif.h> #include <linux/platform_data/spi-davinci.h> #include <linux/platform_data/usb-davinci.h> +#include <linux/platform_data/ti-aemif.h> #include <linux/regulator/machine.h> #include <asm/mach-types.h>
@@ -333,14 +334,48 @@ static struct resource da830_evm_nand_resources[] = { }, }; -static struct platform_device da830_evm_nand_device = { - .name ="davinci_nand" , - .id =1 , - .dev = { - .platform_data = &da830_evm_nand_pdata, +static struct platform_device da830_evm_aemif_devices[] = { + { + .name ="davinci_nand" , + .id =1 , + .dev = { + .platform_data = &da830_evm_nand_pdata, + }, + .num_resources =ARRAY_SIZE (da830_evm_nand_resources), + .resource = da830_evm_nand_resources, + }, +}; + +static struct resource da830_evm_aemif_resource[] = { + { + .start =DA8XX_AEMIF_CTL_BASE , + .end =DA8XX_AEMIF_CTL_BASE +SZ_32K -1 , + .flags =IORESOURCE_MEM , + }, +}; + +static struct aemif_abus_data da830_evm_aemif_abus_data[] = { + { + .cs =3 , }, - .num_resources =ARRAY_SIZE (da830_evm_nand_resources), - .resource = da830_evm_nand_resources, +}; + +static struct aemif_platform_data da830_evm_aemif_pdata = { + .abus_data = da830_evm_aemif_abus_data, + .num_abus_data =ARRAY_SIZE (da830_evm_aemif_abus_data), + .sub_devices = da830_evm_aemif_devices, + .num_sub_devices =ARRAY_SIZE (da830_evm_aemif_devices), + .cs_offset =2 , +}; + +static struct platform_device da830_evm_aemif_device = { + .name ="ti-aemif" , + .id =-1 , + .dev = { + .platform_data = &da830_evm_aemif_pdata, + }, + .resource = da830_evm_aemif_resource, + .num_resources =ARRAY_SIZE (da830_evm_aemif_resource), };/*
@@ -371,12 +406,9 @@ static inline void da830_evm_init_nand(int mux_mode)if (ret)pr_warn ("%s: emif25 mux setup failed: %d\n" , __func__, ret); - ret =platform_device_register (&da830_evm_nand_device); + ret =platform_device_register (&da830_evm_aemif_device);if (ret) -pr_warn ("%s: NAND device not registered\n" , __func__); - -if (davinci_aemif_setup (&da830_evm_nand_device)) -pr_warn ("%s: Cannot configure AEMIF\n" , __func__); +pr_warn ("%s: AEMIF device not registered\n" , __func__);gpio_direction_output (mux_mode,1 ); }
Signature · 1 line
2.17.1
PATCH v3 11/13 ARM: davinci: dm646x-evm: use aemif platform driver
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
We now support board files in the aemif driver. Register a platform device instead of using the handcrafted API in dm646x-evm.
--- arch/arm/mach-davinci/board-dm646x-evm.c | 52 +++++++++++++++++++----- 1 file changed, 41 insertions(+), 11 deletions(-)
arch/arm/mach-davinci/board-dm646x-evm.c +41 -11
@@ -24,6 +24,7 @@#include <linux/i2c.h> #include <linux/platform_data/at24.h> #include <linux/platform_data/pcf857x.h> +#include <linux/platform_data/ti-aemif.h> #include <media/i2c/tvp514x.h> #include <media/i2c/adv7343.h>
@@ -106,16 +107,47 @@ static struct resource davinci_nand_resources[] = { }, }; -static struct platform_device davinci_nand_device = { - .name ="davinci_nand" , - .id =0 , +static struct platform_device davinci_aemif_devices[] = { + { + .name ="davinci_nand" , + .id =0 , + .num_resources =ARRAY_SIZE (davinci_nand_resources), + .resource = davinci_nand_resources, + .dev = { + .platform_data = &davinci_nand_data, + }, + }, +}; + +static struct resource davinci_aemif_resources[] = { + { + .start =DM646X_ASYNC_EMIF_CONTROL_BASE , + .end =DM646X_ASYNC_EMIF_CONTROL_BASE +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, +}; - .num_resources =ARRAY_SIZE (davinci_nand_resources), - .resource = davinci_nand_resources, +static struct aemif_abus_data davinci_aemif_abus_data[] = { + { + .cs =1 , + }, +}; - .dev = { - .platform_data = &davinci_nand_data, +static struct aemif_platform_data davinci_aemif_pdata = { + .abus_data = davinci_aemif_abus_data, + .num_abus_data =ARRAY_SIZE (davinci_aemif_abus_data), + .sub_devices = davinci_aemif_devices, + .num_sub_devices =ARRAY_SIZE (davinci_aemif_devices), +}; + +static struct platform_device davinci_aemif_device = { + .name ="ti-aemif" , + .id =-1 , + .dev = { + .platform_data = &davinci_aemif_pdata, }, + .resource = davinci_aemif_resources, + .num_resources =ARRAY_SIZE (davinci_aemif_resources), };#define HAS_ATA (IS_ENABLED(CONFIG_BLK_DEV_PALMCHIP_BK3710) || \
@@ -793,10 +825,8 @@ static __init void evm_init(void)if (machine_is_davinci_dm6467tevm ()) davinci_nand_data.timing = &dm6467tevm_nandflash_timing; -platform_device_register (&davinci_nand_device); - -if (davinci_aemif_setup (&davinci_nand_device)) -pr_warn ("%s: Cannot configure AEMIF.\n" , __func__); +if (platform_device_register (&davinci_aemif_device)) +pr_warn ("%s: Cannot register AEMIF device.\n" , __func__);dm646x_init_edma (dm646x_edma_rsv);
Signature · 1 line
2.17.1
PATCH v3 12/13 ARM: davinci: mityomapl138: use aemif platform driver
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
We now support board files in the aemif driver. Register a platform device instead of using the handcrafted API in mityomapl138.
--- arch/arm/mach-davinci/board-mityomapl138.c | 55 ++++++++++++++++------ 1 file changed, 41 insertions(+), 14 deletions(-)
arch/arm/mach-davinci/board-mityomapl138.c +41 -14
@@ -30,6 +30,7 @@#include <mach/da8xx.h> #include <linux/platform_data/mtd-davinci.h> #include <linux/platform_data/mtd-davinci-aemif.h> +#include <linux/platform_data/ti-aemif.h> #include <mach/mux.h> #include <linux/platform_data/spi-davinci.h>
@@ -422,27 +423,53 @@ static struct resource mityomapl138_nandflash_resource[] = { }, }; -static struct platform_device mityomapl138_nandflash_device = { - .name ="davinci_nand" , - .id =1 , - .dev = { - .platform_data = &mityomapl138_nandflash_data, +static struct platform_device mityomapl138_aemif_devices[] = { + { + .name ="davinci_nand" , + .id =1 , + .dev = { + .platform_data = &mityomapl138_nandflash_data, + }, + .num_resources =ARRAY_SIZE (mityomapl138_nandflash_resource), + .resource = mityomapl138_nandflash_resource, }, - .num_resources =ARRAY_SIZE (mityomapl138_nandflash_resource), - .resource = mityomapl138_nandflash_resource, }; -static struct platform_device *mityomapl138_devices[]__initdata = { - &mityomapl138_nandflash_device, +static struct resource mityomapl138_aemif_resources[] = { + { + .start =DA8XX_AEMIF_CTL_BASE , + .end =DA8XX_AEMIF_CTL_BASE +SZ_32K -1 , + .flags =IORESOURCE_MEM , + }, +}; + +static struct aemif_abus_data mityomapl138_aemif_abus_data[] = { + { + .cs =1 , + }, +}; + +static struct aemif_platform_data mityomapl138_aemif_pdata = { + .abus_data = mityomapl138_aemif_abus_data, + .num_abus_data =ARRAY_SIZE (mityomapl138_aemif_abus_data), + .sub_devices = mityomapl138_aemif_devices, + .num_sub_devices =ARRAY_SIZE (mityomapl138_aemif_devices), +}; + +static struct platform_device mityomapl138_aemif_device = { + .name ="ti-aemif" , + .id =-1 , + .dev = { + .platform_data = &mityomapl138_aemif_pdata, + }, + .resource = mityomapl138_aemif_resources, + .num_resources =ARRAY_SIZE (mityomapl138_aemif_resources), };static void __init mityomapl138_setup_nand (void ) { -platform_add_devices (mityomapl138_devices, -ARRAY_SIZE (mityomapl138_devices)); - -if (davinci_aemif_setup (&mityomapl138_nandflash_device)) -pr_warn ("%s: Cannot configure AEMIF\n" , __func__); +if (platform_device_register (&mityomapl138_aemif_device)) +pr_warn ("%s: Cannot register AEMIF device\n" , __func__); }static const short mityomap_mii_pins[] = {
Signature · 1 line
2.17.1
PATCH v3 13/13 ARM: davinci: unduplicate aemif support
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
All users now register platform devices using the ti-aemif driver. Remove the handcrafted aemif API.
--- arch/arm/mach-davinci/Makefile | 2 +- arch/arm/mach-davinci/aemif.c | 218 ------------------ .../linux/platform_data/mtd-davinci-aemif.h | 1 - 3 files changed, 1 insertion(+), 220 deletions(-) delete mode 100644 arch/arm/mach-davinci/aemif.c
arch/arm/mach-davinci/Makefile +1 -1
@@ -6,7 +6,7 @@ # Common objects obj-y := time.o serial.o usb.o \ - common.o sram.o aemif.o + common.o sram.o obj-$(CONFIG_DAVINCI_MUX) += mux.o
arch/arm/mach-davinci/aemif.c deleted +0 -218
218 lines not on this page · raw message
include/linux/platform_data/mtd-davinci-aemif.h +0 -1
@@ -33,5 +33,4 @@ struct davinci_aemif_timing { u8 ta; }; -int davinci_aemif_setup (struct platform_device *pdev);#endif
Signature · 1 line
2.17.1
Hi David, Stephen,
Quoted 9 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
This series moves all aemif/nand users to using the ti-aemif platform driver located in
drivers/memoryinstead of the older API located in mach-davinci.First five patches add necessary changes to the clock driver. Next seven convert the board files to using the ti-aemif driver. Last patch removes now dead code.
How do you want to handle this series? I can apply the series and provide you an immutable branch on v4.18-rc1 with the clock patches applied if that can work.
Thanks,
Sekhar
David Lechner
maintainerQuoted 9 lines · Sekhar Nori
Hi David, Stephen,
Quoted 6 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
This series moves all aemif/nand users to using the ti-aemif platform driver located in
drivers/memoryinstead of the older API located in mach-davinci.
Quoted 7 lines
Quoted 3 lines
First five patches add necessary changes to the clock driver. Next seven convert the board files to using the ti-aemif driver. Last patch removes now dead code.
How do you want to handle this series? I can apply the series and provide you an immutable branch on v4.18-rc1 with the clock patches applied if that can work.
Sounds good to me. But I'm new to this maintainer thing, so maybe there is something to consider that I haven't thought of?
Hi David,
Quoted 14 lines · David Lechner
Quoted 13 lines · Sekhar Nori
Hi David, Stephen,
Quoted 9 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
This series moves all aemif/nand users to using the ti-aemif platform driver located in
drivers/memoryinstead of the older API located in mach-davinci.First five patches add necessary changes to the clock driver. Next seven convert the board files to using the ti-aemif driver. Last patch removes now dead code.
Quoted 6 lines
Quoted 3 lines
How do you want to handle this series? I can apply the series and provide you an immutable branch on v4.18-rc1 with the clock patches applied if that can work.
Sounds good to me. But I'm new to this maintainer thing, so maybe there is something to consider that I haven't thought of?
I don't think there is more to it. Ultimately there should not be two commits for the same patch. Either you can apply and share the commit to use or I can do that as well. I am equally fine either way.
Regards,
Sekhar
David Lechner
maintainerQuoted 24 lines · Sekhar Nori
Hi David,
Quoted 14 lines · David Lechner
Quoted 13 lines · Sekhar Nori
Hi David, Stephen,
Quoted 9 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
This series moves all aemif/nand users to using the ti-aemif platform driver located in
drivers/memoryinstead of the older API located in mach-davinci.First five patches add necessary changes to the clock driver. Next seven convert the board files to using the ti-aemif driver. Last patch removes now dead code.
Quoted 6 lines
Quoted 3 lines
How do you want to handle this series? I can apply the series and provide you an immutable branch on v4.18-rc1 with the clock patches applied if that can work.
Sounds good to me. But I'm new to this maintainer thing, so maybe there is something to consider that I haven't thought of?
Quoted 7 lines
I don't think there is more to it. Ultimately there should not be two commits for the same patch. Either you can apply and share the commit to use or I can do that as well. I am equally fine either way.
Regards,
Sekhar
I've created a branch for-sekhar at https://github.com/dlech/linux.git
with the clk commits.
Quoted 29 lines · David Lechner
Quoted 28 lines · Sekhar Nori
Hi David,
Quoted 14 lines · David Lechner
Quoted 13 lines · Sekhar Nori
Hi David, Stephen,
Quoted 9 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
This series moves all aemif/nand users to using the ti-aemif platform driver located in
drivers/memoryinstead of the older API located in mach-davinci.First five patches add necessary changes to the clock driver. Next seven convert the board files to using the ti-aemif driver. Last patch removes now dead code.
Quoted 6 lines
Quoted 3 lines
How do you want to handle this series? I can apply the series and provide you an immutable branch on v4.18-rc1 with the clock patches applied if that can work.
Sounds good to me. But I'm new to this maintainer thing, so maybe there is something to consider that I haven't thought of?
I don't think there is more to it. Ultimately there should not be two commits for the same patch. Either you can apply and share the commit to use or I can do that as well. I am equally fine either way.
Quoted 6 lines
Quoted 3 lines
Regards,
SekharI've created a branch for-sekhar at https://github.com/dlech/linux.git
with the clk commits.
Thanks. I merged commit f917ff75ac55b6d829c9d1142e83913064565d5b (top of that branch) to my v4.19/soc branch. Please do let Stephen and Mike know about this then when you send your stuff for v4.19.
Thanks,
Sekhar
David Lechner
maintainerQuoted 34 lines · Sekhar Nori
Quoted 33 lines · David Lechner
Quoted 31 lines · Sekhar Nori
Hi David,
Quoted 14 lines · David Lechner
Quoted 13 lines · Sekhar Nori
Hi David, Stephen,
Quoted 9 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
This series moves all aemif/nand users to using the ti-aemif platform driver located in
drivers/memoryinstead of the older API located in mach-davinci.First five patches add necessary changes to the clock driver. Next seven convert the board files to using the ti-aemif driver. Last patch removes now dead code.
Quoted 6 lines
Quoted 3 lines
How do you want to handle this series? I can apply the series and provide you an immutable branch on v4.18-rc1 with the clock patches applied if that can work.
Sounds good to me. But I'm new to this maintainer thing, so maybe there is something to consider that I haven't thought of?
I don't think there is more to it. Ultimately there should not be two commits for the same patch. Either you can apply and share the commit to use or I can do that as well. I am equally fine either way.
Regards,
Sekhar
Quoted 7 lines
Quoted 2 lines
I've created a branch for-sekhar at https://github.com/dlech/linux.git
with the clk commits.Thanks. I merged commit
f917ff75ac55b6d829c9d1142e83913064565d5b(top of that branch) to my v4.19/soc branch. Please do let Stephen and Mike know about this then when you send your stuff for v4.19.
Since there have been no more clk-davinci patches for v4.19, I assume that it is OK to just let this go through the ARM tree via Sekhar?
Hi David,
Quoted 41 lines · David Lechner
Quoted 40 lines · Sekhar Nori
Quoted 38 lines · David Lechner
Quoted 26 lines · Sekhar Nori
Hi David,
Quoted 16 lines · David Lechner
Quoted 15 lines · Sekhar Nori
Hi David, Stephen,
Quoted 11 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
This series moves all aemif/nand users to using the ti-aemif platform
driver located indrivers/memoryinstead of the older API located in mach-davinci.First five patches add necessary changes to the clock driver. Next seven convert the board files to using the ti-aemif driver. Last patch
removes now dead code.Quoted 6 lines
Quoted 3 lines
How do you want to handle this series? I can apply the series and provide you an immutable branch on v4.18-rc1 with the clock patches applied if that can work.
Sounds good to me. But I'm new to this maintainer thing, so maybe there is something to consider that I haven't thought of?
Quoted 8 lines
I don't think there is more to it. Ultimately there should not be two commits for the same patch. Either you can apply and share the commit to
use or I can do that as well. I am equally fine either way.Regards,
SekharI've created a branch for-sekhar at https://github.com/dlech/linux.git
with the clk commits.
Quoted 7 lines
Quoted 4 lines
Thanks. I merged commit
f917ff75ac55b6d829c9d1142e83913064565d5b(top of that branch) to my v4.19/soc branch. Please do let Stephen and Mike know about this then when you send your stuff for v4.19.Since there have been no more clk-davinci patches for v4.19, I assume that it is OK to just let this go through the ARM tree via Sekhar?
Yes, that should be fine.
Thanks,
Sekhar