Commit 8787ad35 authored by Olof Johansson's avatar Olof Johansson

Merge tag 'davinci-for-v4.18/soc' of...

Merge tag 'davinci-for-v4.18/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/soc

DaVinci SoC support updates for v4.18

Mainly contains patches to move NAND chipselect to platform data
(currently platform device id is being used). These patches have
been acked by NAND maintainer and because of the driver dependency
an immutable branch has been provided to Boris.

The other patch is to remove an unnecessary postcore_initcall() on
DM644x which is needed for common clock framework conversion.

* tag 'davinci-for-v4.18/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci:
  ARM: davinci: dm644x: remove unnecessary postcore_initcall()
  ARM: davinci: aemif: stop using pdev->id as nand chipselect
  mtd: rawnand: davinci: stop using pdev->id as chipselect
  ARM: davinci: neuros-osd2: specify the chipselect in davinci_nand_pdata
  ARM: davinci: dm646x-evm: specify the chipselect in davinci_nand_pdata
  ARM: davinci: mityomapl138: specify the chipselect in davinci_nand_pdata
  ARM: davinci: dm644x-evm: specify the chipselect in davinci_nand_pdata
  ARM: davinci: dm365-evm: specify the chipselect in davinci_nand_pdata
  ARM: davinci: dm355-leopard: specify the chipselect in davinci_nand_pdata
  ARM: davinci: dm355-evm: specify the chipselect in davinci_nand_pdata
  ARM: davinci: da850-evm: specify the chipselect in davinci_nand_pdata
  ARM: davinci: da830-evm: specify the chipselect in davinci_nand_pdata
  mtd: rawnand: davinci: store the core chipselect number in platform data
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents 3a19f20c ccfadbb7
...@@ -189,7 +189,7 @@ int davinci_aemif_setup(struct platform_device *pdev) ...@@ -189,7 +189,7 @@ int davinci_aemif_setup(struct platform_device *pdev)
* Setup Async configuration register in case we did not boot * Setup Async configuration register in case we did not boot
* from NAND and so bootloader did not bother to set it up. * 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 * Extended Wait is not valid and Select Strobe mode is not
* used * used
...@@ -198,13 +198,13 @@ int davinci_aemif_setup(struct platform_device *pdev) ...@@ -198,13 +198,13 @@ int davinci_aemif_setup(struct platform_device *pdev)
if (pdata->options & NAND_BUSWIDTH_16) if (pdata->options & NAND_BUSWIDTH_16)
val |= 0x1; 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); clkrate = clk_get_rate(clk);
if (pdata->timing) if (pdata->timing)
ret = davinci_aemif_setup_timing(pdata->timing, base, pdev->id, ret = davinci_aemif_setup_timing(pdata->timing, base,
clkrate); pdata->core_chipsel, clkrate);
if (ret < 0) if (ret < 0)
dev_dbg(&pdev->dev, "NAND timing values setup fail\n"); dev_dbg(&pdev->dev, "NAND timing values setup fail\n");
......
...@@ -310,6 +310,7 @@ static struct davinci_aemif_timing da830_evm_nandflash_timing = { ...@@ -310,6 +310,7 @@ static struct davinci_aemif_timing da830_evm_nandflash_timing = {
}; };
static struct davinci_nand_pdata da830_evm_nand_pdata = { static struct davinci_nand_pdata da830_evm_nand_pdata = {
.core_chipsel = 1,
.parts = da830_evm_nand_partitions, .parts = da830_evm_nand_partitions,
.nr_parts = ARRAY_SIZE(da830_evm_nand_partitions), .nr_parts = ARRAY_SIZE(da830_evm_nand_partitions),
.ecc_mode = NAND_ECC_HW, .ecc_mode = NAND_ECC_HW,
......
...@@ -244,6 +244,7 @@ static struct davinci_aemif_timing da850_evm_nandflash_timing = { ...@@ -244,6 +244,7 @@ static struct davinci_aemif_timing da850_evm_nandflash_timing = {
}; };
static struct davinci_nand_pdata da850_evm_nandflash_data = { static struct davinci_nand_pdata da850_evm_nandflash_data = {
.core_chipsel = 1,
.parts = da850_evm_nandflash_partition, .parts = da850_evm_nandflash_partition,
.nr_parts = ARRAY_SIZE(da850_evm_nandflash_partition), .nr_parts = ARRAY_SIZE(da850_evm_nandflash_partition),
.ecc_mode = NAND_ECC_HW, .ecc_mode = NAND_ECC_HW,
......
...@@ -77,6 +77,7 @@ static struct mtd_partition davinci_nand_partitions[] = { ...@@ -77,6 +77,7 @@ static struct mtd_partition davinci_nand_partitions[] = {
}; };
static struct davinci_nand_pdata davinci_nand_data = { static struct davinci_nand_pdata davinci_nand_data = {
.core_chipsel = 0,
.mask_chipsel = BIT(14), .mask_chipsel = BIT(14),
.parts = davinci_nand_partitions, .parts = davinci_nand_partitions,
.nr_parts = ARRAY_SIZE(davinci_nand_partitions), .nr_parts = ARRAY_SIZE(davinci_nand_partitions),
......
...@@ -72,6 +72,7 @@ static struct mtd_partition davinci_nand_partitions[] = { ...@@ -72,6 +72,7 @@ static struct mtd_partition davinci_nand_partitions[] = {
}; };
static struct davinci_nand_pdata davinci_nand_data = { static struct davinci_nand_pdata davinci_nand_data = {
.core_chipsel = 0,
.mask_chipsel = BIT(14), .mask_chipsel = BIT(14),
.parts = davinci_nand_partitions, .parts = davinci_nand_partitions,
.nr_parts = ARRAY_SIZE(davinci_nand_partitions), .nr_parts = ARRAY_SIZE(davinci_nand_partitions),
......
...@@ -138,6 +138,7 @@ static struct mtd_partition davinci_nand_partitions[] = { ...@@ -138,6 +138,7 @@ static struct mtd_partition davinci_nand_partitions[] = {
}; };
static struct davinci_nand_pdata davinci_nand_data = { static struct davinci_nand_pdata davinci_nand_data = {
.core_chipsel = 0,
.mask_chipsel = BIT(14), .mask_chipsel = BIT(14),
.parts = davinci_nand_partitions, .parts = davinci_nand_partitions,
.nr_parts = ARRAY_SIZE(davinci_nand_partitions), .nr_parts = ARRAY_SIZE(davinci_nand_partitions),
......
...@@ -152,6 +152,7 @@ static struct davinci_aemif_timing davinci_evm_nandflash_timing = { ...@@ -152,6 +152,7 @@ static struct davinci_aemif_timing davinci_evm_nandflash_timing = {
}; };
static struct davinci_nand_pdata davinci_evm_nandflash_data = { static struct davinci_nand_pdata davinci_evm_nandflash_data = {
.core_chipsel = 0,
.parts = davinci_evm_nandflash_partition, .parts = davinci_evm_nandflash_partition,
.nr_parts = ARRAY_SIZE(davinci_evm_nandflash_partition), .nr_parts = ARRAY_SIZE(davinci_evm_nandflash_partition),
.ecc_mode = NAND_ECC_HW, .ecc_mode = NAND_ECC_HW,
...@@ -768,6 +769,8 @@ static __init void davinci_evm_init(void) ...@@ -768,6 +769,8 @@ static __init void davinci_evm_init(void)
struct clk *aemif_clk; struct clk *aemif_clk;
struct davinci_soc_info *soc_info = &davinci_soc_info; struct davinci_soc_info *soc_info = &davinci_soc_info;
dm644x_init_devices();
ret = dm644x_gpio_register(); ret = dm644x_gpio_register();
if (ret) if (ret)
pr_warn("%s: GPIO init failed: %d\n", __func__, ret); pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
......
...@@ -84,6 +84,7 @@ static struct davinci_aemif_timing dm6467tevm_nandflash_timing = { ...@@ -84,6 +84,7 @@ static struct davinci_aemif_timing dm6467tevm_nandflash_timing = {
}; };
static struct davinci_nand_pdata davinci_nand_data = { static struct davinci_nand_pdata davinci_nand_data = {
.core_chipsel = 0,
.mask_cle = 0x80000, .mask_cle = 0x80000,
.mask_ale = 0x40000, .mask_ale = 0x40000,
.parts = davinci_nand_partitions, .parts = davinci_nand_partitions,
......
...@@ -400,6 +400,7 @@ static struct mtd_partition mityomapl138_nandflash_partition[] = { ...@@ -400,6 +400,7 @@ static struct mtd_partition mityomapl138_nandflash_partition[] = {
}; };
static struct davinci_nand_pdata mityomapl138_nandflash_data = { static struct davinci_nand_pdata mityomapl138_nandflash_data = {
.core_chipsel = 1,
.parts = mityomapl138_nandflash_partition, .parts = mityomapl138_nandflash_partition,
.nr_parts = ARRAY_SIZE(mityomapl138_nandflash_partition), .nr_parts = ARRAY_SIZE(mityomapl138_nandflash_partition),
.ecc_mode = NAND_ECC_HW, .ecc_mode = NAND_ECC_HW,
......
...@@ -87,6 +87,7 @@ static struct mtd_partition davinci_ntosd2_nandflash_partition[] = { ...@@ -87,6 +87,7 @@ static struct mtd_partition davinci_ntosd2_nandflash_partition[] = {
}; };
static struct davinci_nand_pdata davinci_ntosd2_nandflash_data = { static struct davinci_nand_pdata davinci_ntosd2_nandflash_data = {
.core_chipsel = 0,
.parts = davinci_ntosd2_nandflash_partition, .parts = davinci_ntosd2_nandflash_partition,
.nr_parts = ARRAY_SIZE(davinci_ntosd2_nandflash_partition), .nr_parts = ARRAY_SIZE(davinci_ntosd2_nandflash_partition),
.ecc_mode = NAND_ECC_HW, .ecc_mode = NAND_ECC_HW,
...@@ -174,6 +175,8 @@ static __init void davinci_ntosd2_init(void) ...@@ -174,6 +175,8 @@ static __init void davinci_ntosd2_init(void)
struct clk *aemif_clk; struct clk *aemif_clk;
struct davinci_soc_info *soc_info = &davinci_soc_info; struct davinci_soc_info *soc_info = &davinci_soc_info;
dm644x_init_devices();
ret = dm644x_gpio_register(); ret = dm644x_gpio_register();
if (ret) if (ret)
pr_warn("%s: GPIO init failed: %d\n", __func__, ret); pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
......
...@@ -134,6 +134,8 @@ static __init void davinci_sffsdr_init(void) ...@@ -134,6 +134,8 @@ static __init void davinci_sffsdr_init(void)
{ {
struct davinci_soc_info *soc_info = &davinci_soc_info; struct davinci_soc_info *soc_info = &davinci_soc_info;
dm644x_init_devices();
platform_add_devices(davinci_sffsdr_devices, platform_add_devices(davinci_sffsdr_devices,
ARRAY_SIZE(davinci_sffsdr_devices)); ARRAY_SIZE(davinci_sffsdr_devices));
sffsdr_init_i2c(); sffsdr_init_i2c();
......
...@@ -104,6 +104,7 @@ int dm365_gpio_register(void); ...@@ -104,6 +104,7 @@ int dm365_gpio_register(void);
/* DM644x function declarations */ /* DM644x function declarations */
void dm644x_init(void); void dm644x_init(void);
void dm644x_init_devices(void);
void dm644x_init_time(void); void dm644x_init_time(void);
void dm644x_init_asp(void); void dm644x_init_asp(void);
int dm644x_init_video(struct vpfe_config *, struct vpbe_config *); int dm644x_init_video(struct vpfe_config *, struct vpbe_config *);
......
...@@ -961,19 +961,14 @@ int __init dm644x_init_video(struct vpfe_config *vpfe_cfg, ...@@ -961,19 +961,14 @@ int __init dm644x_init_video(struct vpfe_config *vpfe_cfg,
return 0; return 0;
} }
static int __init dm644x_init_devices(void) void __init dm644x_init_devices(void)
{ {
struct platform_device *edma_pdev; struct platform_device *edma_pdev;
int ret = 0; int ret;
if (!cpu_is_davinci_dm644x())
return 0;
edma_pdev = platform_device_register_full(&dm644x_edma_device); edma_pdev = platform_device_register_full(&dm644x_edma_device);
if (IS_ERR(edma_pdev)) { if (IS_ERR(edma_pdev))
pr_warn("%s: Failed to register eDMA\n", __func__); pr_warn("%s: Failed to register eDMA\n", __func__);
return PTR_ERR(edma_pdev);
}
platform_device_register(&dm644x_mdio_device); platform_device_register(&dm644x_mdio_device);
platform_device_register(&dm644x_emac_device); platform_device_register(&dm644x_emac_device);
...@@ -982,6 +977,4 @@ static int __init dm644x_init_devices(void) ...@@ -982,6 +977,4 @@ static int __init dm644x_init_devices(void)
if (ret) if (ret)
pr_warn("%s: watchdog init failed: %d\n", __func__, ret); pr_warn("%s: watchdog init failed: %d\n", __func__, ret);
return ret;
} }
postcore_initcall(dm644x_init_devices);
...@@ -547,7 +547,7 @@ static struct davinci_nand_pdata ...@@ -547,7 +547,7 @@ static struct davinci_nand_pdata
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
if (!of_property_read_u32(pdev->dev.of_node, if (!of_property_read_u32(pdev->dev.of_node,
"ti,davinci-chipselect", &prop)) "ti,davinci-chipselect", &prop))
pdev->id = prop; pdata->core_chipsel = prop;
else else
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
...@@ -629,7 +629,7 @@ static int nand_davinci_probe(struct platform_device *pdev) ...@@ -629,7 +629,7 @@ static int nand_davinci_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
/* which external chipselect will we be managing? */ /* 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; return -ENODEV;
info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
...@@ -685,7 +685,7 @@ static int nand_davinci_probe(struct platform_device *pdev) ...@@ -685,7 +685,7 @@ static int nand_davinci_probe(struct platform_device *pdev)
info->ioaddr = (uint32_t __force) vaddr; info->ioaddr = (uint32_t __force) vaddr;
info->current_cs = info->ioaddr; info->current_cs = info->ioaddr;
info->core_chipsel = pdev->id; info->core_chipsel = pdata->core_chipsel;
info->mask_chipsel = pdata->mask_chipsel; info->mask_chipsel = pdata->mask_chipsel;
/* use nandboot-capable ALE/CLE masks by default */ /* use nandboot-capable ALE/CLE masks by default */
......
...@@ -56,6 +56,16 @@ struct davinci_nand_pdata { /* platform_data */ ...@@ -56,6 +56,16 @@ struct davinci_nand_pdata { /* platform_data */
uint32_t mask_ale; uint32_t mask_ale;
uint32_t mask_cle; 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 */ /* for packages using two chipselects */
uint32_t mask_chipsel; uint32_t mask_chipsel;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment