setup.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. /*
  2. * iop13xx platform Initialization
  3. * Copyright (c) 2005-2006, Intel Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms and conditions of the GNU General Public License,
  7. * version 2, as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  16. * Place - Suite 330, Boston, MA 02111-1307 USA.
  17. *
  18. */
  19. #include <linux/dma-mapping.h>
  20. #include <linux/serial_8250.h>
  21. #include <linux/io.h>
  22. #include <linux/reboot.h>
  23. #ifdef CONFIG_MTD_PHYSMAP
  24. #include <linux/mtd/physmap.h>
  25. #endif
  26. #include <asm/mach/map.h>
  27. #include <mach/hardware.h>
  28. #include <asm/irq.h>
  29. #include <asm/hardware/iop_adma.h>
  30. #include <mach/irqs.h>
  31. #define IOP13XX_UART_XTAL 33334000
  32. #define IOP13XX_SETUP_DEBUG 0
  33. #define PRINTK(x...) ((void)(IOP13XX_SETUP_DEBUG && printk(x)))
  34. /* Standard IO mapping for all IOP13XX based systems
  35. */
  36. static struct map_desc iop13xx_std_desc[] __initdata = {
  37. { /* mem mapped registers */
  38. .virtual = (unsigned long)IOP13XX_PMMR_VIRT_MEM_BASE,
  39. .pfn = __phys_to_pfn(IOP13XX_PMMR_PHYS_MEM_BASE),
  40. .length = IOP13XX_PMMR_SIZE,
  41. .type = MT_DEVICE,
  42. },
  43. };
  44. static struct resource iop13xx_uart0_resources[] = {
  45. [0] = {
  46. .start = IOP13XX_UART0_PHYS,
  47. .end = IOP13XX_UART0_PHYS + 0x3f,
  48. .flags = IORESOURCE_MEM,
  49. },
  50. [1] = {
  51. .start = IRQ_IOP13XX_UART0,
  52. .end = IRQ_IOP13XX_UART0,
  53. .flags = IORESOURCE_IRQ
  54. }
  55. };
  56. static struct resource iop13xx_uart1_resources[] = {
  57. [0] = {
  58. .start = IOP13XX_UART1_PHYS,
  59. .end = IOP13XX_UART1_PHYS + 0x3f,
  60. .flags = IORESOURCE_MEM,
  61. },
  62. [1] = {
  63. .start = IRQ_IOP13XX_UART1,
  64. .end = IRQ_IOP13XX_UART1,
  65. .flags = IORESOURCE_IRQ
  66. }
  67. };
  68. static struct plat_serial8250_port iop13xx_uart0_data[] = {
  69. {
  70. .membase = IOP13XX_UART0_VIRT,
  71. .mapbase = IOP13XX_UART0_PHYS,
  72. .irq = IRQ_IOP13XX_UART0,
  73. .uartclk = IOP13XX_UART_XTAL,
  74. .regshift = 2,
  75. .iotype = UPIO_MEM,
  76. .flags = UPF_SKIP_TEST,
  77. },
  78. { },
  79. };
  80. static struct plat_serial8250_port iop13xx_uart1_data[] = {
  81. {
  82. .membase = IOP13XX_UART1_VIRT,
  83. .mapbase = IOP13XX_UART1_PHYS,
  84. .irq = IRQ_IOP13XX_UART1,
  85. .uartclk = IOP13XX_UART_XTAL,
  86. .regshift = 2,
  87. .iotype = UPIO_MEM,
  88. .flags = UPF_SKIP_TEST,
  89. },
  90. { },
  91. };
  92. /* The ids are fixed up later in iop13xx_platform_init */
  93. static struct platform_device iop13xx_uart0 = {
  94. .name = "serial8250",
  95. .id = 0,
  96. .dev.platform_data = iop13xx_uart0_data,
  97. .num_resources = 2,
  98. .resource = iop13xx_uart0_resources,
  99. };
  100. static struct platform_device iop13xx_uart1 = {
  101. .name = "serial8250",
  102. .id = 0,
  103. .dev.platform_data = iop13xx_uart1_data,
  104. .num_resources = 2,
  105. .resource = iop13xx_uart1_resources
  106. };
  107. static struct resource iop13xx_i2c_0_resources[] = {
  108. [0] = {
  109. .start = IOP13XX_I2C0_PHYS,
  110. .end = IOP13XX_I2C0_PHYS + 0x18,
  111. .flags = IORESOURCE_MEM,
  112. },
  113. [1] = {
  114. .start = IRQ_IOP13XX_I2C_0,
  115. .end = IRQ_IOP13XX_I2C_0,
  116. .flags = IORESOURCE_IRQ
  117. }
  118. };
  119. static struct resource iop13xx_i2c_1_resources[] = {
  120. [0] = {
  121. .start = IOP13XX_I2C1_PHYS,
  122. .end = IOP13XX_I2C1_PHYS + 0x18,
  123. .flags = IORESOURCE_MEM,
  124. },
  125. [1] = {
  126. .start = IRQ_IOP13XX_I2C_1,
  127. .end = IRQ_IOP13XX_I2C_1,
  128. .flags = IORESOURCE_IRQ
  129. }
  130. };
  131. static struct resource iop13xx_i2c_2_resources[] = {
  132. [0] = {
  133. .start = IOP13XX_I2C2_PHYS,
  134. .end = IOP13XX_I2C2_PHYS + 0x18,
  135. .flags = IORESOURCE_MEM,
  136. },
  137. [1] = {
  138. .start = IRQ_IOP13XX_I2C_2,
  139. .end = IRQ_IOP13XX_I2C_2,
  140. .flags = IORESOURCE_IRQ
  141. }
  142. };
  143. /* I2C controllers. The IOP13XX uses the same block as the IOP3xx, so
  144. * we just use the same device name.
  145. */
  146. /* The ids are fixed up later in iop13xx_platform_init */
  147. static struct platform_device iop13xx_i2c_0_controller = {
  148. .name = "IOP3xx-I2C",
  149. .id = 0,
  150. .num_resources = 2,
  151. .resource = iop13xx_i2c_0_resources
  152. };
  153. static struct platform_device iop13xx_i2c_1_controller = {
  154. .name = "IOP3xx-I2C",
  155. .id = 0,
  156. .num_resources = 2,
  157. .resource = iop13xx_i2c_1_resources
  158. };
  159. static struct platform_device iop13xx_i2c_2_controller = {
  160. .name = "IOP3xx-I2C",
  161. .id = 0,
  162. .num_resources = 2,
  163. .resource = iop13xx_i2c_2_resources
  164. };
  165. #ifdef CONFIG_MTD_PHYSMAP
  166. /* PBI Flash Device
  167. */
  168. static struct physmap_flash_data iq8134x_flash_data = {
  169. .width = 2,
  170. };
  171. static struct resource iq8134x_flash_resource = {
  172. .start = IQ81340_FLASHBASE,
  173. .end = 0,
  174. .flags = IORESOURCE_MEM,
  175. };
  176. static struct platform_device iq8134x_flash = {
  177. .name = "physmap-flash",
  178. .id = 0,
  179. .dev = { .platform_data = &iq8134x_flash_data, },
  180. .num_resources = 1,
  181. .resource = &iq8134x_flash_resource,
  182. };
  183. static unsigned long iq8134x_probe_flash_size(void)
  184. {
  185. uint8_t __iomem *flash_addr = ioremap(IQ81340_FLASHBASE, PAGE_SIZE);
  186. int i;
  187. char query[3];
  188. unsigned long size = 0;
  189. int width = iq8134x_flash_data.width;
  190. if (flash_addr) {
  191. /* send CFI 'query' command */
  192. writew(0x98, flash_addr);
  193. /* check for CFI compliance */
  194. for (i = 0; i < 3 * width; i += width)
  195. query[i / width] = readb(flash_addr + (0x10 * width) + i);
  196. /* read the size */
  197. if (memcmp(query, "QRY", 3) == 0)
  198. size = 1 << readb(flash_addr + (0x27 * width));
  199. /* send CFI 'read array' command */
  200. writew(0xff, flash_addr);
  201. iounmap(flash_addr);
  202. }
  203. return size;
  204. }
  205. #endif
  206. /* ADMA Channels */
  207. static struct resource iop13xx_adma_0_resources[] = {
  208. [0] = {
  209. .start = IOP13XX_ADMA_PHYS_BASE(0),
  210. .end = IOP13XX_ADMA_UPPER_PA(0),
  211. .flags = IORESOURCE_MEM,
  212. },
  213. [1] = {
  214. .start = IRQ_IOP13XX_ADMA0_EOT,
  215. .end = IRQ_IOP13XX_ADMA0_EOT,
  216. .flags = IORESOURCE_IRQ
  217. },
  218. [2] = {
  219. .start = IRQ_IOP13XX_ADMA0_EOC,
  220. .end = IRQ_IOP13XX_ADMA0_EOC,
  221. .flags = IORESOURCE_IRQ
  222. },
  223. [3] = {
  224. .start = IRQ_IOP13XX_ADMA0_ERR,
  225. .end = IRQ_IOP13XX_ADMA0_ERR,
  226. .flags = IORESOURCE_IRQ
  227. }
  228. };
  229. static struct resource iop13xx_adma_1_resources[] = {
  230. [0] = {
  231. .start = IOP13XX_ADMA_PHYS_BASE(1),
  232. .end = IOP13XX_ADMA_UPPER_PA(1),
  233. .flags = IORESOURCE_MEM,
  234. },
  235. [1] = {
  236. .start = IRQ_IOP13XX_ADMA1_EOT,
  237. .end = IRQ_IOP13XX_ADMA1_EOT,
  238. .flags = IORESOURCE_IRQ
  239. },
  240. [2] = {
  241. .start = IRQ_IOP13XX_ADMA1_EOC,
  242. .end = IRQ_IOP13XX_ADMA1_EOC,
  243. .flags = IORESOURCE_IRQ
  244. },
  245. [3] = {
  246. .start = IRQ_IOP13XX_ADMA1_ERR,
  247. .end = IRQ_IOP13XX_ADMA1_ERR,
  248. .flags = IORESOURCE_IRQ
  249. }
  250. };
  251. static struct resource iop13xx_adma_2_resources[] = {
  252. [0] = {
  253. .start = IOP13XX_ADMA_PHYS_BASE(2),
  254. .end = IOP13XX_ADMA_UPPER_PA(2),
  255. .flags = IORESOURCE_MEM,
  256. },
  257. [1] = {
  258. .start = IRQ_IOP13XX_ADMA2_EOT,
  259. .end = IRQ_IOP13XX_ADMA2_EOT,
  260. .flags = IORESOURCE_IRQ
  261. },
  262. [2] = {
  263. .start = IRQ_IOP13XX_ADMA2_EOC,
  264. .end = IRQ_IOP13XX_ADMA2_EOC,
  265. .flags = IORESOURCE_IRQ
  266. },
  267. [3] = {
  268. .start = IRQ_IOP13XX_ADMA2_ERR,
  269. .end = IRQ_IOP13XX_ADMA2_ERR,
  270. .flags = IORESOURCE_IRQ
  271. }
  272. };
  273. static u64 iop13xx_adma_dmamask = DMA_BIT_MASK(64);
  274. static struct iop_adma_platform_data iop13xx_adma_0_data = {
  275. .hw_id = 0,
  276. .pool_size = PAGE_SIZE,
  277. };
  278. static struct iop_adma_platform_data iop13xx_adma_1_data = {
  279. .hw_id = 1,
  280. .pool_size = PAGE_SIZE,
  281. };
  282. static struct iop_adma_platform_data iop13xx_adma_2_data = {
  283. .hw_id = 2,
  284. .pool_size = PAGE_SIZE,
  285. };
  286. /* The ids are fixed up later in iop13xx_platform_init */
  287. static struct platform_device iop13xx_adma_0_channel = {
  288. .name = "iop-adma",
  289. .id = 0,
  290. .num_resources = 4,
  291. .resource = iop13xx_adma_0_resources,
  292. .dev = {
  293. .dma_mask = &iop13xx_adma_dmamask,
  294. .coherent_dma_mask = DMA_BIT_MASK(64),
  295. .platform_data = (void *) &iop13xx_adma_0_data,
  296. },
  297. };
  298. static struct platform_device iop13xx_adma_1_channel = {
  299. .name = "iop-adma",
  300. .id = 0,
  301. .num_resources = 4,
  302. .resource = iop13xx_adma_1_resources,
  303. .dev = {
  304. .dma_mask = &iop13xx_adma_dmamask,
  305. .coherent_dma_mask = DMA_BIT_MASK(64),
  306. .platform_data = (void *) &iop13xx_adma_1_data,
  307. },
  308. };
  309. static struct platform_device iop13xx_adma_2_channel = {
  310. .name = "iop-adma",
  311. .id = 0,
  312. .num_resources = 4,
  313. .resource = iop13xx_adma_2_resources,
  314. .dev = {
  315. .dma_mask = &iop13xx_adma_dmamask,
  316. .coherent_dma_mask = DMA_BIT_MASK(64),
  317. .platform_data = (void *) &iop13xx_adma_2_data,
  318. },
  319. };
  320. void __init iop13xx_map_io(void)
  321. {
  322. /* Initialize the Static Page Table maps */
  323. iotable_init(iop13xx_std_desc, ARRAY_SIZE(iop13xx_std_desc));
  324. }
  325. static int init_uart;
  326. static int init_i2c;
  327. static int init_adma;
  328. void __init iop13xx_platform_init(void)
  329. {
  330. int i;
  331. u32 uart_idx, i2c_idx, adma_idx, plat_idx;
  332. struct platform_device *iop13xx_devices[IQ81340_MAX_PLAT_DEVICES];
  333. /* set the bases so we can read the device id */
  334. iop13xx_set_atu_mmr_bases();
  335. memset(iop13xx_devices, 0, sizeof(iop13xx_devices));
  336. if (init_uart == IOP13XX_INIT_UART_DEFAULT) {
  337. switch (iop13xx_dev_id()) {
  338. /* enable both uarts on iop341 */
  339. case 0x3380:
  340. case 0x3384:
  341. case 0x3388:
  342. case 0x338c:
  343. init_uart |= IOP13XX_INIT_UART_0;
  344. init_uart |= IOP13XX_INIT_UART_1;
  345. break;
  346. /* only enable uart 1 */
  347. default:
  348. init_uart |= IOP13XX_INIT_UART_1;
  349. }
  350. }
  351. if (init_i2c == IOP13XX_INIT_I2C_DEFAULT) {
  352. switch (iop13xx_dev_id()) {
  353. /* enable all i2c units on iop341 and iop342 */
  354. case 0x3380:
  355. case 0x3384:
  356. case 0x3388:
  357. case 0x338c:
  358. case 0x3382:
  359. case 0x3386:
  360. case 0x338a:
  361. case 0x338e:
  362. init_i2c |= IOP13XX_INIT_I2C_0;
  363. init_i2c |= IOP13XX_INIT_I2C_1;
  364. init_i2c |= IOP13XX_INIT_I2C_2;
  365. break;
  366. /* only enable i2c 1 and 2 */
  367. default:
  368. init_i2c |= IOP13XX_INIT_I2C_1;
  369. init_i2c |= IOP13XX_INIT_I2C_2;
  370. }
  371. }
  372. if (init_adma == IOP13XX_INIT_ADMA_DEFAULT) {
  373. init_adma |= IOP13XX_INIT_ADMA_0;
  374. init_adma |= IOP13XX_INIT_ADMA_1;
  375. init_adma |= IOP13XX_INIT_ADMA_2;
  376. }
  377. plat_idx = 0;
  378. uart_idx = 0;
  379. i2c_idx = 0;
  380. /* uart 1 (if enabled) is ttyS0 */
  381. if (init_uart & IOP13XX_INIT_UART_1) {
  382. PRINTK("Adding uart1 to platform device list\n");
  383. iop13xx_uart1.id = uart_idx++;
  384. iop13xx_devices[plat_idx++] = &iop13xx_uart1;
  385. }
  386. if (init_uart & IOP13XX_INIT_UART_0) {
  387. PRINTK("Adding uart0 to platform device list\n");
  388. iop13xx_uart0.id = uart_idx++;
  389. iop13xx_devices[plat_idx++] = &iop13xx_uart0;
  390. }
  391. for(i = 0; i < IQ81340_NUM_I2C; i++) {
  392. if ((init_i2c & (1 << i)) && IOP13XX_SETUP_DEBUG)
  393. printk("Adding i2c%d to platform device list\n", i);
  394. switch(init_i2c & (1 << i)) {
  395. case IOP13XX_INIT_I2C_0:
  396. iop13xx_i2c_0_controller.id = i2c_idx++;
  397. iop13xx_devices[plat_idx++] =
  398. &iop13xx_i2c_0_controller;
  399. break;
  400. case IOP13XX_INIT_I2C_1:
  401. iop13xx_i2c_1_controller.id = i2c_idx++;
  402. iop13xx_devices[plat_idx++] =
  403. &iop13xx_i2c_1_controller;
  404. break;
  405. case IOP13XX_INIT_I2C_2:
  406. iop13xx_i2c_2_controller.id = i2c_idx++;
  407. iop13xx_devices[plat_idx++] =
  408. &iop13xx_i2c_2_controller;
  409. break;
  410. }
  411. }
  412. /* initialize adma channel ids and capabilities */
  413. adma_idx = 0;
  414. for (i = 0; i < IQ81340_NUM_ADMA; i++) {
  415. struct iop_adma_platform_data *plat_data;
  416. if ((init_adma & (1 << i)) && IOP13XX_SETUP_DEBUG)
  417. printk(KERN_INFO
  418. "Adding adma%d to platform device list\n", i);
  419. switch (init_adma & (1 << i)) {
  420. case IOP13XX_INIT_ADMA_0:
  421. iop13xx_adma_0_channel.id = adma_idx++;
  422. iop13xx_devices[plat_idx++] = &iop13xx_adma_0_channel;
  423. plat_data = &iop13xx_adma_0_data;
  424. dma_cap_set(DMA_MEMCPY, plat_data->cap_mask);
  425. dma_cap_set(DMA_XOR, plat_data->cap_mask);
  426. dma_cap_set(DMA_XOR_VAL, plat_data->cap_mask);
  427. dma_cap_set(DMA_INTERRUPT, plat_data->cap_mask);
  428. break;
  429. case IOP13XX_INIT_ADMA_1:
  430. iop13xx_adma_1_channel.id = adma_idx++;
  431. iop13xx_devices[plat_idx++] = &iop13xx_adma_1_channel;
  432. plat_data = &iop13xx_adma_1_data;
  433. dma_cap_set(DMA_MEMCPY, plat_data->cap_mask);
  434. dma_cap_set(DMA_XOR, plat_data->cap_mask);
  435. dma_cap_set(DMA_XOR_VAL, plat_data->cap_mask);
  436. dma_cap_set(DMA_INTERRUPT, plat_data->cap_mask);
  437. break;
  438. case IOP13XX_INIT_ADMA_2:
  439. iop13xx_adma_2_channel.id = adma_idx++;
  440. iop13xx_devices[plat_idx++] = &iop13xx_adma_2_channel;
  441. plat_data = &iop13xx_adma_2_data;
  442. dma_cap_set(DMA_MEMCPY, plat_data->cap_mask);
  443. dma_cap_set(DMA_XOR, plat_data->cap_mask);
  444. dma_cap_set(DMA_XOR_VAL, plat_data->cap_mask);
  445. dma_cap_set(DMA_INTERRUPT, plat_data->cap_mask);
  446. dma_cap_set(DMA_PQ, plat_data->cap_mask);
  447. dma_cap_set(DMA_PQ_VAL, plat_data->cap_mask);
  448. break;
  449. }
  450. }
  451. #ifdef CONFIG_MTD_PHYSMAP
  452. iq8134x_flash_resource.end = iq8134x_flash_resource.start +
  453. iq8134x_probe_flash_size() - 1;
  454. if (iq8134x_flash_resource.end > iq8134x_flash_resource.start)
  455. iop13xx_devices[plat_idx++] = &iq8134x_flash;
  456. else
  457. printk(KERN_ERR "%s: Failed to probe flash size\n", __func__);
  458. #endif
  459. platform_add_devices(iop13xx_devices, plat_idx);
  460. }
  461. static int __init iop13xx_init_uart_setup(char *str)
  462. {
  463. if (str) {
  464. while (*str != '\0') {
  465. switch(*str) {
  466. case '0':
  467. init_uart |= IOP13XX_INIT_UART_0;
  468. break;
  469. case '1':
  470. init_uart |= IOP13XX_INIT_UART_1;
  471. break;
  472. case ',':
  473. case '=':
  474. break;
  475. default:
  476. PRINTK("\"iop13xx_init_uart\" malformed"
  477. " at character: \'%c\'", *str);
  478. *(str + 1) = '\0';
  479. init_uart = IOP13XX_INIT_UART_DEFAULT;
  480. }
  481. str++;
  482. }
  483. }
  484. return 1;
  485. }
  486. static int __init iop13xx_init_i2c_setup(char *str)
  487. {
  488. if (str) {
  489. while (*str != '\0') {
  490. switch(*str) {
  491. case '0':
  492. init_i2c |= IOP13XX_INIT_I2C_0;
  493. break;
  494. case '1':
  495. init_i2c |= IOP13XX_INIT_I2C_1;
  496. break;
  497. case '2':
  498. init_i2c |= IOP13XX_INIT_I2C_2;
  499. break;
  500. case ',':
  501. case '=':
  502. break;
  503. default:
  504. PRINTK("\"iop13xx_init_i2c\" malformed"
  505. " at character: \'%c\'", *str);
  506. *(str + 1) = '\0';
  507. init_i2c = IOP13XX_INIT_I2C_DEFAULT;
  508. }
  509. str++;
  510. }
  511. }
  512. return 1;
  513. }
  514. static int __init iop13xx_init_adma_setup(char *str)
  515. {
  516. if (str) {
  517. while (*str != '\0') {
  518. switch (*str) {
  519. case '0':
  520. init_adma |= IOP13XX_INIT_ADMA_0;
  521. break;
  522. case '1':
  523. init_adma |= IOP13XX_INIT_ADMA_1;
  524. break;
  525. case '2':
  526. init_adma |= IOP13XX_INIT_ADMA_2;
  527. break;
  528. case ',':
  529. case '=':
  530. break;
  531. default:
  532. PRINTK("\"iop13xx_init_adma\" malformed"
  533. " at character: \'%c\'", *str);
  534. *(str + 1) = '\0';
  535. init_adma = IOP13XX_INIT_ADMA_DEFAULT;
  536. }
  537. str++;
  538. }
  539. }
  540. return 1;
  541. }
  542. __setup("iop13xx_init_adma", iop13xx_init_adma_setup);
  543. __setup("iop13xx_init_uart", iop13xx_init_uart_setup);
  544. __setup("iop13xx_init_i2c", iop13xx_init_i2c_setup);
  545. void iop13xx_restart(enum reboot_mode mode, const char *cmd)
  546. {
  547. /*
  548. * Reset the internal bus (warning both cores are reset)
  549. */
  550. write_wdtcr(IOP_WDTCR_EN_ARM);
  551. write_wdtcr(IOP_WDTCR_EN);
  552. write_wdtsr(IOP13XX_WDTSR_WRITE_EN | IOP13XX_WDTCR_IB_RESET);
  553. write_wdtcr(0x1000);
  554. }