Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/mach-mv78xx0/common.c |
| 3 | * |
| 4 | * Core functions for Marvell MV78xx0 SoCs |
| 5 | * |
| 6 | * This file is licensed under the terms of the GNU General Public |
| 7 | * License version 2. This program is licensed "as is" without any |
| 8 | * warranty of any kind, whether express or implied. |
| 9 | */ |
| 10 | |
| 11 | #include <linux/kernel.h> |
| 12 | #include <linux/init.h> |
| 13 | #include <linux/platform_device.h> |
| 14 | #include <linux/serial_8250.h> |
| 15 | #include <linux/mbus.h> |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 16 | #include <linux/ata_platform.h> |
Lennert Buytenhek | 712424f | 2009-02-20 02:31:58 +0100 | [diff] [blame] | 17 | #include <linux/ethtool.h> |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 18 | #include <asm/mach/map.h> |
| 19 | #include <asm/mach/time.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 20 | #include <mach/mv78xx0.h> |
Nicolas Pitre | fdd8b07 | 2009-04-22 20:08:17 +0100 | [diff] [blame] | 21 | #include <mach/bridge-regs.h> |
Lennert Buytenhek | 6f088f1 | 2008-08-09 13:44:58 +0200 | [diff] [blame] | 22 | #include <plat/cache-feroceon-l2.h> |
Lennert Buytenhek | 6f088f1 | 2008-08-09 13:44:58 +0200 | [diff] [blame] | 23 | #include <plat/orion_nand.h> |
| 24 | #include <plat/time.h> |
Andrew Lunn | 28a2b45 | 2011-05-15 13:32:41 +0200 | [diff] [blame] | 25 | #include <plat/common.h> |
Andrew Lunn | 45173d5 | 2011-12-07 21:48:06 +0100 | [diff] [blame] | 26 | #include <plat/addr-map.h> |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 27 | #include "common.h" |
| 28 | |
Andrew Lunn | 28a2b45 | 2011-05-15 13:32:41 +0200 | [diff] [blame] | 29 | static int get_tclk(void); |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 30 | |
| 31 | /***************************************************************************** |
| 32 | * Common bits |
| 33 | ****************************************************************************/ |
| 34 | int mv78xx0_core_index(void) |
| 35 | { |
| 36 | u32 extra; |
| 37 | |
| 38 | /* |
| 39 | * Read Extra Features register. |
| 40 | */ |
| 41 | __asm__("mrc p15, 1, %0, c15, c1, 0" : "=r" (extra)); |
| 42 | |
| 43 | return !!(extra & 0x00004000); |
| 44 | } |
| 45 | |
| 46 | static int get_hclk(void) |
| 47 | { |
| 48 | int hclk; |
| 49 | |
| 50 | /* |
| 51 | * HCLK tick rate is configured by DEV_D[7:5] pins. |
| 52 | */ |
| 53 | switch ((readl(SAMPLE_AT_RESET_LOW) >> 5) & 7) { |
| 54 | case 0: |
| 55 | hclk = 166666667; |
| 56 | break; |
| 57 | case 1: |
| 58 | hclk = 200000000; |
| 59 | break; |
| 60 | case 2: |
| 61 | hclk = 266666667; |
| 62 | break; |
| 63 | case 3: |
| 64 | hclk = 333333333; |
| 65 | break; |
| 66 | case 4: |
| 67 | hclk = 400000000; |
| 68 | break; |
| 69 | default: |
| 70 | panic("unknown HCLK PLL setting: %.8x\n", |
| 71 | readl(SAMPLE_AT_RESET_LOW)); |
| 72 | } |
| 73 | |
| 74 | return hclk; |
| 75 | } |
| 76 | |
| 77 | static void get_pclk_l2clk(int hclk, int core_index, int *pclk, int *l2clk) |
| 78 | { |
| 79 | u32 cfg; |
| 80 | |
| 81 | /* |
| 82 | * Core #0 PCLK/L2CLK is configured by bits [13:8], core #1 |
| 83 | * PCLK/L2CLK by bits [19:14]. |
| 84 | */ |
| 85 | if (core_index == 0) { |
| 86 | cfg = (readl(SAMPLE_AT_RESET_LOW) >> 8) & 0x3f; |
| 87 | } else { |
| 88 | cfg = (readl(SAMPLE_AT_RESET_LOW) >> 14) & 0x3f; |
| 89 | } |
| 90 | |
| 91 | /* |
| 92 | * Bits [11:8] ([17:14] for core #1) configure the PCLK:HCLK |
| 93 | * ratio (1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6). |
| 94 | */ |
| 95 | *pclk = ((u64)hclk * (2 + (cfg & 0xf))) >> 1; |
| 96 | |
| 97 | /* |
| 98 | * Bits [13:12] ([19:18] for core #1) configure the PCLK:L2CLK |
| 99 | * ratio (1, 2, 3). |
| 100 | */ |
| 101 | *l2clk = *pclk / (((cfg >> 4) & 3) + 1); |
| 102 | } |
| 103 | |
| 104 | static int get_tclk(void) |
| 105 | { |
| 106 | int tclk; |
| 107 | |
| 108 | /* |
| 109 | * TCLK tick rate is configured by DEV_A[2:0] strap pins. |
| 110 | */ |
| 111 | switch ((readl(SAMPLE_AT_RESET_HIGH) >> 6) & 7) { |
| 112 | case 1: |
| 113 | tclk = 166666667; |
| 114 | break; |
| 115 | case 3: |
| 116 | tclk = 200000000; |
| 117 | break; |
| 118 | default: |
| 119 | panic("unknown TCLK PLL setting: %.8x\n", |
| 120 | readl(SAMPLE_AT_RESET_HIGH)); |
| 121 | } |
| 122 | |
| 123 | return tclk; |
| 124 | } |
| 125 | |
| 126 | |
| 127 | /***************************************************************************** |
| 128 | * I/O Address Mapping |
| 129 | ****************************************************************************/ |
| 130 | static struct map_desc mv78xx0_io_desc[] __initdata = { |
| 131 | { |
| 132 | .virtual = MV78XX0_CORE_REGS_VIRT_BASE, |
| 133 | .pfn = 0, |
| 134 | .length = MV78XX0_CORE_REGS_SIZE, |
| 135 | .type = MT_DEVICE, |
| 136 | }, { |
| 137 | .virtual = MV78XX0_PCIE_IO_VIRT_BASE(0), |
| 138 | .pfn = __phys_to_pfn(MV78XX0_PCIE_IO_PHYS_BASE(0)), |
| 139 | .length = MV78XX0_PCIE_IO_SIZE * 8, |
| 140 | .type = MT_DEVICE, |
| 141 | }, { |
| 142 | .virtual = MV78XX0_REGS_VIRT_BASE, |
| 143 | .pfn = __phys_to_pfn(MV78XX0_REGS_PHYS_BASE), |
| 144 | .length = MV78XX0_REGS_SIZE, |
| 145 | .type = MT_DEVICE, |
| 146 | }, |
| 147 | }; |
| 148 | |
| 149 | void __init mv78xx0_map_io(void) |
| 150 | { |
| 151 | unsigned long phys; |
| 152 | |
| 153 | /* |
| 154 | * Map the right set of per-core registers depending on |
| 155 | * which core we are running on. |
| 156 | */ |
| 157 | if (mv78xx0_core_index() == 0) { |
| 158 | phys = MV78XX0_CORE0_REGS_PHYS_BASE; |
| 159 | } else { |
| 160 | phys = MV78XX0_CORE1_REGS_PHYS_BASE; |
| 161 | } |
| 162 | mv78xx0_io_desc[0].pfn = __phys_to_pfn(phys); |
| 163 | |
| 164 | iotable_init(mv78xx0_io_desc, ARRAY_SIZE(mv78xx0_io_desc)); |
| 165 | } |
| 166 | |
| 167 | |
| 168 | /***************************************************************************** |
| 169 | * EHCI |
| 170 | ****************************************************************************/ |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 171 | void __init mv78xx0_ehci0_init(void) |
| 172 | { |
Andrew Lunn | 45173d5 | 2011-12-07 21:48:06 +0100 | [diff] [blame] | 173 | orion_ehci_init(&orion_mbus_dram_info, |
Andrew Lunn | 4fcd3f3 | 2011-05-15 13:32:49 +0200 | [diff] [blame] | 174 | USB0_PHYS_BASE, IRQ_MV78XX0_USB_0); |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | |
| 178 | /***************************************************************************** |
| 179 | * EHCI1 |
| 180 | ****************************************************************************/ |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 181 | void __init mv78xx0_ehci1_init(void) |
| 182 | { |
Andrew Lunn | 45173d5 | 2011-12-07 21:48:06 +0100 | [diff] [blame] | 183 | orion_ehci_1_init(&orion_mbus_dram_info, |
Andrew Lunn | 4fcd3f3 | 2011-05-15 13:32:49 +0200 | [diff] [blame] | 184 | USB1_PHYS_BASE, IRQ_MV78XX0_USB_1); |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 185 | } |
| 186 | |
| 187 | |
| 188 | /***************************************************************************** |
| 189 | * EHCI2 |
| 190 | ****************************************************************************/ |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 191 | void __init mv78xx0_ehci2_init(void) |
| 192 | { |
Andrew Lunn | 45173d5 | 2011-12-07 21:48:06 +0100 | [diff] [blame] | 193 | orion_ehci_2_init(&orion_mbus_dram_info, |
Andrew Lunn | 4fcd3f3 | 2011-05-15 13:32:49 +0200 | [diff] [blame] | 194 | USB2_PHYS_BASE, IRQ_MV78XX0_USB_2); |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 195 | } |
| 196 | |
| 197 | |
| 198 | /***************************************************************************** |
| 199 | * GE00 |
| 200 | ****************************************************************************/ |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 201 | void __init mv78xx0_ge00_init(struct mv643xx_eth_platform_data *eth_data) |
| 202 | { |
Andrew Lunn | 45173d5 | 2011-12-07 21:48:06 +0100 | [diff] [blame] | 203 | orion_ge00_init(eth_data, &orion_mbus_dram_info, |
Andrew Lunn | 7e3819d | 2011-05-15 13:32:44 +0200 | [diff] [blame] | 204 | GE00_PHYS_BASE, IRQ_MV78XX0_GE00_SUM, |
| 205 | IRQ_MV78XX0_GE_ERR, get_tclk()); |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | |
| 209 | /***************************************************************************** |
| 210 | * GE01 |
| 211 | ****************************************************************************/ |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 212 | void __init mv78xx0_ge01_init(struct mv643xx_eth_platform_data *eth_data) |
| 213 | { |
Andrew Lunn | 45173d5 | 2011-12-07 21:48:06 +0100 | [diff] [blame] | 214 | orion_ge01_init(eth_data, &orion_mbus_dram_info, |
Andrew Lunn | 7e3819d | 2011-05-15 13:32:44 +0200 | [diff] [blame] | 215 | GE01_PHYS_BASE, IRQ_MV78XX0_GE01_SUM, |
| 216 | NO_IRQ, get_tclk()); |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 217 | } |
| 218 | |
| 219 | |
| 220 | /***************************************************************************** |
| 221 | * GE10 |
| 222 | ****************************************************************************/ |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 223 | void __init mv78xx0_ge10_init(struct mv643xx_eth_platform_data *eth_data) |
| 224 | { |
Lennert Buytenhek | 712424f | 2009-02-20 02:31:58 +0100 | [diff] [blame] | 225 | u32 dev, rev; |
| 226 | |
Lennert Buytenhek | 712424f | 2009-02-20 02:31:58 +0100 | [diff] [blame] | 227 | /* |
| 228 | * On the Z0, ge10 and ge11 are internally connected back |
| 229 | * to back, and not brought out. |
| 230 | */ |
| 231 | mv78xx0_pcie_id(&dev, &rev); |
| 232 | if (dev == MV78X00_Z0_DEV_ID) { |
| 233 | eth_data->phy_addr = MV643XX_ETH_PHY_NONE; |
| 234 | eth_data->speed = SPEED_1000; |
| 235 | eth_data->duplex = DUPLEX_FULL; |
| 236 | } |
| 237 | |
Andrew Lunn | 45173d5 | 2011-12-07 21:48:06 +0100 | [diff] [blame] | 238 | orion_ge10_init(eth_data, &orion_mbus_dram_info, |
Andrew Lunn | 7e3819d | 2011-05-15 13:32:44 +0200 | [diff] [blame] | 239 | GE10_PHYS_BASE, IRQ_MV78XX0_GE10_SUM, |
| 240 | NO_IRQ, get_tclk()); |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | |
| 244 | /***************************************************************************** |
| 245 | * GE11 |
| 246 | ****************************************************************************/ |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 247 | void __init mv78xx0_ge11_init(struct mv643xx_eth_platform_data *eth_data) |
| 248 | { |
Lennert Buytenhek | 712424f | 2009-02-20 02:31:58 +0100 | [diff] [blame] | 249 | u32 dev, rev; |
| 250 | |
Lennert Buytenhek | 712424f | 2009-02-20 02:31:58 +0100 | [diff] [blame] | 251 | /* |
| 252 | * On the Z0, ge10 and ge11 are internally connected back |
| 253 | * to back, and not brought out. |
| 254 | */ |
| 255 | mv78xx0_pcie_id(&dev, &rev); |
| 256 | if (dev == MV78X00_Z0_DEV_ID) { |
| 257 | eth_data->phy_addr = MV643XX_ETH_PHY_NONE; |
| 258 | eth_data->speed = SPEED_1000; |
| 259 | eth_data->duplex = DUPLEX_FULL; |
| 260 | } |
| 261 | |
Andrew Lunn | 45173d5 | 2011-12-07 21:48:06 +0100 | [diff] [blame] | 262 | orion_ge11_init(eth_data, &orion_mbus_dram_info, |
Andrew Lunn | 7e3819d | 2011-05-15 13:32:44 +0200 | [diff] [blame] | 263 | GE11_PHYS_BASE, IRQ_MV78XX0_GE11_SUM, |
| 264 | NO_IRQ, get_tclk()); |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 265 | } |
| 266 | |
Riku Voipio | 6935994 | 2009-03-03 21:13:50 +0200 | [diff] [blame] | 267 | /***************************************************************************** |
Andrew Lunn | aac7ffa | 2011-05-15 13:32:45 +0200 | [diff] [blame] | 268 | * I2C |
Riku Voipio | 6935994 | 2009-03-03 21:13:50 +0200 | [diff] [blame] | 269 | ****************************************************************************/ |
Riku Voipio | 6935994 | 2009-03-03 21:13:50 +0200 | [diff] [blame] | 270 | void __init mv78xx0_i2c_init(void) |
| 271 | { |
Andrew Lunn | aac7ffa | 2011-05-15 13:32:45 +0200 | [diff] [blame] | 272 | orion_i2c_init(I2C_0_PHYS_BASE, IRQ_MV78XX0_I2C_0, 8); |
| 273 | orion_i2c_1_init(I2C_1_PHYS_BASE, IRQ_MV78XX0_I2C_1, 8); |
Riku Voipio | 6935994 | 2009-03-03 21:13:50 +0200 | [diff] [blame] | 274 | } |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 275 | |
| 276 | /***************************************************************************** |
| 277 | * SATA |
| 278 | ****************************************************************************/ |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 279 | void __init mv78xx0_sata_init(struct mv_sata_platform_data *sata_data) |
| 280 | { |
Andrew Lunn | 45173d5 | 2011-12-07 21:48:06 +0100 | [diff] [blame] | 281 | orion_sata_init(sata_data, &orion_mbus_dram_info, |
Andrew Lunn | 9e613f8 | 2011-05-15 13:32:50 +0200 | [diff] [blame] | 282 | SATA_PHYS_BASE, IRQ_MV78XX0_SATA); |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | |
| 286 | /***************************************************************************** |
| 287 | * UART0 |
| 288 | ****************************************************************************/ |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 289 | void __init mv78xx0_uart0_init(void) |
| 290 | { |
Andrew Lunn | 28a2b45 | 2011-05-15 13:32:41 +0200 | [diff] [blame] | 291 | orion_uart0_init(UART0_VIRT_BASE, UART0_PHYS_BASE, |
| 292 | IRQ_MV78XX0_UART_0, get_tclk()); |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 293 | } |
| 294 | |
| 295 | |
| 296 | /***************************************************************************** |
| 297 | * UART1 |
| 298 | ****************************************************************************/ |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 299 | void __init mv78xx0_uart1_init(void) |
| 300 | { |
Andrew Lunn | 28a2b45 | 2011-05-15 13:32:41 +0200 | [diff] [blame] | 301 | orion_uart1_init(UART1_VIRT_BASE, UART1_PHYS_BASE, |
| 302 | IRQ_MV78XX0_UART_1, get_tclk()); |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 303 | } |
| 304 | |
| 305 | |
| 306 | /***************************************************************************** |
| 307 | * UART2 |
| 308 | ****************************************************************************/ |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 309 | void __init mv78xx0_uart2_init(void) |
| 310 | { |
Andrew Lunn | 28a2b45 | 2011-05-15 13:32:41 +0200 | [diff] [blame] | 311 | orion_uart2_init(UART2_VIRT_BASE, UART2_PHYS_BASE, |
| 312 | IRQ_MV78XX0_UART_2, get_tclk()); |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 313 | } |
| 314 | |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 315 | /***************************************************************************** |
| 316 | * UART3 |
| 317 | ****************************************************************************/ |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 318 | void __init mv78xx0_uart3_init(void) |
| 319 | { |
Andrew Lunn | 28a2b45 | 2011-05-15 13:32:41 +0200 | [diff] [blame] | 320 | orion_uart3_init(UART3_VIRT_BASE, UART3_PHYS_BASE, |
| 321 | IRQ_MV78XX0_UART_3, get_tclk()); |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 322 | } |
| 323 | |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 324 | /***************************************************************************** |
| 325 | * Time handling |
| 326 | ****************************************************************************/ |
Lennert Buytenhek | 4ee1f6b | 2010-10-15 16:50:26 +0200 | [diff] [blame] | 327 | void __init mv78xx0_init_early(void) |
| 328 | { |
| 329 | orion_time_set_base(TIMER_VIRT_BASE); |
| 330 | } |
| 331 | |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 332 | static void mv78xx0_timer_init(void) |
| 333 | { |
Lennert Buytenhek | 4ee1f6b | 2010-10-15 16:50:26 +0200 | [diff] [blame] | 334 | orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR, |
| 335 | IRQ_MV78XX0_TIMER_1, get_tclk()); |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 336 | } |
| 337 | |
| 338 | struct sys_timer mv78xx0_timer = { |
| 339 | .init = mv78xx0_timer_init, |
| 340 | }; |
| 341 | |
| 342 | |
| 343 | /***************************************************************************** |
| 344 | * General |
| 345 | ****************************************************************************/ |
Lennert Buytenhek | cfdeb63 | 2009-02-20 02:31:35 +0100 | [diff] [blame] | 346 | static char * __init mv78xx0_id(void) |
| 347 | { |
| 348 | u32 dev, rev; |
| 349 | |
| 350 | mv78xx0_pcie_id(&dev, &rev); |
| 351 | |
| 352 | if (dev == MV78X00_Z0_DEV_ID) { |
| 353 | if (rev == MV78X00_REV_Z0) |
| 354 | return "MV78X00-Z0"; |
| 355 | else |
| 356 | return "MV78X00-Rev-Unsupported"; |
| 357 | } else if (dev == MV78100_DEV_ID) { |
| 358 | if (rev == MV78100_REV_A0) |
| 359 | return "MV78100-A0"; |
Lennert Buytenhek | 662aece | 2009-09-30 13:02:42 -0700 | [diff] [blame] | 360 | else if (rev == MV78100_REV_A1) |
| 361 | return "MV78100-A1"; |
Lennert Buytenhek | cfdeb63 | 2009-02-20 02:31:35 +0100 | [diff] [blame] | 362 | else |
| 363 | return "MV78100-Rev-Unsupported"; |
| 364 | } else if (dev == MV78200_DEV_ID) { |
| 365 | if (rev == MV78100_REV_A0) |
| 366 | return "MV78200-A0"; |
| 367 | else |
| 368 | return "MV78200-Rev-Unsupported"; |
| 369 | } else { |
| 370 | return "Device-Unknown"; |
| 371 | } |
| 372 | } |
| 373 | |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 374 | static int __init is_l2_writethrough(void) |
| 375 | { |
| 376 | return !!(readl(CPU_CONTROL) & L2_WRITETHROUGH); |
| 377 | } |
| 378 | |
| 379 | void __init mv78xx0_init(void) |
| 380 | { |
| 381 | int core_index; |
| 382 | int hclk; |
| 383 | int pclk; |
| 384 | int l2clk; |
| 385 | int tclk; |
| 386 | |
| 387 | core_index = mv78xx0_core_index(); |
| 388 | hclk = get_hclk(); |
| 389 | get_pclk_l2clk(hclk, core_index, &pclk, &l2clk); |
| 390 | tclk = get_tclk(); |
| 391 | |
Lennert Buytenhek | cfdeb63 | 2009-02-20 02:31:35 +0100 | [diff] [blame] | 392 | printk(KERN_INFO "%s ", mv78xx0_id()); |
| 393 | printk("core #%d, ", core_index); |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 394 | printk("PCLK = %dMHz, ", (pclk + 499999) / 1000000); |
| 395 | printk("L2 = %dMHz, ", (l2clk + 499999) / 1000000); |
| 396 | printk("HCLK = %dMHz, ", (hclk + 499999) / 1000000); |
| 397 | printk("TCLK = %dMHz\n", (tclk + 499999) / 1000000); |
| 398 | |
| 399 | mv78xx0_setup_cpu_mbus(); |
| 400 | |
| 401 | #ifdef CONFIG_CACHE_FEROCEON_L2 |
| 402 | feroceon_l2_init(is_l2_writethrough()); |
| 403 | #endif |
Stanislav Samsonov | 794d15b | 2008-06-22 22:45:10 +0200 | [diff] [blame] | 404 | } |