diff options
Diffstat (limited to 'arch/arm/mach-zynq/common.c')
-rw-r--r-- | arch/arm/mach-zynq/common.c | 80 |
1 files changed, 43 insertions, 37 deletions
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c index ab5cfddc0d7b..e16d4bed0f7a 100644 --- a/arch/arm/mach-zynq/common.c +++ b/arch/arm/mach-zynq/common.c | |||
@@ -19,19 +19,21 @@ | |||
19 | #include <linux/cpumask.h> | 19 | #include <linux/cpumask.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/clk.h> | 21 | #include <linux/clk.h> |
22 | #include <linux/clk/zynq.h> | ||
23 | #include <linux/of_address.h> | ||
22 | #include <linux/of_irq.h> | 24 | #include <linux/of_irq.h> |
23 | #include <linux/of_platform.h> | 25 | #include <linux/of_platform.h> |
24 | #include <linux/of.h> | 26 | #include <linux/of.h> |
25 | 27 | ||
26 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
27 | #include <asm/mach/map.h> | 29 | #include <asm/mach/map.h> |
30 | #include <asm/mach/time.h> | ||
28 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
29 | #include <asm/page.h> | 32 | #include <asm/page.h> |
33 | #include <asm/pgtable.h> | ||
30 | #include <asm/hardware/gic.h> | 34 | #include <asm/hardware/gic.h> |
31 | #include <asm/hardware/cache-l2x0.h> | 35 | #include <asm/hardware/cache-l2x0.h> |
32 | 36 | ||
33 | #include <mach/zynq_soc.h> | ||
34 | #include <mach/clkdev.h> | ||
35 | #include "common.h" | 37 | #include "common.h" |
36 | 38 | ||
37 | static struct of_device_id zynq_of_bus_ids[] __initdata = { | 39 | static struct of_device_id zynq_of_bus_ids[] __initdata = { |
@@ -45,55 +47,57 @@ static struct of_device_id zynq_of_bus_ids[] __initdata = { | |||
45 | */ | 47 | */ |
46 | static void __init xilinx_init_machine(void) | 48 | static void __init xilinx_init_machine(void) |
47 | { | 49 | { |
48 | #ifdef CONFIG_CACHE_L2X0 | ||
49 | /* | 50 | /* |
50 | * 64KB way size, 8-way associativity, parity disabled | 51 | * 64KB way size, 8-way associativity, parity disabled |
51 | */ | 52 | */ |
52 | l2x0_init(PL310_L2CC_BASE, 0x02060000, 0xF0F0FFFF); | 53 | l2x0_of_init(0x02060000, 0xF0F0FFFF); |
53 | #endif | ||
54 | 54 | ||
55 | of_platform_bus_probe(NULL, zynq_of_bus_ids, NULL); | 55 | of_platform_bus_probe(NULL, zynq_of_bus_ids, NULL); |
56 | } | 56 | } |
57 | 57 | ||
58 | static struct of_device_id irq_match[] __initdata = { | ||
59 | { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, }, | ||
60 | { } | ||
61 | }; | ||
62 | |||
58 | /** | 63 | /** |
59 | * xilinx_irq_init() - Interrupt controller initialization for the GIC. | 64 | * xilinx_irq_init() - Interrupt controller initialization for the GIC. |
60 | */ | 65 | */ |
61 | static void __init xilinx_irq_init(void) | 66 | static void __init xilinx_irq_init(void) |
62 | { | 67 | { |
63 | gic_init(0, 29, SCU_GIC_DIST_BASE, SCU_GIC_CPU_BASE); | 68 | of_irq_init(irq_match); |
64 | } | 69 | } |
65 | 70 | ||
66 | /* The minimum devices needed to be mapped before the VM system is up and | 71 | #define SCU_PERIPH_PHYS 0xF8F00000 |
67 | * running include the GIC, UART and Timer Counter. | 72 | #define SCU_PERIPH_SIZE SZ_8K |
68 | */ | 73 | #define SCU_PERIPH_VIRT (VMALLOC_END - SCU_PERIPH_SIZE) |
74 | |||
75 | static struct map_desc scu_desc __initdata = { | ||
76 | .virtual = SCU_PERIPH_VIRT, | ||
77 | .pfn = __phys_to_pfn(SCU_PERIPH_PHYS), | ||
78 | .length = SCU_PERIPH_SIZE, | ||
79 | .type = MT_DEVICE, | ||
80 | }; | ||
81 | |||
82 | static void __init xilinx_zynq_timer_init(void) | ||
83 | { | ||
84 | struct device_node *np; | ||
85 | void __iomem *slcr; | ||
86 | |||
87 | np = of_find_compatible_node(NULL, NULL, "xlnx,zynq-slcr"); | ||
88 | slcr = of_iomap(np, 0); | ||
89 | WARN_ON(!slcr); | ||
90 | |||
91 | xilinx_zynq_clocks_init(slcr); | ||
69 | 92 | ||
70 | static struct map_desc io_desc[] __initdata = { | 93 | xttcpss_timer_init(); |
71 | { | 94 | } |
72 | .virtual = TTC0_VIRT, | ||
73 | .pfn = __phys_to_pfn(TTC0_PHYS), | ||
74 | .length = SZ_4K, | ||
75 | .type = MT_DEVICE, | ||
76 | }, { | ||
77 | .virtual = SCU_PERIPH_VIRT, | ||
78 | .pfn = __phys_to_pfn(SCU_PERIPH_PHYS), | ||
79 | .length = SZ_8K, | ||
80 | .type = MT_DEVICE, | ||
81 | }, { | ||
82 | .virtual = PL310_L2CC_VIRT, | ||
83 | .pfn = __phys_to_pfn(PL310_L2CC_PHYS), | ||
84 | .length = SZ_4K, | ||
85 | .type = MT_DEVICE, | ||
86 | }, | ||
87 | |||
88 | #ifdef CONFIG_DEBUG_LL | ||
89 | { | ||
90 | .virtual = UART0_VIRT, | ||
91 | .pfn = __phys_to_pfn(UART0_PHYS), | ||
92 | .length = SZ_4K, | ||
93 | .type = MT_DEVICE, | ||
94 | }, | ||
95 | #endif | ||
96 | 95 | ||
96 | /* | ||
97 | * Instantiate and initialize the system timer structure | ||
98 | */ | ||
99 | static struct sys_timer xttcpss_sys_timer = { | ||
100 | .init = xilinx_zynq_timer_init, | ||
97 | }; | 101 | }; |
98 | 102 | ||
99 | /** | 103 | /** |
@@ -101,11 +105,13 @@ static struct map_desc io_desc[] __initdata = { | |||
101 | */ | 105 | */ |
102 | static void __init xilinx_map_io(void) | 106 | static void __init xilinx_map_io(void) |
103 | { | 107 | { |
104 | iotable_init(io_desc, ARRAY_SIZE(io_desc)); | 108 | debug_ll_io_init(); |
109 | iotable_init(&scu_desc, 1); | ||
105 | } | 110 | } |
106 | 111 | ||
107 | static const char *xilinx_dt_match[] = { | 112 | static const char *xilinx_dt_match[] = { |
108 | "xlnx,zynq-ep107", | 113 | "xlnx,zynq-zc702", |
114 | "xlnx,zynq-7000", | ||
109 | NULL | 115 | NULL |
110 | }; | 116 | }; |
111 | 117 | ||