Commit 71885b65 authored by Sascha Hauer's avatar Sascha Hauer Committed by David Woodhouse

mtd: mxc_nand: swap iomem resource order

The i.MX v3 nand controller (i.MX5) needs two memory resources.
Traditionally we have the AXI resource first. For sorting in this
driver into the devicetree it feels much more natural to have the
IP resource first. This patch swaps the ordering of these two
resources.
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent e4a09cbf
...@@ -63,10 +63,6 @@ struct platform_device *__init imx_add_mxc_nand( ...@@ -63,10 +63,6 @@ struct platform_device *__init imx_add_mxc_nand(
/* AXI has to come first, that's how the mxc_nand driver expect it */ /* AXI has to come first, that's how the mxc_nand driver expect it */
struct resource res[] = { struct resource res[] = {
{ {
.start = data->axibase,
.end = data->axibase + SZ_16K - 1,
.flags = IORESOURCE_MEM,
}, {
.start = data->iobase, .start = data->iobase,
.end = data->iobase + data->iosize - 1, .end = data->iobase + data->iosize - 1,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
...@@ -74,10 +70,13 @@ struct platform_device *__init imx_add_mxc_nand( ...@@ -74,10 +70,13 @@ struct platform_device *__init imx_add_mxc_nand(
.start = data->irq, .start = data->irq,
.end = data->irq, .end = data->irq,
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
}, {
.start = data->axibase,
.end = data->axibase + SZ_16K - 1,
.flags = IORESOURCE_MEM,
}, },
}; };
return imx_add_platform_device("mxc_nand", data->id, return imx_add_platform_device("mxc_nand", data->id,
res + !data->axibase, res, ARRAY_SIZE(res) - !data->axibase,
ARRAY_SIZE(res) - !data->axibase,
pdata, sizeof(*pdata)); pdata, sizeof(*pdata));
} }
...@@ -1376,7 +1376,25 @@ static int __init mxcnd_probe(struct platform_device *pdev) ...@@ -1376,7 +1376,25 @@ static int __init mxcnd_probe(struct platform_device *pdev)
if (IS_ERR(host->clk)) if (IS_ERR(host->clk))
return PTR_ERR(host->clk); return PTR_ERR(host->clk);
err = mxcnd_probe_dt(host);
if (err > 0)
err = mxcnd_probe_pdata(host);
if (err < 0)
return err;
if (host->devtype_data->needs_ip) {
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENODEV;
host->regs_ip = devm_request_and_ioremap(&pdev->dev, res);
if (!host->regs_ip)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
} else {
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
}
if (!res) if (!res)
return -ENODEV; return -ENODEV;
...@@ -1386,12 +1404,6 @@ static int __init mxcnd_probe(struct platform_device *pdev) ...@@ -1386,12 +1404,6 @@ static int __init mxcnd_probe(struct platform_device *pdev)
host->main_area0 = host->base; host->main_area0 = host->base;
err = mxcnd_probe_dt(host);
if (err > 0)
err = mxcnd_probe_pdata(host);
if (err < 0)
return err;
if (host->devtype_data->regs_offset) if (host->devtype_data->regs_offset)
host->regs = host->base + host->devtype_data->regs_offset; host->regs = host->base + host->devtype_data->regs_offset;
host->spare0 = host->base + host->devtype_data->spare0_offset; host->spare0 = host->base + host->devtype_data->spare0_offset;
...@@ -1405,15 +1417,6 @@ static int __init mxcnd_probe(struct platform_device *pdev) ...@@ -1405,15 +1417,6 @@ static int __init mxcnd_probe(struct platform_device *pdev)
this->ecc.size = 512; this->ecc.size = 512;
this->ecc.layout = host->devtype_data->ecclayout_512; this->ecc.layout = host->devtype_data->ecclayout_512;
if (host->devtype_data->needs_ip) {
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!res)
return -ENODEV;
host->regs_ip = devm_request_and_ioremap(&pdev->dev, res);
if (!host->regs_ip)
return -ENOMEM;
}
if (host->pdata.hw_ecc) { if (host->pdata.hw_ecc) {
this->ecc.calculate = mxc_nand_calculate_ecc; this->ecc.calculate = mxc_nand_calculate_ecc;
this->ecc.hwctl = mxc_nand_enable_hwecc; this->ecc.hwctl = mxc_nand_enable_hwecc;
......
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