common.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  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. if (irq != NO_IRQ) {
  198. orion5x_switch_resources[0].start = irq;
  199. orion5x_switch_resources[0].end = irq;
  200. orion5x_switch_device.num_resources = 1;
  201. }
  202. d->mii_bus = &orion5x_eth_shared.dev;
  203. d->netdev = &orion5x_eth.dev;
  204. orion5x_switch_device.dev.platform_data = d;
  205. platform_device_register(&orion5x_switch_device);
  206. }
  207. /*****************************************************************************
  208. * I2C
  209. ****************************************************************************/
  210. static struct mv64xxx_i2c_pdata orion5x_i2c_pdata = {
  211. .freq_m = 8, /* assumes 166 MHz TCLK */
  212. .freq_n = 3,
  213. .timeout = 1000, /* Default timeout of 1 second */
  214. };
  215. static struct resource orion5x_i2c_resources[] = {
  216. {
  217. .name = "i2c base",
  218. .start = I2C_PHYS_BASE,
  219. .end = I2C_PHYS_BASE + 0x1f,
  220. .flags = IORESOURCE_MEM,
  221. }, {
  222. .name = "i2c irq",
  223. .start = IRQ_ORION5X_I2C,
  224. .end = IRQ_ORION5X_I2C,
  225. .flags = IORESOURCE_IRQ,
  226. },
  227. };
  228. static struct platform_device orion5x_i2c = {
  229. .name = MV64XXX_I2C_CTLR_NAME,
  230. .id = 0,
  231. .num_resources = ARRAY_SIZE(orion5x_i2c_resources),
  232. .resource = orion5x_i2c_resources,
  233. .dev = {
  234. .platform_data = &orion5x_i2c_pdata,
  235. },
  236. };
  237. void __init orion5x_i2c_init(void)
  238. {
  239. platform_device_register(&orion5x_i2c);
  240. }
  241. /*****************************************************************************
  242. * SATA
  243. ****************************************************************************/
  244. static struct resource orion5x_sata_resources[] = {
  245. {
  246. .name = "sata base",
  247. .start = ORION5X_SATA_PHYS_BASE,
  248. .end = ORION5X_SATA_PHYS_BASE + 0x5000 - 1,
  249. .flags = IORESOURCE_MEM,
  250. }, {
  251. .name = "sata irq",
  252. .start = IRQ_ORION5X_SATA,
  253. .end = IRQ_ORION5X_SATA,
  254. .flags = IORESOURCE_IRQ,
  255. },
  256. };
  257. static struct platform_device orion5x_sata = {
  258. .name = "sata_mv",
  259. .id = 0,
  260. .dev = {
  261. .coherent_dma_mask = 0xffffffff,
  262. },
  263. .num_resources = ARRAY_SIZE(orion5x_sata_resources),
  264. .resource = orion5x_sata_resources,
  265. };
  266. void __init orion5x_sata_init(struct mv_sata_platform_data *sata_data)
  267. {
  268. sata_data->dram = &orion5x_mbus_dram_info;
  269. orion5x_sata.dev.platform_data = sata_data;
  270. platform_device_register(&orion5x_sata);
  271. }
  272. /*****************************************************************************
  273. * SPI
  274. ****************************************************************************/
  275. static struct orion_spi_info orion5x_spi_plat_data = {
  276. .tclk = 0,
  277. .enable_clock_fix = 1,
  278. };
  279. static struct resource orion5x_spi_resources[] = {
  280. {
  281. .name = "spi base",
  282. .start = SPI_PHYS_BASE,
  283. .end = SPI_PHYS_BASE + 0x1f,
  284. .flags = IORESOURCE_MEM,
  285. },
  286. };
  287. static struct platform_device orion5x_spi = {
  288. .name = "orion_spi",
  289. .id = 0,
  290. .dev = {
  291. .platform_data = &orion5x_spi_plat_data,
  292. },
  293. .num_resources = ARRAY_SIZE(orion5x_spi_resources),
  294. .resource = orion5x_spi_resources,
  295. };
  296. void __init orion5x_spi_init()
  297. {
  298. platform_device_register(&orion5x_spi);
  299. }
  300. /*****************************************************************************
  301. * UART0
  302. ****************************************************************************/
  303. static struct plat_serial8250_port orion5x_uart0_data[] = {
  304. {
  305. .mapbase = UART0_PHYS_BASE,
  306. .membase = (char *)UART0_VIRT_BASE,
  307. .irq = IRQ_ORION5X_UART0,
  308. .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
  309. .iotype = UPIO_MEM,
  310. .regshift = 2,
  311. .uartclk = 0,
  312. }, {
  313. },
  314. };
  315. static struct resource orion5x_uart0_resources[] = {
  316. {
  317. .start = UART0_PHYS_BASE,
  318. .end = UART0_PHYS_BASE + 0xff,
  319. .flags = IORESOURCE_MEM,
  320. }, {
  321. .start = IRQ_ORION5X_UART0,
  322. .end = IRQ_ORION5X_UART0,
  323. .flags = IORESOURCE_IRQ,
  324. },
  325. };
  326. static struct platform_device orion5x_uart0 = {
  327. .name = "serial8250",
  328. .id = PLAT8250_DEV_PLATFORM,
  329. .dev = {
  330. .platform_data = orion5x_uart0_data,
  331. },
  332. .resource = orion5x_uart0_resources,
  333. .num_resources = ARRAY_SIZE(orion5x_uart0_resources),
  334. };
  335. void __init orion5x_uart0_init(void)
  336. {
  337. platform_device_register(&orion5x_uart0);
  338. }
  339. /*****************************************************************************
  340. * UART1
  341. ****************************************************************************/
  342. static struct plat_serial8250_port orion5x_uart1_data[] = {
  343. {
  344. .mapbase = UART1_PHYS_BASE,
  345. .membase = (char *)UART1_VIRT_BASE,
  346. .irq = IRQ_ORION5X_UART1,
  347. .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
  348. .iotype = UPIO_MEM,
  349. .regshift = 2,
  350. .uartclk = 0,
  351. }, {
  352. },
  353. };
  354. static struct resource orion5x_uart1_resources[] = {
  355. {
  356. .start = UART1_PHYS_BASE,
  357. .end = UART1_PHYS_BASE + 0xff,
  358. .flags = IORESOURCE_MEM,
  359. }, {
  360. .start = IRQ_ORION5X_UART1,
  361. .end = IRQ_ORION5X_UART1,
  362. .flags = IORESOURCE_IRQ,
  363. },
  364. };
  365. static struct platform_device orion5x_uart1 = {
  366. .name = "serial8250",
  367. .id = PLAT8250_DEV_PLATFORM1,
  368. .dev = {
  369. .platform_data = orion5x_uart1_data,
  370. },
  371. .resource = orion5x_uart1_resources,
  372. .num_resources = ARRAY_SIZE(orion5x_uart1_resources),
  373. };
  374. void __init orion5x_uart1_init(void)
  375. {
  376. platform_device_register(&orion5x_uart1);
  377. }
  378. /*****************************************************************************
  379. * XOR engine
  380. ****************************************************************************/
  381. struct mv_xor_platform_shared_data orion5x_xor_shared_data = {
  382. .dram = &orion5x_mbus_dram_info,
  383. };
  384. static struct resource orion5x_xor_shared_resources[] = {
  385. {
  386. .name = "xor low",
  387. .start = ORION5X_XOR_PHYS_BASE,
  388. .end = ORION5X_XOR_PHYS_BASE + 0xff,
  389. .flags = IORESOURCE_MEM,
  390. }, {
  391. .name = "xor high",
  392. .start = ORION5X_XOR_PHYS_BASE + 0x200,
  393. .end = ORION5X_XOR_PHYS_BASE + 0x2ff,
  394. .flags = IORESOURCE_MEM,
  395. },
  396. };
  397. static struct platform_device orion5x_xor_shared = {
  398. .name = MV_XOR_SHARED_NAME,
  399. .id = 0,
  400. .dev = {
  401. .platform_data = &orion5x_xor_shared_data,
  402. },
  403. .num_resources = ARRAY_SIZE(orion5x_xor_shared_resources),
  404. .resource = orion5x_xor_shared_resources,
  405. };
  406. static u64 orion5x_xor_dmamask = DMA_32BIT_MASK;
  407. static struct resource orion5x_xor0_resources[] = {
  408. [0] = {
  409. .start = IRQ_ORION5X_XOR0,
  410. .end = IRQ_ORION5X_XOR0,
  411. .flags = IORESOURCE_IRQ,
  412. },
  413. };
  414. static struct mv_xor_platform_data orion5x_xor0_data = {
  415. .shared = &orion5x_xor_shared,
  416. .hw_id = 0,
  417. .pool_size = PAGE_SIZE,
  418. };
  419. static struct platform_device orion5x_xor0_channel = {
  420. .name = MV_XOR_NAME,
  421. .id = 0,
  422. .num_resources = ARRAY_SIZE(orion5x_xor0_resources),
  423. .resource = orion5x_xor0_resources,
  424. .dev = {
  425. .dma_mask = &orion5x_xor_dmamask,
  426. .coherent_dma_mask = DMA_64BIT_MASK,
  427. .platform_data = (void *)&orion5x_xor0_data,
  428. },
  429. };
  430. static struct resource orion5x_xor1_resources[] = {
  431. [0] = {
  432. .start = IRQ_ORION5X_XOR1,
  433. .end = IRQ_ORION5X_XOR1,
  434. .flags = IORESOURCE_IRQ,
  435. },
  436. };
  437. static struct mv_xor_platform_data orion5x_xor1_data = {
  438. .shared = &orion5x_xor_shared,
  439. .hw_id = 1,
  440. .pool_size = PAGE_SIZE,
  441. };
  442. static struct platform_device orion5x_xor1_channel = {
  443. .name = MV_XOR_NAME,
  444. .id = 1,
  445. .num_resources = ARRAY_SIZE(orion5x_xor1_resources),
  446. .resource = orion5x_xor1_resources,
  447. .dev = {
  448. .dma_mask = &orion5x_xor_dmamask,
  449. .coherent_dma_mask = DMA_64BIT_MASK,
  450. .platform_data = (void *)&orion5x_xor1_data,
  451. },
  452. };
  453. void __init orion5x_xor_init(void)
  454. {
  455. platform_device_register(&orion5x_xor_shared);
  456. /*
  457. * two engines can't do memset simultaneously, this limitation
  458. * satisfied by removing memset support from one of the engines.
  459. */
  460. dma_cap_set(DMA_MEMCPY, orion5x_xor0_data.cap_mask);
  461. dma_cap_set(DMA_XOR, orion5x_xor0_data.cap_mask);
  462. platform_device_register(&orion5x_xor0_channel);
  463. dma_cap_set(DMA_MEMCPY, orion5x_xor1_data.cap_mask);
  464. dma_cap_set(DMA_MEMSET, orion5x_xor1_data.cap_mask);
  465. dma_cap_set(DMA_XOR, orion5x_xor1_data.cap_mask);
  466. platform_device_register(&orion5x_xor1_channel);
  467. }
  468. /*****************************************************************************
  469. * Watchdog
  470. ****************************************************************************/
  471. static struct orion5x_wdt_platform_data orion5x_wdt_data = {
  472. .tclk = 0,
  473. };
  474. static struct platform_device orion5x_wdt_device = {
  475. .name = "orion5x_wdt",
  476. .id = -1,
  477. .dev = {
  478. .platform_data = &orion5x_wdt_data,
  479. },
  480. .num_resources = 0,
  481. };
  482. void __init orion5x_wdt_init(void)
  483. {
  484. orion5x_wdt_data.tclk = orion5x_tclk;
  485. platform_device_register(&orion5x_wdt_device);
  486. }
  487. /*****************************************************************************
  488. * Time handling
  489. ****************************************************************************/
  490. int orion5x_tclk;
  491. int __init orion5x_find_tclk(void)
  492. {
  493. u32 dev, rev;
  494. orion5x_pcie_id(&dev, &rev);
  495. if (dev == MV88F6183_DEV_ID &&
  496. (readl(MPP_RESET_SAMPLE) & 0x00000200) == 0)
  497. return 133333333;
  498. return 166666667;
  499. }
  500. static void orion5x_timer_init(void)
  501. {
  502. orion5x_tclk = orion5x_find_tclk();
  503. orion_time_init(IRQ_ORION5X_BRIDGE, orion5x_tclk);
  504. }
  505. struct sys_timer orion5x_timer = {
  506. .init = orion5x_timer_init,
  507. };
  508. /*****************************************************************************
  509. * General
  510. ****************************************************************************/
  511. /*
  512. * Identify device ID and rev from PCIe configuration header space '0'.
  513. */
  514. static void __init orion5x_id(u32 *dev, u32 *rev, char **dev_name)
  515. {
  516. orion5x_pcie_id(dev, rev);
  517. if (*dev == MV88F5281_DEV_ID) {
  518. if (*rev == MV88F5281_REV_D2) {
  519. *dev_name = "MV88F5281-D2";
  520. } else if (*rev == MV88F5281_REV_D1) {
  521. *dev_name = "MV88F5281-D1";
  522. } else if (*rev == MV88F5281_REV_D0) {
  523. *dev_name = "MV88F5281-D0";
  524. } else {
  525. *dev_name = "MV88F5281-Rev-Unsupported";
  526. }
  527. } else if (*dev == MV88F5182_DEV_ID) {
  528. if (*rev == MV88F5182_REV_A2) {
  529. *dev_name = "MV88F5182-A2";
  530. } else {
  531. *dev_name = "MV88F5182-Rev-Unsupported";
  532. }
  533. } else if (*dev == MV88F5181_DEV_ID) {
  534. if (*rev == MV88F5181_REV_B1) {
  535. *dev_name = "MV88F5181-Rev-B1";
  536. } else if (*rev == MV88F5181L_REV_A1) {
  537. *dev_name = "MV88F5181L-Rev-A1";
  538. } else {
  539. *dev_name = "MV88F5181(L)-Rev-Unsupported";
  540. }
  541. } else if (*dev == MV88F6183_DEV_ID) {
  542. if (*rev == MV88F6183_REV_B0) {
  543. *dev_name = "MV88F6183-Rev-B0";
  544. } else {
  545. *dev_name = "MV88F6183-Rev-Unsupported";
  546. }
  547. } else {
  548. *dev_name = "Device-Unknown";
  549. }
  550. }
  551. void __init orion5x_init(void)
  552. {
  553. char *dev_name;
  554. u32 dev, rev;
  555. orion5x_id(&dev, &rev, &dev_name);
  556. printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk);
  557. orion5x_eth_shared_data.t_clk = orion5x_tclk;
  558. orion5x_spi_plat_data.tclk = orion5x_tclk;
  559. orion5x_uart0_data[0].uartclk = orion5x_tclk;
  560. orion5x_uart1_data[0].uartclk = orion5x_tclk;
  561. /*
  562. * Setup Orion address map
  563. */
  564. orion5x_setup_cpu_mbus_bridge();
  565. /*
  566. * Don't issue "Wait for Interrupt" instruction if we are
  567. * running on D0 5281 silicon.
  568. */
  569. if (dev == MV88F5281_DEV_ID && rev == MV88F5281_REV_D0) {
  570. printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n");
  571. disable_hlt();
  572. }
  573. /*
  574. * Register watchdog driver
  575. */
  576. orion5x_wdt_init();
  577. }
  578. /*
  579. * Many orion-based systems have buggy bootloader implementations.
  580. * This is a common fixup for bogus memory tags.
  581. */
  582. void __init tag_fixup_mem32(struct machine_desc *mdesc, struct tag *t,
  583. char **from, struct meminfo *meminfo)
  584. {
  585. for (; t->hdr.size; t = tag_next(t))
  586. if (t->hdr.tag == ATAG_MEM &&
  587. (!t->u.mem.size || t->u.mem.size & ~PAGE_MASK ||
  588. t->u.mem.start & ~PAGE_MASK)) {
  589. printk(KERN_WARNING
  590. "Clearing invalid memory bank %dKB@0x%08x\n",
  591. t->u.mem.size / 1024, t->u.mem.start);
  592. t->hdr.tag = 0;
  593. }
  594. }