diff options
| author | Linus Walleij <linus.walleij@linaro.org> | 2012-09-06 04:09:11 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-09-17 18:20:23 -0400 |
| commit | 73efd53012af7775a4504da46ebf4145528d50e7 (patch) | |
| tree | 5a287cbba28ac33007223a21e9846b57979bdb87 | |
| parent | 4672cddff21f6edde857aa4b523bbc1bfc741cf8 (diff) | |
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: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
| -rw-r--r-- | arch/arm/boot/dts/integrator.dtsi | 5 | ||||
| -rw-r--r-- | arch/arm/boot/dts/integratorcp.dts | 7 | ||||
| -rw-r--r-- | arch/arm/mach-integrator/integrator_ap.c | 36 | ||||
| -rw-r--r-- | arch/arm/mach-integrator/integrator_cp.c | 92 |
4 files changed, 77 insertions, 63 deletions
diff --git a/arch/arm/boot/dts/integrator.dtsi b/arch/arm/boot/dts/integrator.dtsi index 9bcc09d54457..813b91d7bea2 100644 --- a/arch/arm/boot/dts/integrator.dtsi +++ b/arch/arm/boot/dts/integrator.dtsi | |||
| @@ -31,6 +31,11 @@ | |||
| 31 | clear-mask = <0xffffffff>; | 31 | clear-mask = <0xffffffff>; |
| 32 | }; | 32 | }; |
| 33 | 33 | ||
| 34 | flash@24000000 { | ||
| 35 | compatible = "cfi-flash"; | ||
| 36 | reg = <0x24000000 0x02000000>; | ||
| 37 | }; | ||
| 38 | |||
| 34 | fpga { | 39 | fpga { |
| 35 | compatible = "arm,amba-bus", "simple-bus"; | 40 | compatible = "arm,amba-bus", "simple-bus"; |
| 36 | #address-cells = <1>; | 41 | #address-cells = <1>; |
diff --git a/arch/arm/boot/dts/integratorcp.dts b/arch/arm/boot/dts/integratorcp.dts index 7bd49466cb0d..2dd5e4e48481 100644 --- a/arch/arm/boot/dts/integratorcp.dts +++ b/arch/arm/boot/dts/integratorcp.dts | |||
| @@ -52,6 +52,13 @@ | |||
| 52 | valid-mask = <0x00000fff>; | 52 | valid-mask = <0x00000fff>; |
| 53 | }; | 53 | }; |
| 54 | 54 | ||
| 55 | ethernet@c8000000 { | ||
| 56 | compatible = "smsc,lan91c111"; | ||
| 57 | reg = <0xc8000000 0x10>; | ||
| 58 | interrupt-parent = <&pic>; | ||
| 59 | interrupts = <27>; | ||
| 60 | }; | ||
| 61 | |||
| 55 | fpga { | 62 | fpga { |
| 56 | /* | 63 | /* |
| 57 | * These PrimeCells are at the same location and using | 64 | * These PrimeCells are at the same location and using |
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index 8cd05607435a..ff1255ae7121 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c | |||
| @@ -256,22 +256,6 @@ static struct physmap_flash_data ap_flash_data = { | |||
| 256 | .set_vpp = ap_flash_set_vpp, | 256 | .set_vpp = ap_flash_set_vpp, |
| 257 | }; | 257 | }; |
| 258 | 258 | ||
| 259 | static struct resource cfi_flash_resource = { | ||
| 260 | .start = INTEGRATOR_FLASH_BASE, | ||
| 261 | .end = INTEGRATOR_FLASH_BASE + INTEGRATOR_FLASH_SIZE - 1, | ||
| 262 | .flags = IORESOURCE_MEM, | ||
| 263 | }; | ||
| 264 | |||
| 265 | static struct platform_device cfi_flash_device = { | ||
| 266 | .name = "physmap-flash", | ||
| 267 | .id = 0, | ||
| 268 | .dev = { | ||
| 269 | .platform_data = &ap_flash_data, | ||
| 270 | }, | ||
| 271 | .num_resources = 1, | ||
| 272 | .resource = &cfi_flash_resource, | ||
| 273 | }; | ||
| 274 | |||
| 275 | /* | 259 | /* |
| 276 | * Where is the timer (VA)? | 260 | * Where is the timer (VA)? |
| 277 | */ | 261 | */ |
| @@ -476,6 +460,8 @@ static struct of_dev_auxdata ap_auxdata_lookup[] __initdata = { | |||
| 476 | "kmi0", NULL), | 460 | "kmi0", NULL), |
| 477 | OF_DEV_AUXDATA("arm,primecell", KMI1_BASE, | 461 | OF_DEV_AUXDATA("arm,primecell", KMI1_BASE, |
| 478 | "kmi1", NULL), | 462 | "kmi1", NULL), |
| 463 | OF_DEV_AUXDATA("cfi-flash", INTEGRATOR_FLASH_BASE, | ||
| 464 | "physmap-flash", &ap_flash_data), | ||
| 479 | { /* sentinel */ }, | 465 | { /* sentinel */ }, |
| 480 | }; | 466 | }; |
| 481 | 467 | ||
| @@ -487,8 +473,6 @@ static void __init ap_init_of(void) | |||
| 487 | of_platform_populate(NULL, of_default_bus_match_table, | 473 | of_platform_populate(NULL, of_default_bus_match_table, |
| 488 | ap_auxdata_lookup, NULL); | 474 | ap_auxdata_lookup, NULL); |
| 489 | 475 | ||
| 490 | platform_device_register(&cfi_flash_device); | ||
| 491 | |||
| 492 | sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET); | 476 | sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET); |
| 493 | for (i = 0; i < 4; i++) { | 477 | for (i = 0; i < 4; i++) { |
| 494 | struct lm_device *lmdev; | 478 | struct lm_device *lmdev; |
| @@ -537,6 +521,22 @@ MACHINE_END | |||
| 537 | * for eventual deletion. | 521 | * for eventual deletion. |
| 538 | */ | 522 | */ |
| 539 | 523 | ||
| 524 | static struct resource cfi_flash_resource = { | ||
| 525 | .start = INTEGRATOR_FLASH_BASE, | ||
| 526 | .end = INTEGRATOR_FLASH_BASE + INTEGRATOR_FLASH_SIZE - 1, | ||
| 527 | .flags = IORESOURCE_MEM, | ||
| 528 | }; | ||
| 529 | |||
| 530 | static struct platform_device cfi_flash_device = { | ||
| 531 | .name = "physmap-flash", | ||
| 532 | .id = 0, | ||
| 533 | .dev = { | ||
| 534 | .platform_data = &ap_flash_data, | ||
| 535 | }, | ||
| 536 | .num_resources = 1, | ||
| 537 | .resource = &cfi_flash_resource, | ||
| 538 | }; | ||
| 539 | |||
| 540 | static void __init ap_init_timer(void) | 540 | static void __init ap_init_timer(void) |
| 541 | { | 541 | { |
| 542 | struct clk *clk; | 542 | struct clk *clk; |
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index f032238c1f9f..f51363e2d6fe 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c | |||
| @@ -52,12 +52,9 @@ | |||
| 52 | #include "common.h" | 52 | #include "common.h" |
| 53 | 53 | ||
| 54 | #define INTCP_PA_FLASH_BASE 0x24000000 | 54 | #define INTCP_PA_FLASH_BASE 0x24000000 |
| 55 | #define INTCP_FLASH_SIZE SZ_32M | ||
| 56 | 55 | ||
| 57 | #define INTCP_PA_CLCD_BASE 0xc0000000 | 56 | #define INTCP_PA_CLCD_BASE 0xc0000000 |
| 58 | 57 | ||
| 59 | #define INTCP_ETH_SIZE 0x10 | ||
| 60 | |||
| 61 | #define INTCP_VA_CTRL_BASE IO_ADDRESS(INTEGRATOR_CP_CTL_BASE) | 58 | #define INTCP_VA_CTRL_BASE IO_ADDRESS(INTEGRATOR_CP_CTL_BASE) |
| 62 | #define INTCP_FLASHPROG 0x04 | 59 | #define INTCP_FLASHPROG 0x04 |
| 63 | #define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0) | 60 | #define CINTEGRATOR_FLASHPROG_FLVPPEN (1 << 0) |
| @@ -184,47 +181,6 @@ static struct physmap_flash_data intcp_flash_data = { | |||
| 184 | .set_vpp = intcp_flash_set_vpp, | 181 | .set_vpp = intcp_flash_set_vpp, |
| 185 | }; | 182 | }; |
| 186 | 183 | ||
| 187 | static struct resource intcp_flash_resource = { | ||
| 188 | .start = INTCP_PA_FLASH_BASE, | ||
| 189 | .end = INTCP_PA_FLASH_BASE + INTCP_FLASH_SIZE - 1, | ||
| 190 | .flags = IORESOURCE_MEM, | ||
| 191 | }; | ||
| 192 | |||
| 193 | static struct platform_device intcp_flash_device = { | ||
| 194 | .name = "physmap-flash", | ||
| 195 | .id = 0, | ||
| 196 | .dev = { | ||
| 197 | .platform_data = &intcp_flash_data, | ||
| 198 | }, | ||
| 199 | .num_resources = 1, | ||
| 200 | .resource = &intcp_flash_resource, | ||
| 201 | }; | ||
| 202 | |||
| 203 | static struct resource smc91x_resources[] = { | ||
| 204 | [0] = { | ||
| 205 | .start = INTEGRATOR_CP_ETH_BASE, | ||
| 206 | .end = INTEGRATOR_CP_ETH_BASE + INTCP_ETH_SIZE - 1, | ||
| 207 | .flags = IORESOURCE_MEM, | ||
| 208 | }, | ||
| 209 | [1] = { | ||
| 210 | .start = IRQ_CP_ETHINT, | ||
| 211 | .end = IRQ_CP_ETHINT, | ||
| 212 | .flags = IORESOURCE_IRQ, | ||
| 213 | }, | ||
| 214 | }; | ||
| 215 | |||
| 216 | static struct platform_device smc91x_device = { | ||
| 217 | .name = "smc91x", | ||
| 218 | .id = 0, | ||
| 219 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
| 220 | .resource = smc91x_resources, | ||
| 221 | }; | ||
| 222 | |||
| 223 | static struct platform_device *intcp_devs[] __initdata = { | ||
| 224 | &intcp_flash_device, | ||
| 225 | &smc91x_device, | ||
| 226 | }; | ||
| 227 | |||
| 228 | /* | 184 | /* |
| 229 | * It seems that the card insertion interrupt remains active after | 185 | * It seems that the card insertion interrupt remains active after |
| 230 | * we've acknowledged it. We therefore ignore the interrupt, and | 186 | * we've acknowledged it. We therefore ignore the interrupt, and |
| @@ -375,6 +331,8 @@ static struct of_dev_auxdata intcp_auxdata_lookup[] __initdata = { | |||
| 375 | "aaci", &mmc_data), | 331 | "aaci", &mmc_data), |
| 376 | OF_DEV_AUXDATA("arm,primecell", INTCP_PA_CLCD_BASE, | 332 | OF_DEV_AUXDATA("arm,primecell", INTCP_PA_CLCD_BASE, |
| 377 | "clcd", &clcd_data), | 333 | "clcd", &clcd_data), |
| 334 | OF_DEV_AUXDATA("cfi-flash", INTCP_PA_FLASH_BASE, | ||
| 335 | "physmap-flash", &intcp_flash_data), | ||
| 378 | { /* sentinel */ }, | 336 | { /* sentinel */ }, |
| 379 | }; | 337 | }; |
| 380 | 338 | ||
| @@ -382,7 +340,6 @@ static void __init intcp_init_of(void) | |||
| 382 | { | 340 | { |
| 383 | of_platform_populate(NULL, of_default_bus_match_table, | 341 | of_platform_populate(NULL, of_default_bus_match_table, |
| 384 | intcp_auxdata_lookup, NULL); | 342 | intcp_auxdata_lookup, NULL); |
| 385 | platform_add_devices(intcp_devs, ARRAY_SIZE(intcp_devs)); | ||
| 386 | } | 343 | } |
| 387 | 344 | ||
| 388 | static const char * intcp_dt_board_compat[] = { | 345 | static const char * intcp_dt_board_compat[] = { |
| @@ -412,6 +369,51 @@ MACHINE_END | |||
| 412 | * for eventual deletion. | 369 | * for eventual deletion. |
| 413 | */ | 370 | */ |
| 414 | 371 | ||
| 372 | #define INTCP_FLASH_SIZE SZ_32M | ||
| 373 | |||
| 374 | static struct resource intcp_flash_resource = { | ||
| 375 | .start = INTCP_PA_FLASH_BASE, | ||
| 376 | .end = INTCP_PA_FLASH_BASE + INTCP_FLASH_SIZE - 1, | ||
| 377 | .flags = IORESOURCE_MEM, | ||
| 378 | }; | ||
| 379 | |||
| 380 | static struct platform_device intcp_flash_device = { | ||
| 381 | .name = "physmap-flash", | ||
| 382 | .id = 0, | ||
| 383 | .dev = { | ||
| 384 | .platform_data = &intcp_flash_data, | ||
| 385 | }, | ||
| 386 | .num_resources = 1, | ||
| 387 | .resource = &intcp_flash_resource, | ||
| 388 | }; | ||
| 389 | |||
| 390 | #define INTCP_ETH_SIZE 0x10 | ||
| 391 | |||
| 392 | static struct resource smc91x_resources[] = { | ||
| 393 | [0] = { | ||
| 394 | .start = INTEGRATOR_CP_ETH_BASE, | ||
| 395 | .end = INTEGRATOR_CP_ETH_BASE + INTCP_ETH_SIZE - 1, | ||
| 396 | .flags = IORESOURCE_MEM, | ||
| 397 | }, | ||
| 398 | [1] = { | ||
| 399 | .start = IRQ_CP_ETHINT, | ||
| 400 | .end = IRQ_CP_ETHINT, | ||
| 401 | .flags = IORESOURCE_IRQ, | ||
| 402 | }, | ||
| 403 | }; | ||
| 404 | |||
| 405 | static struct platform_device smc91x_device = { | ||
| 406 | .name = "smc91x", | ||
| 407 | .id = 0, | ||
| 408 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
| 409 | .resource = smc91x_resources, | ||
| 410 | }; | ||
| 411 | |||
| 412 | static struct platform_device *intcp_devs[] __initdata = { | ||
| 413 | &intcp_flash_device, | ||
| 414 | &smc91x_device, | ||
| 415 | }; | ||
| 416 | |||
| 415 | #define INTCP_VA_CIC_BASE __io_address(INTEGRATOR_HDR_BASE + 0x40) | 417 | #define INTCP_VA_CIC_BASE __io_address(INTEGRATOR_HDR_BASE + 0x40) |
| 416 | #define INTCP_VA_PIC_BASE __io_address(INTEGRATOR_IC_BASE) | 418 | #define INTCP_VA_PIC_BASE __io_address(INTEGRATOR_IC_BASE) |
| 417 | #define INTCP_VA_SIC_BASE __io_address(INTEGRATOR_CP_SIC_BASE) | 419 | #define INTCP_VA_SIC_BASE __io_address(INTEGRATOR_CP_SIC_BASE) |
