setup.c 15 KB

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