diff options
| -rw-r--r-- | arch/arm/mach-integrator/integrator_ap.c | 58 |
1 files changed, 38 insertions, 20 deletions
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index 7d84080f9aa3..becba430a246 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c | |||
| @@ -62,7 +62,10 @@ | |||
| 62 | 62 | ||
| 63 | #include "common.h" | 63 | #include "common.h" |
| 64 | 64 | ||
| 65 | /* | 65 | /* Base address to the AP system controller */ |
| 66 | static void __iomem *ap_syscon_base; | ||
| 67 | |||
| 68 | /* | ||
| 66 | * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx | 69 | * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx |
| 67 | * is the (PA >> 12). | 70 | * is the (PA >> 12). |
| 68 | * | 71 | * |
| @@ -70,7 +73,6 @@ | |||
| 70 | * just for now). | 73 | * just for now). |
| 71 | */ | 74 | */ |
| 72 | #define VA_IC_BASE __io_address(INTEGRATOR_IC_BASE) | 75 | #define VA_IC_BASE __io_address(INTEGRATOR_IC_BASE) |
| 73 | #define VA_SC_BASE __io_address(INTEGRATOR_SC_BASE) | ||
| 74 | #define VA_EBI_BASE __io_address(INTEGRATOR_EBI_BASE) | 76 | #define VA_EBI_BASE __io_address(INTEGRATOR_EBI_BASE) |
| 75 | #define VA_CMIC_BASE __io_address(INTEGRATOR_HDR_IC) | 77 | #define VA_CMIC_BASE __io_address(INTEGRATOR_HDR_IC) |
| 76 | 78 | ||
| @@ -99,11 +101,6 @@ static struct map_desc ap_io_desc[] __initdata = { | |||
| 99 | .length = SZ_4K, | 101 | .length = SZ_4K, |
| 100 | .type = MT_DEVICE | 102 | .type = MT_DEVICE |
| 101 | }, { | 103 | }, { |
| 102 | .virtual = IO_ADDRESS(INTEGRATOR_SC_BASE), | ||
| 103 | .pfn = __phys_to_pfn(INTEGRATOR_SC_BASE), | ||
| 104 | .length = SZ_4K, | ||
| 105 | .type = MT_DEVICE | ||
| 106 | }, { | ||
| 107 | .virtual = IO_ADDRESS(INTEGRATOR_EBI_BASE), | 104 | .virtual = IO_ADDRESS(INTEGRATOR_EBI_BASE), |
| 108 | .pfn = __phys_to_pfn(INTEGRATOR_EBI_BASE), | 105 | .pfn = __phys_to_pfn(INTEGRATOR_EBI_BASE), |
| 109 | .length = SZ_4K, | 106 | .length = SZ_4K, |
| @@ -203,8 +200,6 @@ device_initcall(irq_syscore_init); | |||
| 203 | /* | 200 | /* |
| 204 | * Flash handling. | 201 | * Flash handling. |
| 205 | */ | 202 | */ |
| 206 | #define SC_CTRLC (VA_SC_BASE + INTEGRATOR_SC_CTRLC_OFFSET) | ||
| 207 | #define SC_CTRLS (VA_SC_BASE + INTEGRATOR_SC_CTRLS_OFFSET) | ||
| 208 | #define EBI_CSR1 (VA_EBI_BASE + INTEGRATOR_EBI_CSR1_OFFSET) | 203 | #define EBI_CSR1 (VA_EBI_BASE + INTEGRATOR_EBI_CSR1_OFFSET) |
| 209 | #define EBI_LOCK (VA_EBI_BASE + INTEGRATOR_EBI_LOCK_OFFSET) | 204 | #define EBI_LOCK (VA_EBI_BASE + INTEGRATOR_EBI_LOCK_OFFSET) |
| 210 | 205 | ||
| @@ -212,7 +207,8 @@ static int ap_flash_init(struct platform_device *dev) | |||
| 212 | { | 207 | { |
| 213 | u32 tmp; | 208 | u32 tmp; |
| 214 | 209 | ||
| 215 | writel(INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP, SC_CTRLC); | 210 | writel(INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP, |
| 211 | ap_syscon_base + INTEGRATOR_SC_CTRLC_OFFSET); | ||
| 216 | 212 | ||
| 217 | tmp = readl(EBI_CSR1) | INTEGRATOR_EBI_WRITE_ENABLE; | 213 | tmp = readl(EBI_CSR1) | INTEGRATOR_EBI_WRITE_ENABLE; |
| 218 | writel(tmp, EBI_CSR1); | 214 | writel(tmp, EBI_CSR1); |
| @@ -229,7 +225,8 @@ static void ap_flash_exit(struct platform_device *dev) | |||
| 229 | { | 225 | { |
| 230 | u32 tmp; | 226 | u32 tmp; |
| 231 | 227 | ||
| 232 | writel(INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP, SC_CTRLC); | 228 | writel(INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP, |
| 229 | ap_syscon_base + INTEGRATOR_SC_CTRLC_OFFSET); | ||
| 233 | 230 | ||
| 234 | tmp = readl(EBI_CSR1) & ~INTEGRATOR_EBI_WRITE_ENABLE; | 231 | tmp = readl(EBI_CSR1) & ~INTEGRATOR_EBI_WRITE_ENABLE; |
| 235 | writel(tmp, EBI_CSR1); | 232 | writel(tmp, EBI_CSR1); |
| @@ -243,9 +240,12 @@ static void ap_flash_exit(struct platform_device *dev) | |||
| 243 | 240 | ||
| 244 | static void ap_flash_set_vpp(struct platform_device *pdev, int on) | 241 | static void ap_flash_set_vpp(struct platform_device *pdev, int on) |
| 245 | { | 242 | { |
| 246 | void __iomem *reg = on ? SC_CTRLS : SC_CTRLC; | 243 | if (on) |
| 247 | 244 | writel(INTEGRATOR_SC_CTRL_nFLVPPEN, | |
| 248 | writel(INTEGRATOR_SC_CTRL_nFLVPPEN, reg); | 245 | ap_syscon_base + INTEGRATOR_SC_CTRLS_OFFSET); |
| 246 | else | ||
| 247 | writel(INTEGRATOR_SC_CTRL_nFLVPPEN, | ||
| 248 | ap_syscon_base + INTEGRATOR_SC_CTRLC_OFFSET); | ||
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | static struct physmap_flash_data ap_flash_data = { | 251 | static struct physmap_flash_data ap_flash_data = { |
| @@ -464,9 +464,6 @@ static struct of_dev_auxdata ap_auxdata_lookup[] __initdata = { | |||
| 464 | { /* sentinel */ }, | 464 | { /* sentinel */ }, |
| 465 | }; | 465 | }; |
| 466 | 466 | ||
| 467 | /* Base address to the AP system controller */ | ||
| 468 | static void __iomem *ap_syscon_base; | ||
| 469 | |||
| 470 | static void __init ap_init_of(void) | 467 | static void __init ap_init_of(void) |
| 471 | { | 468 | { |
| 472 | unsigned long sc_dec; | 469 | unsigned long sc_dec; |
| @@ -523,7 +520,7 @@ static void __init ap_init_of(void) | |||
| 523 | of_platform_populate(root, of_default_bus_match_table, | 520 | of_platform_populate(root, of_default_bus_match_table, |
| 524 | ap_auxdata_lookup, parent); | 521 | ap_auxdata_lookup, parent); |
| 525 | 522 | ||
| 526 | sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET); | 523 | sc_dec = readl(ap_syscon_base + INTEGRATOR_SC_DEC_OFFSET); |
| 527 | for (i = 0; i < 4; i++) { | 524 | for (i = 0; i < 4; i++) { |
| 528 | struct lm_device *lmdev; | 525 | struct lm_device *lmdev; |
| 529 | 526 | ||
| @@ -567,6 +564,27 @@ MACHINE_END | |||
| 567 | #ifdef CONFIG_ATAGS | 564 | #ifdef CONFIG_ATAGS |
| 568 | 565 | ||
| 569 | /* | 566 | /* |
| 567 | * For the ATAG boot some static mappings are needed. This will | ||
| 568 | * go away with the ATAG support down the road. | ||
| 569 | */ | ||
| 570 | |||
| 571 | static struct map_desc ap_io_desc_atag[] __initdata = { | ||
| 572 | { | ||
| 573 | .virtual = IO_ADDRESS(INTEGRATOR_SC_BASE), | ||
| 574 | .pfn = __phys_to_pfn(INTEGRATOR_SC_BASE), | ||
| 575 | .length = SZ_4K, | ||
| 576 | .type = MT_DEVICE | ||
| 577 | }, | ||
| 578 | }; | ||
| 579 | |||
| 580 | static void __init ap_map_io_atag(void) | ||
| 581 | { | ||
| 582 | iotable_init(ap_io_desc_atag, ARRAY_SIZE(ap_io_desc_atag)); | ||
| 583 | ap_syscon_base = __io_address(INTEGRATOR_SC_BASE); | ||
| 584 | ap_map_io(); | ||
| 585 | } | ||
| 586 | |||
| 587 | /* | ||
| 570 | * This is where non-devicetree initialization code is collected and stashed | 588 | * This is where non-devicetree initialization code is collected and stashed |
| 571 | * for eventual deletion. | 589 | * for eventual deletion. |
| 572 | */ | 590 | */ |
| @@ -634,7 +652,7 @@ static void __init ap_init(void) | |||
| 634 | 652 | ||
| 635 | platform_device_register(&cfi_flash_device); | 653 | platform_device_register(&cfi_flash_device); |
| 636 | 654 | ||
| 637 | sc_dec = readl(VA_SC_BASE + INTEGRATOR_SC_DEC_OFFSET); | 655 | sc_dec = readl(ap_syscon_base + INTEGRATOR_SC_DEC_OFFSET); |
| 638 | for (i = 0; i < 4; i++) { | 656 | for (i = 0; i < 4; i++) { |
| 639 | struct lm_device *lmdev; | 657 | struct lm_device *lmdev; |
| 640 | 658 | ||
| @@ -661,7 +679,7 @@ MACHINE_START(INTEGRATOR, "ARM-Integrator") | |||
| 661 | /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ | 679 | /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ |
| 662 | .atag_offset = 0x100, | 680 | .atag_offset = 0x100, |
| 663 | .reserve = integrator_reserve, | 681 | .reserve = integrator_reserve, |
| 664 | .map_io = ap_map_io, | 682 | .map_io = ap_map_io_atag, |
| 665 | .nr_irqs = NR_IRQS_INTEGRATOR_AP, | 683 | .nr_irqs = NR_IRQS_INTEGRATOR_AP, |
| 666 | .init_early = ap_init_early, | 684 | .init_early = ap_init_early, |
| 667 | .init_irq = ap_init_irq, | 685 | .init_irq = ap_init_irq, |
