diff options
Diffstat (limited to 'arch/arm/mach-zynq/common.c')
-rw-r--r-- | arch/arm/mach-zynq/common.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index 68e0907de5d0..f9e5f3ac8eec 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c | |||
@@ -33,10 +33,13 @@ | |||
33 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
34 | #include <asm/page.h> | 34 | #include <asm/page.h> |
35 | #include <asm/pgtable.h> | 35 | #include <asm/pgtable.h> |
36 | #include <asm/smp_scu.h> | ||
36 | #include <asm/hardware/cache-l2x0.h> | 37 | #include <asm/hardware/cache-l2x0.h> |
37 | 38 | ||
38 | #include "common.h" | 39 | #include "common.h" |
39 | 40 | ||
41 | void __iomem *zynq_scu_base; | ||
42 | |||
40 | static struct of_device_id zynq_of_bus_ids[] __initdata = { | 43 | static struct of_device_id zynq_of_bus_ids[] __initdata = { |
41 | { .compatible = "simple-bus", }, | 44 | { .compatible = "simple-bus", }, |
42 | {} | 45 | {} |
@@ -56,17 +59,6 @@ static void __init xilinx_init_machine(void) | |||
56 | of_platform_bus_probe(NULL, zynq_of_bus_ids, NULL); | 59 | of_platform_bus_probe(NULL, zynq_of_bus_ids, NULL); |
57 | } | 60 | } |
58 | 61 | ||
59 | #define SCU_PERIPH_PHYS 0xF8F00000 | ||
60 | #define SCU_PERIPH_SIZE SZ_8K | ||
61 | #define SCU_PERIPH_VIRT (VMALLOC_END - SCU_PERIPH_SIZE) | ||
62 | |||
63 | static struct map_desc scu_desc __initdata = { | ||
64 | .virtual = SCU_PERIPH_VIRT, | ||
65 | .pfn = __phys_to_pfn(SCU_PERIPH_PHYS), | ||
66 | .length = SCU_PERIPH_SIZE, | ||
67 | .type = MT_DEVICE, | ||
68 | }; | ||
69 | |||
70 | static void __init xilinx_zynq_timer_init(void) | 62 | static void __init xilinx_zynq_timer_init(void) |
71 | { | 63 | { |
72 | struct device_node *np; | 64 | struct device_node *np; |
@@ -81,13 +73,31 @@ static void __init xilinx_zynq_timer_init(void) | |||
81 | clocksource_of_init(); | 73 | clocksource_of_init(); |
82 | } | 74 | } |
83 | 75 | ||
76 | static struct map_desc zynq_cortex_a9_scu_map __initdata = { | ||
77 | .length = SZ_256, | ||
78 | .type = MT_DEVICE, | ||
79 | }; | ||
80 | |||
81 | static void __init zynq_scu_map_io(void) | ||
82 | { | ||
83 | unsigned long base; | ||
84 | |||
85 | base = scu_a9_get_base(); | ||
86 | zynq_cortex_a9_scu_map.pfn = __phys_to_pfn(base); | ||
87 | /* Expected address is in vmalloc area that's why simple assign here */ | ||
88 | zynq_cortex_a9_scu_map.virtual = base; | ||
89 | iotable_init(&zynq_cortex_a9_scu_map, 1); | ||
90 | zynq_scu_base = (void __iomem *)base; | ||
91 | BUG_ON(!zynq_scu_base); | ||
92 | } | ||
93 | |||
84 | /** | 94 | /** |
85 | * xilinx_map_io() - Create memory mappings needed for early I/O. | 95 | * xilinx_map_io() - Create memory mappings needed for early I/O. |
86 | */ | 96 | */ |
87 | static void __init xilinx_map_io(void) | 97 | static void __init xilinx_map_io(void) |
88 | { | 98 | { |
89 | debug_ll_io_init(); | 99 | debug_ll_io_init(); |
90 | iotable_init(&scu_desc, 1); | 100 | zynq_scu_map_io(); |
91 | } | 101 | } |
92 | 102 | ||
93 | static const char *xilinx_dt_match[] = { | 103 | static const char *xilinx_dt_match[] = { |