common.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. /*
  2. * arch/arm/mach-orion5x/common.c
  3. *
  4. * Core functions for Marvell Orion 5x SoCs
  5. *
  6. * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
  7. *
  8. * This file is licensed under the terms of the GNU General Public
  9. * License version 2. This program is licensed "as is" without any
  10. * warranty of any kind, whether express or implied.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/serial_8250.h>
  16. #include <linux/mbus.h>
  17. #include <linux/mv643xx_eth.h>
  18. #include <linux/mv643xx_i2c.h>
  19. #include <linux/ata_platform.h>
  20. #include <linux/spi/orion_spi.h>
  21. #include <net/dsa.h>
  22. #include <asm/page.h>
  23. #include <asm/setup.h>
  24. #include <asm/timex.h>
  25. #include <asm/mach/arch.h>
  26. #include <asm/mach/map.h>
  27. #include <asm/mach/time.h>
  28. #include <mach/hardware.h>
  29. #include <mach/orion5x.h>
  30. #include <plat/ehci-orion.h>
  31. #include <plat/mv_xor.h>
  32. #include <plat/orion_nand.h>
  33. #include <plat/orion5x_wdt.h>
  34. #include <plat/time.h>
  35. #include "common.h"
  36. /*****************************************************************************
  37. * I/O Address Mapping
  38. ****************************************************************************/
  39. static struct map_desc orion5x_io_desc[] __initdata = {
  40. {
  41. .virtual = ORION5X_REGS_VIRT_BASE,
  42. .pfn = __phys_to_pfn(ORION5X_REGS_PHYS_BASE),
  43. .length = ORION5X_REGS_SIZE,
  44. .type = MT_DEVICE,
  45. }, {
  46. .virtual = ORION5X_PCIE_IO_VIRT_BASE,
  47. .pfn = __phys_to_pfn(ORION5X_PCIE_IO_PHYS_BASE),
  48. .length = ORION5X_PCIE_IO_SIZE,
  49. .type = MT_DEVICE,
  50. }, {
  51. .virtual = ORION5X_PCI_IO_VIRT_BASE,
  52. .pfn = __phys_to_pfn(ORION5X_PCI_IO_PHYS_BASE),
  53. .length = ORION5X_PCI_IO_SIZE,
  54. .type = MT_DEVICE,
  55. }, {
  56. .virtual = ORION5X_PCIE_WA_VIRT_BASE,
  57. .pfn = __phys_to_pfn(ORION5X_PCIE_WA_PHYS_BASE),
  58. .length = ORION5X_PCIE_WA_SIZE,
  59. .type = MT_DEVICE,
  60. },
  61. };
  62. void __init orion5x_map_io(void)
  63. {
  64. iotable_init(orion5x_io_desc, ARRAY_SIZE(orion5x_io_desc));
  65. }
  66. /*****************************************************************************
  67. * EHCI
  68. ****************************************************************************/
  69. static struct orion_ehci_data orion5x_ehci_data = {
  70. .dram = &orion5x_mbus_dram_info,
  71. .phy_version = EHCI_PHY_ORION,
  72. };
  73. static u64 ehci_dmamask = 0xffffffffUL;
  74. /*****************************************************************************
  75. * EHCI0
  76. ****************************************************************************/
  77. static struct resource orion5x_ehci0_resources[] = {
  78. {
  79. .start = ORION5X_USB0_PHYS_BASE,
  80. .end = ORION5X_USB0_PHYS_BASE + SZ_4K - 1,
  81. .flags = IORESOURCE_MEM,
  82. }, {
  83. .start = IRQ_ORION5X_USB0_CTRL,
  84. .end = IRQ_ORION5X_USB0_CTRL,
  85. .flags = IORESOURCE_IRQ,
  86. },
  87. };
  88. static struct platform_device orion5x_ehci0 = {
  89. .name = "orion-ehci",
  90. .id = 0,
  91. .dev = {
  92. .dma_mask = &ehci_dmamask,
  93. .coherent_dma_mask = 0xffffffff,
  94. .platform_data = &orion5x_ehci_data,
  95. },
  96. .resource = orion5x_ehci0_resources,
  97. .num_resources = ARRAY_SIZE(orion5x_ehci0_resources),
  98. };
  99. void __init orion5x_ehci0_init(void)
  100. {
  101. platform_device_register(&orion5x_ehci0);
  102. }
  103. /*****************************************************************************
  104. * EHCI1
  105. ****************************************************************************/
  106. static struct resource orion5x_ehci1_resources[] = {
  107. {
  108. .start = ORION5X_USB1_PHYS_BASE,
  109. .end = ORION5X_USB1_PHYS_BASE + SZ_4K - 1,
  110. .flags = IORESOURCE_MEM,
  111. }, {
  112. .start = IRQ_ORION5X_USB1_CTRL,
  113. .end = IRQ_ORION5X_USB1_CTRL,
  114. .flags = IORESOURCE_IRQ,
  115. },
  116. };
  117. static struct platform_device orion5x_ehci1 = {
  118. .name = "orion-ehci",
  119. .id = 1,
  120. .dev = {
  121. .dma_mask = &ehci_dmamask,
  122. .coherent_dma_mask = 0xffffffff,
  123. .platform_data = &orion5x_ehci_data,
  124. },
  125. .resource = orion5x_ehci1_resources,
  126. .num_resources = ARRAY_SIZE(orion5x_ehci1_resources),
  127. };
  128. void __init orion5x_ehci1_init(void)
  129. {
  130. platform_device_register(&orion5x_ehci1);
  131. }
  132. /*****************************************************************************
  133. * GigE
  134. ****************************************************************************/
  135. struct mv643xx_eth_shared_platform_data orion5x_eth_shared_data = {
  136. .dram = &orion5x_mbus_dram_info,
  137. };
  138. static struct resource orion5x_eth_shared_resources[] = {
  139. {
  140. .start = ORION5X_ETH_PHYS_BASE + 0x2000,
  141. .end = ORION5X_ETH_PHYS_BASE + 0x3fff,
  142. .flags = IORESOURCE_MEM,
  143. }, {
  144. .start = IRQ_ORION5X_ETH_ERR,
  145. .end = IRQ_ORION5X_ETH_ERR,
  146. .flags = IORESOURCE_IRQ,
  147. },
  148. };
  149. static struct platform_device orion5x_eth_shared = {
  150. .name = MV643XX_ETH_SHARED_NAME,
  151. .id = 0,
  152. .dev = {
  153. .platform_data = &orion5x_eth_shared_data,
  154. },
  155. .num_resources = ARRAY_SIZE(orion5x_eth_shared_resources),
  156. .resource = orion5x_eth_shared_resources,
  157. };
  158. static struct resource orion5x_eth_resources[] = {
  159. {
  160. .name = "eth irq",
  161. .start = IRQ_ORION5X_ETH_SUM,
  162. .end = IRQ_ORION5X_ETH_SUM,
  163. .flags = IORESOURCE_IRQ,
  164. },
  165. };
  166. static struct platform_device orion5x_eth = {
  167. .name = MV643XX_ETH_NAME,
  168. .id = 0,
  169. .num_resources = 1,
  170. .resource = orion5x_eth_resources,
  171. };
  172. void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data)
  173. {
  174. eth_data->shared = &orion5x_eth_shared;
  175. orion5x_eth.dev.platform_data = eth_data;
  176. platform_device_register(&orion5x_eth_shared);
  177. platform_device_register(&orion5x_eth);
  178. }
  179. /*****************************************************************************
  180. * Ethernet switch
  181. ****************************************************************************/
  182. static struct resource orion5x_switch_resources[] = {
  183. {
  184. .start = 0,
  185. .end = 0,
  186. .flags = IORESOURCE_IRQ,
  187. },
  188. };
  189. static struct platform_device orion5x_switch_device = {
  190. .name = "dsa",
  191. .id = 0,
  192. .num_resources = 0,
  193. .resource = orion5x_switch_resources,
  194. };
  195. void __init orion5x_eth_switch_init(struct dsa_platform_data *d, int irq)
  196. {
  197. int i;
  198. if (irq != NO_IRQ) {
  199. orion5x_switch_resources[0].start = irq;
  200. orion5x_switch_resources[0].end = irq;
  201. orion5x_switch_device.num_resources = 1;
  202. }
  203. d->netdev = &orion5x_eth.dev;
  204. for (i = 0; i < d->nr_chips; i++)
  205. d->chip[i].mii_bus = &orion5x_eth_shared.dev;
  206. orion5x_switch_device.dev.platform_data = d;
  207. platform_device_register(&orion5x_switch_device);
  208. }
  209. /*****************************************************************************
  210. * I2C
  211. ****************************************************************************/
  212. static struct mv64xxx_i2c_pdata orion5x_i2c_pdata = {
  213. .freq_m = 8, /* assumes 166 MHz TCLK */
  214. .freq_n = 3,
  215. .timeout = 1000, /* Default timeout of 1 second */
  216. };
  217. static struct resource orion5x_i2c_resources[] = {
  218. {
  219. .name = "i2c base",
  220. .start = I2C_PHYS_BASE,
  221. .end = I2C_PHYS_BASE + 0x1f,
  222. .flags = IORESOURCE_MEM,
  223. }, {
  224. .name = "i2c irq",
  225. .start = IRQ_ORION5X_I2C,
  226. .end = IRQ_ORION5X_I2C,
  227. .flags = IORESOURCE_IRQ,
  228. },
  229. };
  230. static struct platform_device orion5x_i2c = {
  231. .name = MV64XXX_I2C_CTLR_NAME,
  232. .id = 0,
  233. .num_resources = ARRAY_SIZE(orion5x_i2c_resources),
  234. .resource = orion5x_i2c_resources,
  235. .dev = {
  236. .platform_data = &orion5x_i2c_pdata,
  237. },
  238. };
  239. void __init orion5x_i2c_init(void)
  240. {
  241. platform_device_register(&orion5x_i2c);
  242. }
  243. /*****************************************************************************
  244. * SATA
  245. ****************************************************************************/
  246. static struct resource orion5x_sata_resources[] = {
  247. {
  248. .name = "sata base",
  249. .start = ORION5X_SATA_PHYS_BASE,
  250. .end = ORION5X_SATA_PHYS_BASE + 0x5000 - 1,
  251. .flags = IORESOURCE_MEM,
  252. }, {
  253. .name = "sata irq",
  254. .start = IRQ_ORION5X_SATA,
  255. .end = IRQ_ORION5X_SATA,
  256. .flags = IORESOURCE_IRQ,
  257. },
  258. };
  259. static struct platform_device orion5x_sata = {
  260. .name = "sata_mv",
  261. .id = 0,
  262. .dev = {
  263. .coherent_dma_mask = 0xffffffff,
  264. },
  265. .num_resources = ARRAY_SIZE(orion5x_sata_resources),
  266. .resource = orion5x_sata_resources,
  267. };
  268. void __init orion5x_sata_init(struct mv_sata_platform_data *sata_data)
  269. {
  270. sata_data->dram = &orion5x_mbus_dram_info;
  271. orion5x_sata.dev.platform_data = sata_data;
  272. platform_device_register(&orion5x_sata);
  273. }
  274. /*****************************************************************************
  275. * SPI
  276. ****************************************************************************/
  277. static struct orion_spi_info orion5x_spi_plat_data = {
  278. .tclk = 0,
  279. .enable_clock_fix = 1,
  280. };
  281. static struct resource orion5x_spi_resources[] = {
  282. {
  283. .name = "spi base",
  284. .start = SPI_PHYS_BASE,
  285. .end = SPI_PHYS_BASE + 0x1f,
  286. .flags = IORESOURCE_MEM,
  287. },
  288. };
  289. static struct platform_device orion5x_spi = {
  290. .name = "orion_spi",
  291. .id = 0,
  292. .dev = {
  293. .platform_data = &orion5x_spi_plat_data,
  294. },
  295. .num_resources = ARRAY_SIZE(orion5x_spi_resources),
  296. .resource = orion5x_spi_resources,
  297. };
  298. void __init orion5x_spi_init()
  299. {
  300. platform_device_register(&orion5x_spi);
  301. }
  302. /*****************************************************************************
  303. * UART0
  304. ****************************************************************************/
  305. static struct plat_serial8250_port orion5x_uart0_data[] = {
  306. {
  307. .mapbase = UART0_PHYS_BASE,
  308. .membase = (char *)UART0_VIRT_BASE,
  309. .irq = IRQ_ORION5X_UART0,
  310. .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
  311. .iotype = UPIO_MEM,
  312. .regshift = 2,
  313. .uartclk = 0,
  314. }, {
  315. },
  316. };
  317. static struct resource orion5x_uart0_resources[] = {
  318. {
  319. .start = UART0_PHYS_BASE,
  320. .end = UART0_PHYS_BASE + 0xff,
  321. .flags = IORESOURCE_MEM,
  322. }, {
  323. .start = IRQ_ORION5X_UART0,
  324. .end = IRQ_ORION5X_UART0,
  325. .flags = IORESOURCE_IRQ,
  326. },
  327. };
  328. static struct platform_device orion5x_uart0 = {
  329. .name = "serial8250",
  330. .id = PLAT8250_DEV_PLATFORM,
  331. .dev = {
  332. .platform_data = orion5x_uart0_data,
  333. },
  334. .resource = orion5x_uart0_resources,
  335. .num_resources = ARRAY_SIZE(orion5x_uart0_resources),
  336. };
  337. void __init orion5x_uart0_init(void)
  338. {
  339. platform_device_register(&orion5x_uart0);
  340. }
  341. /*****************************************************************************
  342. * UART1
  343. ****************************************************************************/
  344. static struct plat_serial8250_port orion5x_uart1_data[] = {
  345. {
  346. .mapbase = UART1_PHYS_BASE,
  347. .membase = (char *)UART1_VIRT_BASE,
  348. .irq = IRQ_ORION5X_UART1,
  349. .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
  350. .iotype = UPIO_MEM,
  351. .regshift = 2,
  352. .uartclk = 0,
  353. }, {
  354. },
  355. };
  356. static struct resource orion5x_uart1_resources[] = {
  357. {
  358. .start = UART1_PHYS_BASE,
  359. .end = UART1_PHYS_BASE + 0xff,
  360. .flags = IORESOURCE_MEM,
  361. }, {
  362. .start = IRQ_ORION5X_UART1,
  363. .end = IRQ_ORION5X_UART1,
  364. .flags = IORESOURCE_IRQ,
  365. },
  366. };
  367. static struct platform_device orion5x_uart1 = {
  368. .name = "serial8250",
  369. .id = PLAT8250_DEV_PLATFORM1,
  370. .dev = {
  371. .platform_data = orion5x_uart1_data,
  372. },
  373. .resource = orion5x_uart1_resources,
  374. .num_resources = ARRAY_SIZE(orion5x_uart1_resources),
  375. };
  376. void __init orion5x_uart1_init(void)
  377. {
  378. platform_device_register(&orion5x_uart1);
  379. }
  380. /*****************************************************************************
  381. * XOR engine
  382. ****************************************************************************/
  383. struct mv_xor_platform_shared_data orion5x_xor_shared_data = {
  384. .dram = &orion5x_mbus_dram_info,
  385. };
  386. static struct resource orion5x_xor_shared_resources[] = {
  387. {
  388. .name = "xor low",
  389. .start = ORION5X_XOR_PHYS_BASE,
  390. .end = ORION5X_XOR_PHYS_BASE + 0xff,
  391. .flags = IORESOURCE_MEM,
  392. }, {
  393. .name = "xor high",
  394. .start = ORION5X_XOR_PHYS_BASE + 0x200,
  395. .end = ORION5X_XOR_PHYS_BASE + 0x2ff,
  396. .flags = IORESOURCE_MEM,
  397. },
  398. };
  399. static struct platform_device orion5x_xor_shared = {
  400. .name = MV_XOR_SHARED_NAME,
  401. .id = 0,
  402. .dev = {
  403. .platform_data = &orion5x_xor_shared_data,
  404. },
  405. .num_resources = ARRAY_SIZE(orion5x_xor_shared_resources),
  406. .resource = orion5x_xor_shared_resources,
  407. };
  408. static u64 orion5x_xor_dmamask = DMA_BIT_MASK(32);
  409. static struct resource orion5x_xor0_resources[] = {
  410. [0] = {
  411. .start = IRQ_ORION5X_XOR0,
  412. .end = IRQ_ORION5X_XOR0,
  413. .flags = IORESOURCE_IRQ,
  414. },
  415. };
  416. static struct mv_xor_platform_data orion5x_xor0_data = {
  417. .shared = &orion5x_xor_shared,
  418. .hw_id = 0,
  419. .pool_size = PAGE_SIZE,
  420. };
  421. static struct platform_device orion5x_xor0_channel = {
  422. .name = MV_XOR_NAME,
  423. .id = 0,
  424. .num_resources = ARRAY_SIZE(orion5x_xor0_resources),
  425. .resource = orion5x_xor0_resources,
  426. .dev = {
  427. .dma_mask = &orion5x_xor_dmamask,
  428. .coherent_dma_mask = DMA_BIT_MASK(64),
  429. .platform_data = (void *)&orion5x_xor0_data,
  430. },
  431. };
  432. static struct resource orion5x_xor1_resources[] = {
  433. [0] = {
  434. .start = IRQ_ORION5X_XOR1,
  435. .end = IRQ_ORION5X_XOR1,
  436. .flags = IORESOURCE_IRQ,
  437. },
  438. };
  439. static struct mv_xor_platform_data orion5x_xor1_data = {
  440. .shared = &orion5x_xor_shared,
  441. .hw_id = 1,
  442. .pool_size = PAGE_SIZE,
  443. };
  444. static struct platform_device orion5x_xor1_channel = {
  445. .name = MV_XOR_NAME,
  446. .id = 1,
  447. .num_resources = ARRAY_SIZE(orion5x_xor1_resources),
  448. .resource = orion5x_xor1_resources,
  449. .dev = {
  450. .dma_mask = &orion5x_xor_dmamask,
  451. .coherent_dma_mask = DMA_BIT_MASK(64),
  452. .platform_data = (void *)&orion5x_xor1_data,
  453. },
  454. };
  455. void __init orion5x_xor_init(void)
  456. {
  457. platform_device_register(&orion5x_xor_shared);
  458. /*
  459. * two engines can't do memset simultaneously, this limitation
  460. * satisfied by removing memset support from one of the engines.
  461. */
  462. dma_cap_set(DMA_MEMCPY, orion5x_xor0_data.cap_mask);
  463. dma_cap_set(DMA_XOR, orion5x_xor0_data.cap_mask);
  464. platform_device_register(&orion5x_xor0_channel);
  465. dma_cap_set(DMA_MEMCPY, orion5x_xor1_data.cap_mask);
  466. dma_cap_set(DMA_MEMSET, orion5x_xor1_data.cap_mask);
  467. dma_cap_set(DMA_XOR, orion5x_xor1_data.cap_mask);
  468. platform_device_register(&orion5x_xor1_channel);
  469. }
  470. /*****************************************************************************
  471. * Watchdog
  472. ****************************************************************************/
  473. static struct orion5x_wdt_platform_data orion5x_wdt_data = {
  474. .tclk = 0,
  475. };
  476. static struct platform_device orion5x_wdt_device = {
  477. .name = "orion5x_wdt",
  478. .id = -1,
  479. .dev = {
  480. .platform_data = &orion5x_wdt_data,
  481. },
  482. .num_resources = 0,
  483. };
  484. void __init orion5x_wdt_init(void)
  485. {
  486. orion5x_wdt_data.tclk = orion5x_tclk;
  487. platform_device_register(&orion5x_wdt_device);
  488. }
  489. /*****************************************************************************
  490. * Time handling
  491. ****************************************************************************/
  492. int orion5x_tclk;
  493. int __init orion5x_find_tclk(void)
  494. {
  495. u32 dev, rev;
  496. orion5x_pcie_id(&dev, &rev);
  497. if (dev == MV88F6183_DEV_ID &&
  498. (readl(MPP_RESET_SAMPLE) & 0x00000200) == 0)
  499. return 133333333;
  500. return 166666667;
  501. }
  502. static void orion5x_timer_init(void)
  503. {
  504. orion5x_tclk = orion5x_find_tclk();
  505. orion_time_init(IRQ_ORION5X_BRIDGE, orion5x_tclk);
  506. }
  507. struct sys_timer orion5x_timer = {
  508. .init = orion5x_timer_init,
  509. };
  510. /*****************************************************************************
  511. * General
  512. ****************************************************************************/
  513. /*
  514. * Identify device ID and rev from PCIe configuration header space '0'.
  515. */
  516. static void __init orion5x_id(u32 *dev, u32 *rev, char **dev_name)
  517. {
  518. orion5x_pcie_id(dev, rev);
  519. if (*dev == MV88F5281_DEV_ID) {
  520. if (*rev == MV88F5281_REV_D2) {
  521. *dev_name = "MV88F5281-D2";
  522. } else if (*rev == MV88F5281_REV_D1) {
  523. *dev_name = "MV88F5281-D1";
  524. } else if (*rev == MV88F5281_REV_D0) {
  525. *dev_name = "MV88F5281-D0";
  526. } else {
  527. *dev_name = "MV88F5281-Rev-Unsupported";
  528. }
  529. } else if (*dev == MV88F5182_DEV_ID) {
  530. if (*rev == MV88F5182_REV_A2) {
  531. *dev_name = "MV88F5182-A2";
  532. } else {
  533. *dev_name = "MV88F5182-Rev-Unsupported";
  534. }
  535. } else if (*dev == MV88F5181_DEV_ID) {
  536. if (*rev == MV88F5181_REV_B1) {
  537. *dev_name = "MV88F5181-Rev-B1";
  538. } else if (*rev == MV88F5181L_REV_A1) {
  539. *dev_name = "MV88F5181L-Rev-A1";
  540. } else {
  541. *dev_name = "MV88F5181(L)-Rev-Unsupported";
  542. }
  543. } else if (*dev == MV88F6183_DEV_ID) {
  544. if (*rev == MV88F6183_REV_B0) {
  545. *dev_name = "MV88F6183-Rev-B0";
  546. } else {
  547. *dev_name = "MV88F6183-Rev-Unsupported";
  548. }
  549. } else {
  550. *dev_name = "Device-Unknown";
  551. }
  552. }
  553. void __init orion5x_init(void)
  554. {
  555. char *dev_name;
  556. u32 dev, rev;
  557. orion5x_id(&dev, &rev, &dev_name);
  558. printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk);
  559. orion5x_eth_shared_data.t_clk = orion5x_tclk;
  560. orion5x_spi_plat_data.tclk = orion5x_tclk;
  561. orion5x_uart0_data[0].uartclk = orion5x_tclk;
  562. orion5x_uart1_data[0].uartclk = orion5x_tclk;
  563. /*
  564. * Setup Orion address map
  565. */
  566. orion5x_setup_cpu_mbus_bridge();
  567. /*
  568. * Don't issue "Wait for Interrupt" instruction if we are
  569. * running on D0 5281 silicon.
  570. */
  571. if (dev == MV88F5281_DEV_ID && rev == MV88F5281_REV_D0) {
  572. printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n");
  573. disable_hlt();
  574. }
  575. /*
  576. * Register watchdog driver
  577. */
  578. orion5x_wdt_init();
  579. }
  580. /*
  581. * Many orion-based systems have buggy bootloader implementations.
  582. * This is a common fixup for bogus memory tags.
  583. */
  584. void __init tag_fixup_mem32(struct machine_desc *mdesc, struct tag *t,
  585. char **from, struct meminfo *meminfo)
  586. {
  587. for (; t->hdr.size; t = tag_next(t))
  588. if (t->hdr.tag == ATAG_MEM &&
  589. (!t->u.mem.size || t->u.mem.size & ~PAGE_MASK ||
  590. t->u.mem.start & ~PAGE_MASK)) {
  591. printk(KERN_WARNING
  592. "Clearing invalid memory bank %dKB@0x%08x\n",
  593. t->u.mem.size / 1024, t->u.mem.start);
  594. t->hdr.tag = 0;
  595. }
  596. }