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