aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-zynq/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-zynq/common.c')
-rw-r--r--arch/arm/mach-zynq/common.c67
1 files changed, 38 insertions, 29 deletions
diff --git a/arch/arm/mach-zynq/common.c b/arch/arm/mach-zynq/common.c
index 68e0907de5d0..5bfe7035b73d 100644
--- a/arch/arm/mach-zynq/common.c
+++ b/arch/arm/mach-zynq/common.c
@@ -33,20 +33,23 @@
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
41void __iomem *zynq_scu_base;
42
40static struct of_device_id zynq_of_bus_ids[] __initdata = { 43static struct of_device_id zynq_of_bus_ids[] __initdata = {
41 { .compatible = "simple-bus", }, 44 { .compatible = "simple-bus", },
42 {} 45 {}
43}; 46};
44 47
45/** 48/**
46 * xilinx_init_machine() - System specific initialization, intended to be 49 * zynq_init_machine - System specific initialization, intended to be
47 * called from board specific initialization. 50 * called from board specific initialization.
48 */ 51 */
49static void __init xilinx_init_machine(void) 52static void __init zynq_init_machine(void)
50{ 53{
51 /* 54 /*
52 * 64KB way size, 8-way associativity, parity disabled 55 * 64KB way size, 8-way associativity, parity disabled
@@ -56,50 +59,56 @@ 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 62static void __init zynq_timer_init(void)
60#define SCU_PERIPH_SIZE SZ_8K 63{
61#define SCU_PERIPH_VIRT (VMALLOC_END - SCU_PERIPH_SIZE) 64 zynq_slcr_init();
65 clocksource_of_init();
66}
62 67
63static struct map_desc scu_desc __initdata = { 68static struct map_desc zynq_cortex_a9_scu_map __initdata = {
64 .virtual = SCU_PERIPH_VIRT, 69 .length = SZ_256,
65 .pfn = __phys_to_pfn(SCU_PERIPH_PHYS), 70 .type = MT_DEVICE,
66 .length = SCU_PERIPH_SIZE,
67 .type = MT_DEVICE,
68}; 71};
69 72
70static void __init xilinx_zynq_timer_init(void) 73static void __init zynq_scu_map_io(void)
71{ 74{
72 struct device_node *np; 75 unsigned long base;
73 void __iomem *slcr;
74
75 np = of_find_compatible_node(NULL, NULL, "xlnx,zynq-slcr");
76 slcr = of_iomap(np, 0);
77 WARN_ON(!slcr);
78 76
79 xilinx_zynq_clocks_init(slcr); 77 base = scu_a9_get_base();
80 78 zynq_cortex_a9_scu_map.pfn = __phys_to_pfn(base);
81 clocksource_of_init(); 79 /* Expected address is in vmalloc area that's why simple assign here */
80 zynq_cortex_a9_scu_map.virtual = base;
81 iotable_init(&zynq_cortex_a9_scu_map, 1);
82 zynq_scu_base = (void __iomem *)base;
83 BUG_ON(!zynq_scu_base);
82} 84}
83 85
84/** 86/**
85 * xilinx_map_io() - Create memory mappings needed for early I/O. 87 * zynq_map_io - Create memory mappings needed for early I/O.
86 */ 88 */
87static void __init xilinx_map_io(void) 89static void __init zynq_map_io(void)
88{ 90{
89 debug_ll_io_init(); 91 debug_ll_io_init();
90 iotable_init(&scu_desc, 1); 92 zynq_scu_map_io();
93}
94
95static void zynq_system_reset(char mode, const char *cmd)
96{
97 zynq_slcr_system_reset();
91} 98}
92 99
93static const char *xilinx_dt_match[] = { 100static const char * const zynq_dt_match[] = {
94 "xlnx,zynq-zc702", 101 "xlnx,zynq-zc702",
95 "xlnx,zynq-7000", 102 "xlnx,zynq-7000",
96 NULL 103 NULL
97}; 104};
98 105
99MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform") 106MACHINE_START(XILINX_EP107, "Xilinx Zynq Platform")
100 .map_io = xilinx_map_io, 107 .smp = smp_ops(zynq_smp_ops),
108 .map_io = zynq_map_io,
101 .init_irq = irqchip_init, 109 .init_irq = irqchip_init,
102 .init_machine = xilinx_init_machine, 110 .init_machine = zynq_init_machine,
103 .init_time = xilinx_zynq_timer_init, 111 .init_time = zynq_timer_init,
104 .dt_compat = xilinx_dt_match, 112 .dt_compat = zynq_dt_match,
113 .restart = zynq_system_reset,
105MACHINE_END 114MACHINE_END