diff options
Diffstat (limited to 'arch/arc/plat-arcfpga/platform.c')
-rw-r--r-- | arch/arc/plat-arcfpga/platform.c | 72 |
1 files changed, 6 insertions, 66 deletions
diff --git a/arch/arc/plat-arcfpga/platform.c b/arch/arc/plat-arcfpga/platform.c index 19b76b61f44b..61c7e5997387 100644 --- a/arch/arc/plat-arcfpga/platform.c +++ b/arch/arc/plat-arcfpga/platform.c | |||
@@ -22,59 +22,6 @@ | |||
22 | #include <plat/smp.h> | 22 | #include <plat/smp.h> |
23 | #include <plat/irq.h> | 23 | #include <plat/irq.h> |
24 | 24 | ||
25 | /*-----------------------BVCI Latency Unit -----------------------------*/ | ||
26 | |||
27 | #ifdef CONFIG_ARC_HAS_BVCI_LAT_UNIT | ||
28 | |||
29 | int lat_cycles = CONFIG_BVCI_LAT_CYCLES; | ||
30 | |||
31 | /* BVCI Bus Profiler: Latency Unit */ | ||
32 | static void __init setup_bvci_lat_unit(void) | ||
33 | { | ||
34 | #define MAX_BVCI_UNITS 12 | ||
35 | |||
36 | unsigned int i; | ||
37 | unsigned int *base = (unsigned int *)BVCI_LAT_UNIT_BASE; | ||
38 | const unsigned long units_req = CONFIG_BVCI_LAT_UNITS; | ||
39 | const unsigned int REG_UNIT = 21; | ||
40 | const unsigned int REG_VAL = 22; | ||
41 | |||
42 | /* | ||
43 | * There are multiple Latency Units corresponding to the many | ||
44 | * interfaces of the system bus arbiter (both CPU side as well as | ||
45 | * the peripheral side). | ||
46 | * | ||
47 | * Unit 0 - System Arb and Mem Controller - adds latency to all | ||
48 | * memory trasactions | ||
49 | * Unit 1 - I$ and System Bus | ||
50 | * Unit 2 - D$ and System Bus | ||
51 | * .. | ||
52 | * Unit 12 - IDE Disk controller and System Bus | ||
53 | * | ||
54 | * The programmers model requires writing to lat_unit reg first | ||
55 | * and then the latency value (cycles) to lat_value reg | ||
56 | */ | ||
57 | |||
58 | if (CONFIG_BVCI_LAT_UNITS == 0) { | ||
59 | writel(0, base + REG_UNIT); | ||
60 | writel(lat_cycles, base + REG_VAL); | ||
61 | pr_info("BVCI Latency for all Memory Transactions %d cycles\n", | ||
62 | lat_cycles); | ||
63 | } else { | ||
64 | for_each_set_bit(i, &units_req, MAX_BVCI_UNITS) { | ||
65 | writel(i + 1, base + REG_UNIT); /* loop is 0 based */ | ||
66 | writel(lat_cycles, base + REG_VAL); | ||
67 | pr_info("BVCI Latency for Unit[%d] = %d cycles\n", | ||
68 | (i + 1), lat_cycles); | ||
69 | } | ||
70 | } | ||
71 | } | ||
72 | #else | ||
73 | static void __init setup_bvci_lat_unit(void) | ||
74 | { | ||
75 | } | ||
76 | #endif | ||
77 | |||
78 | /*----------------------- Platform Devices -----------------------------*/ | 25 | /*----------------------- Platform Devices -----------------------------*/ |
79 | 26 | ||
80 | #if IS_ENABLED(CONFIG_SERIAL_ARC) | 27 | #if IS_ENABLED(CONFIG_SERIAL_ARC) |
@@ -132,16 +79,11 @@ static void arc_fpga_serial_init(void) | |||
132 | ARRAY_SIZE(fpga_early_devs)); | 79 | ARRAY_SIZE(fpga_early_devs)); |
133 | 80 | ||
134 | /* | 81 | /* |
135 | * ARC console driver registers itself as an early platform driver | 82 | * ARC console driver registers (build time) as an early platform driver |
136 | * of class "earlyprintk". | 83 | * of class "earlyprintk". However it needs explicit cmdline toggle |
137 | * Install it here, followed by probe of devices. | 84 | * "earlyprintk=ttyARC0" to be successfuly runtime registered. |
138 | * The installation here doesn't require earlyprintk in command line | 85 | * Otherwise the early probe below fails to find the driver |
139 | * To do so however, replace the lines below with | ||
140 | * parse_early_param(); | ||
141 | * early_platform_driver_probe("earlyprintk", 1, 1); | ||
142 | * ^^ | ||
143 | */ | 86 | */ |
144 | early_platform_driver_register_all("earlyprintk"); | ||
145 | early_platform_driver_probe("earlyprintk", 1, 0); | 87 | early_platform_driver_probe("earlyprintk", 1, 0); |
146 | 88 | ||
147 | /* | 89 | /* |
@@ -165,11 +107,9 @@ static void __init plat_fpga_early_init(void) | |||
165 | { | 107 | { |
166 | pr_info("[plat-arcfpga]: registering early dev resources\n"); | 108 | pr_info("[plat-arcfpga]: registering early dev resources\n"); |
167 | 109 | ||
168 | setup_bvci_lat_unit(); | ||
169 | |||
170 | arc_fpga_serial_init(); | 110 | arc_fpga_serial_init(); |
171 | 111 | ||
172 | #ifdef CONFIG_SMP | 112 | #ifdef CONFIG_ISS_SMP_EXTN |
173 | iss_model_init_early_smp(); | 113 | iss_model_init_early_smp(); |
174 | #endif | 114 | #endif |
175 | } | 115 | } |
@@ -211,7 +151,7 @@ MACHINE_START(ANGEL4, "angel4") | |||
211 | .init_early = plat_fpga_early_init, | 151 | .init_early = plat_fpga_early_init, |
212 | .init_machine = plat_fpga_populate_dev, | 152 | .init_machine = plat_fpga_populate_dev, |
213 | .init_irq = plat_fpga_init_IRQ, | 153 | .init_irq = plat_fpga_init_IRQ, |
214 | #ifdef CONFIG_SMP | 154 | #ifdef CONFIG_ISS_SMP_EXTN |
215 | .init_smp = iss_model_init_smp, | 155 | .init_smp = iss_model_init_smp, |
216 | #endif | 156 | #endif |
217 | MACHINE_END | 157 | MACHINE_END |