Commit 73efd530 authored by Linus Walleij's avatar Linus Walleij Committed by Russell King

ARM: 7519/1: integrator: convert platform devices to Device Tree

This moves the physmap flash and SMSC91x ethernet devices
over to the device tree, moving the static board code down
into the #ifndef CONFIG_OF section.
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 4672cddf
...@@ -31,6 +31,11 @@ pic@14000000 { ...@@ -31,6 +31,11 @@ pic@14000000 {
clear-mask = <0xffffffff>; clear-mask = <0xffffffff>;
}; };
flash@24000000 {
compatible = "cfi-flash";
reg = <0x24000000 0x02000000>;
};
fpga { fpga {
compatible = "arm,amba-bus", "simple-bus"; compatible = "arm,amba-bus", "simple-bus";
#address-cells = <1>; #address-cells = <1>;
......
...@@ -52,6 +52,13 @@ sic: sic@ca000000 { ...@@ -52,6 +52,13 @@ sic: sic@ca000000 {
valid-mask = <0x00000fff>; valid-mask = <0x00000fff>;
}; };
ethernet@c8000000 {
compatible = "smsc,lan91c111";
reg = <0xc8000000 0x10>;
interrupt-parent = <&pic>;
interrupts = <27>;
};
fpga { fpga {
/* /*
* These PrimeCells are at the same location and using * These PrimeCells are at the same location and using
......
...@@ -256,22 +256,6 @@ static struct physmap_flash_data ap_flash_data = { ...@@ -256,22 +256,6 @@ static struct physmap_flash_data ap_flash_data = {
.set_vpp = ap_flash_set_vpp, .set_vpp = ap_flash_set_vpp,
}; };
static struct resource cfi_flash_resource = {
.start = INTEGRATOR_FLASH_BASE,
.end = INTEGRATOR_FLASH_BASE + INTEGRATOR_FLASH_SIZE - 1,
.flags = IORESOURCE_MEM,
};
static struct platform_device cfi_flash_device = {
.name = "physmap-flash",
.id = 0,
.dev = {
.platform_data = &ap_flash_data,
},
.num_resources = 1,
.resource = &cfi_flash_resource,
};
/* /*
* Where is the timer (VA)? * Where is the timer (VA)?
*/ */
...@@ -476,6 +460,8 @@ static struct of_dev_auxdata ap_auxdata_lookup[] __initdata = { ...@@ -476,6 +460,8 @@ static struct of_dev_auxdata ap_auxdata_lookup[] __initdata = {
"kmi0", NULL), "kmi0", NULL),
OF_DEV_AUXDATA("arm,primecell", KMI1_BASE, OF_DEV_AUXDATA("arm,primecell", KMI1_BASE,
"kmi1", NULL), "kmi1", NULL),
OF_DEV_AUXDATA("cfi-flash", INTEGRATOR_FLASH_BASE,
"physmap-flash", &ap_flash_data),
{ /* sentinel */ }, { /* sentinel */ },
}; };
...@@ -487,8 +473,6 @@ static void __init ap_init_of(void) ...@@ -487,8 +473,6 @@ static void __init ap_init_of(void)
of_platform_populate(NULL, of_default_bus_match_table, of_platform_populate(NULL, of_default_bus_match_table,
ap_auxdata_lookup, NULL); ap_auxdata_lookup, NULL);
platform_device_register(&cfi_flash_device);
sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET); sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET);
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
struct lm_device *lmdev; struct lm_device *lmdev;
...@@ -537,6 +521,22 @@ MACHINE_END ...@@ -537,6 +521,22 @@ MACHINE_END
* for eventual deletion. * for eventual deletion.
*/ */
static struct resource cfi_flash_resource = {
.start = INTEGRATOR_FLASH_BASE,
.end = INTEGRATOR_FLASH_BASE + INTEGRATOR_FLASH_SIZE - 1,
.flags = IORESOURCE_MEM,
};
static struct platform_device cfi_flash_device = {
.name = "physmap-flash",
.id = 0,
.dev = {
.platform_data = &ap_flash_data,
},
.num_resources = 1,
.resource = &cfi_flash_resource,
};
static void __init ap_init_timer(void) static void __init ap_init_timer(void)
{ {
struct clk *clk; struct clk *clk;
......
...@@ -52,12 +52,9 @@ ...@@ -52,12 +52,9 @@
#include "common.h" #include "common.h"
#define INTCP_PA_FLASH_BASE 0x24000000 #define INTCP_PA_FLASH_BASE 0x24000000
#define INTCP_FLASH_SIZE SZ_32M
#define INTCP_PA_CLCD_BASE 0xc0000000 #define INTCP_PA_CLCD_BASE 0xc0000000
#define INTCP_ETH_SIZE 0x10
#define INTCP_VA_CTRL_BASE IO_ADDRESS(INTEGRATOR_CP_CTL_BASE) #define INTCP_VA_CTRL_BASE IO_ADDRESS(INTEGRATOR_CP_CTL_BASE)
#define INTCP_FLASHPROG 0x04 #define INTCP_FLASHPROG 0x04
#define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0) #define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0)
...@@ -184,47 +181,6 @@ static struct physmap_flash_data intcp_flash_data = { ...@@ -184,47 +181,6 @@ static struct physmap_flash_data intcp_flash_data = {
.set_vpp = intcp_flash_set_vpp, .set_vpp = intcp_flash_set_vpp,
}; };
static struct resource intcp_flash_resource = {
.start = INTCP_PA_FLASH_BASE,
.end = INTCP_PA_FLASH_BASE + INTCP_FLASH_SIZE - 1,
.flags = IORESOURCE_MEM,
};
static struct platform_device intcp_flash_device = {
.name = "physmap-flash",
.id = 0,
.dev = {
.platform_data = &intcp_flash_data,
},
.num_resources = 1,
.resource = &intcp_flash_resource,
};
static struct resource smc91x_resources[] = {
[0] = {
.start = INTEGRATOR_CP_ETH_BASE,
.end = INTEGRATOR_CP_ETH_BASE + INTCP_ETH_SIZE - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_CP_ETHINT,
.end = IRQ_CP_ETHINT,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device smc91x_device = {
.name = "smc91x",
.id = 0,
.num_resources = ARRAY_SIZE(smc91x_resources),
.resource = smc91x_resources,
};
static struct platform_device *intcp_devs[] __initdata = {
&intcp_flash_device,
&smc91x_device,
};
/* /*
* It seems that the card insertion interrupt remains active after * It seems that the card insertion interrupt remains active after
* we've acknowledged it. We therefore ignore the interrupt, and * we've acknowledged it. We therefore ignore the interrupt, and
...@@ -375,6 +331,8 @@ static struct of_dev_auxdata intcp_auxdata_lookup[] __initdata = { ...@@ -375,6 +331,8 @@ static struct of_dev_auxdata intcp_auxdata_lookup[] __initdata = {
"aaci", &mmc_data), "aaci", &mmc_data),
OF_DEV_AUXDATA("arm,primecell", INTCP_PA_CLCD_BASE, OF_DEV_AUXDATA("arm,primecell", INTCP_PA_CLCD_BASE,
"clcd", &clcd_data), "clcd", &clcd_data),
OF_DEV_AUXDATA("cfi-flash", INTCP_PA_FLASH_BASE,
"physmap-flash", &intcp_flash_data),
{ /* sentinel */ }, { /* sentinel */ },
}; };
...@@ -382,7 +340,6 @@ static void __init intcp_init_of(void) ...@@ -382,7 +340,6 @@ static void __init intcp_init_of(void)
{ {
of_platform_populate(NULL, of_default_bus_match_table, of_platform_populate(NULL, of_default_bus_match_table,
intcp_auxdata_lookup, NULL); intcp_auxdata_lookup, NULL);
platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs));
} }
static const char * intcp_dt_board_compat[] = { static const char * intcp_dt_board_compat[] = {
...@@ -412,6 +369,51 @@ MACHINE_END ...@@ -412,6 +369,51 @@ MACHINE_END
* for eventual deletion. * for eventual deletion.
*/ */
#define INTCP_FLASH_SIZE SZ_32M
static struct resource intcp_flash_resource = {
.start = INTCP_PA_FLASH_BASE,
.end = INTCP_PA_FLASH_BASE + INTCP_FLASH_SIZE - 1,
.flags = IORESOURCE_MEM,
};
static struct platform_device intcp_flash_device = {
.name = "physmap-flash",
.id = 0,
.dev = {
.platform_data = &intcp_flash_data,
},
.num_resources = 1,
.resource = &intcp_flash_resource,
};
#define INTCP_ETH_SIZE 0x10
static struct resource smc91x_resources[] = {
[0] = {
.start = INTEGRATOR_CP_ETH_BASE,
.end = INTEGRATOR_CP_ETH_BASE + INTCP_ETH_SIZE - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_CP_ETHINT,
.end = IRQ_CP_ETHINT,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device smc91x_device = {
.name = "smc91x",
.id = 0,
.num_resources = ARRAY_SIZE(smc91x_resources),
.resource = smc91x_resources,
};
static struct platform_device *intcp_devs[] __initdata = {
&intcp_flash_device,
&smc91x_device,
};
#define INTCP_VA_CIC_BASE __io_address(INTEGRATOR_HDR_BASE + 0x40) #define INTCP_VA_CIC_BASE __io_address(INTEGRATOR_HDR_BASE + 0x40)
#define INTCP_VA_PIC_BASE __io_address(INTEGRATOR_IC_BASE) #define INTCP_VA_PIC_BASE __io_address(INTEGRATOR_IC_BASE)
#define INTCP_VA_SIC_BASE __io_address(INTEGRATOR_CP_SIC_BASE) #define INTCP_VA_SIC_BASE __io_address(INTEGRATOR_CP_SIC_BASE)
......
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