|
19 | 19 | #include <linux/of_platform.h> |
20 | 20 | #include <linux/dma-mapping.h> |
21 | 21 | #include <linux/irqchip.h> |
22 | | -#include <linux/kexec.h> |
| 22 | +#include <asm/hardware/cache-feroceon-l2.h> |
23 | 23 | #include <asm/mach/arch.h> |
| 24 | +#include <asm/mach/map.h> |
24 | 25 | #include <mach/bridge-regs.h> |
25 | 26 | #include <plat/common.h> |
26 | | -#include "common.h" |
| 27 | +#include <plat/pcie.h> |
| 28 | +#include "pm.h" |
| 29 | + |
| 30 | +static struct map_desc kirkwood_io_desc[] __initdata = { |
| 31 | + { |
| 32 | + .virtual = (unsigned long) KIRKWOOD_REGS_VIRT_BASE, |
| 33 | + .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE), |
| 34 | + .length = KIRKWOOD_REGS_SIZE, |
| 35 | + .type = MT_DEVICE, |
| 36 | + }, |
| 37 | +}; |
| 38 | + |
| 39 | +static void __init kirkwood_map_io(void) |
| 40 | +{ |
| 41 | + iotable_init(kirkwood_io_desc, ARRAY_SIZE(kirkwood_io_desc)); |
| 42 | +} |
| 43 | + |
| 44 | +static struct resource kirkwood_cpufreq_resources[] = { |
| 45 | + [0] = { |
| 46 | + .start = CPU_CONTROL_PHYS, |
| 47 | + .end = CPU_CONTROL_PHYS + 3, |
| 48 | + .flags = IORESOURCE_MEM, |
| 49 | + }, |
| 50 | +}; |
| 51 | + |
| 52 | +static struct platform_device kirkwood_cpufreq_device = { |
| 53 | + .name = "kirkwood-cpufreq", |
| 54 | + .id = -1, |
| 55 | + .num_resources = ARRAY_SIZE(kirkwood_cpufreq_resources), |
| 56 | + .resource = kirkwood_cpufreq_resources, |
| 57 | +}; |
| 58 | + |
| 59 | +static void __init kirkwood_cpufreq_init(void) |
| 60 | +{ |
| 61 | + platform_device_register(&kirkwood_cpufreq_device); |
| 62 | +} |
| 63 | + |
| 64 | +static struct resource kirkwood_cpuidle_resource[] = { |
| 65 | + { |
| 66 | + .flags = IORESOURCE_MEM, |
| 67 | + .start = DDR_OPERATION_BASE, |
| 68 | + .end = DDR_OPERATION_BASE + 3, |
| 69 | + }, |
| 70 | +}; |
| 71 | + |
| 72 | +static struct platform_device kirkwood_cpuidle = { |
| 73 | + .name = "kirkwood_cpuidle", |
| 74 | + .id = -1, |
| 75 | + .resource = kirkwood_cpuidle_resource, |
| 76 | + .num_resources = 1, |
| 77 | +}; |
| 78 | + |
| 79 | +static void __init kirkwood_cpuidle_init(void) |
| 80 | +{ |
| 81 | + platform_device_register(&kirkwood_cpuidle); |
| 82 | +} |
| 83 | + |
| 84 | +/* Temporary here since mach-mvebu has a function we can use */ |
| 85 | +static void kirkwood_restart(enum reboot_mode mode, const char *cmd) |
| 86 | +{ |
| 87 | + /* |
| 88 | + * Enable soft reset to assert RSTOUTn. |
| 89 | + */ |
| 90 | + writel(SOFT_RESET_OUT_EN, RSTOUTn_MASK); |
| 91 | + |
| 92 | + /* |
| 93 | + * Assert soft reset. |
| 94 | + */ |
| 95 | + writel(SOFT_RESET, SYSTEM_SOFT_RESET); |
| 96 | + |
| 97 | + while (1) |
| 98 | + ; |
| 99 | +} |
27 | 100 |
|
28 | 101 | #define MV643XX_ETH_MAC_ADDR_LOW 0x0414 |
29 | 102 | #define MV643XX_ETH_MAC_ADDR_HIGH 0x0418 |
@@ -104,35 +177,35 @@ static void __init kirkwood_dt_eth_fixup(void) |
104 | 177 | } |
105 | 178 | } |
106 | 179 |
|
107 | | -static void __init kirkwood_dt_init(void) |
| 180 | +/* |
| 181 | + * Disable propagation of mbus errors to the CPU local bus, as this |
| 182 | + * causes mbus errors (which can occur for example for PCI aborts) to |
| 183 | + * throw CPU aborts, which we're not set up to deal with. |
| 184 | + */ |
| 185 | +static void __init kirkwood_disable_mbus_error_propagation(void) |
108 | 186 | { |
109 | | - pr_info("Kirkwood: %s.\n", kirkwood_id()); |
| 187 | + void __iomem *cpu_config; |
110 | 188 |
|
111 | | - /* |
112 | | - * Disable propagation of mbus errors to the CPU local bus, |
113 | | - * as this causes mbus errors (which can occur for example |
114 | | - * for PCI aborts) to throw CPU aborts, which we're not set |
115 | | - * up to deal with. |
116 | | - */ |
117 | | - writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); |
| 189 | + cpu_config = ioremap(CPU_CONFIG_PHYS, 4); |
| 190 | + writel(readl(cpu_config) & ~CPU_CONFIG_ERROR_PROP, cpu_config); |
| 191 | + iounmap(cpu_config); |
| 192 | +} |
118 | 193 |
|
119 | | - BUG_ON(mvebu_mbus_dt_init()); |
| 194 | +static void __init kirkwood_dt_init(void) |
| 195 | +{ |
| 196 | + kirkwood_disable_mbus_error_propagation(); |
120 | 197 |
|
121 | | - kirkwood_l2_init(); |
| 198 | + BUG_ON(mvebu_mbus_dt_init()); |
122 | 199 |
|
| 200 | +#ifdef CONFIG_CACHE_FEROCEON_L2 |
| 201 | + feroceon_of_init(); |
| 202 | +#endif |
123 | 203 | kirkwood_cpufreq_init(); |
124 | 204 | kirkwood_cpuidle_init(); |
125 | 205 |
|
126 | 206 | kirkwood_pm_init(); |
127 | 207 | kirkwood_dt_eth_fixup(); |
128 | 208 |
|
129 | | -#ifdef CONFIG_KEXEC |
130 | | - kexec_reinit = kirkwood_enable_pcie; |
131 | | -#endif |
132 | | - |
133 | | - if (of_machine_is_compatible("marvell,mv88f6281gtw-ge")) |
134 | | - mv88f6281gtw_ge_init(); |
135 | | - |
136 | 209 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
137 | 210 | } |
138 | 211 |
|
|
0 commit comments