db1000.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. /*
  2. * DBAu1000/1500/1100 PBAu1100/1500 board support
  3. *
  4. * Copyright 2000, 2008 MontaVista Software Inc.
  5. * Author: MontaVista Software, Inc. <source@mvista.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #include <linux/clk.h>
  22. #include <linux/dma-mapping.h>
  23. #include <linux/gpio.h>
  24. #include <linux/init.h>
  25. #include <linux/interrupt.h>
  26. #include <linux/leds.h>
  27. #include <linux/mmc/host.h>
  28. #include <linux/module.h>
  29. #include <linux/platform_device.h>
  30. #include <linux/pm.h>
  31. #include <linux/spi/spi.h>
  32. #include <linux/spi/spi_gpio.h>
  33. #include <linux/spi/ads7846.h>
  34. #include <asm/mach-au1x00/au1000.h>
  35. #include <asm/mach-au1x00/gpio-au1000.h>
  36. #include <asm/mach-au1x00/au1000_dma.h>
  37. #include <asm/mach-au1x00/au1100_mmc.h>
  38. #include <asm/mach-db1x00/bcsr.h>
  39. #include <asm/reboot.h>
  40. #include <prom.h>
  41. #include "platform.h"
  42. #define F_SWAPPED (bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1000_SWAPBOOT)
  43. const char *get_system_type(void);
  44. int __init db1000_board_setup(void)
  45. {
  46. /* initialize board register space */
  47. bcsr_init(DB1000_BCSR_PHYS_ADDR,
  48. DB1000_BCSR_PHYS_ADDR + DB1000_BCSR_HEXLED_OFS);
  49. switch (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI))) {
  50. case BCSR_WHOAMI_DB1000:
  51. case BCSR_WHOAMI_DB1500:
  52. case BCSR_WHOAMI_DB1100:
  53. case BCSR_WHOAMI_PB1500:
  54. case BCSR_WHOAMI_PB1500R2:
  55. case BCSR_WHOAMI_PB1100:
  56. pr_info("AMD Alchemy %s Board\n", get_system_type());
  57. return 0;
  58. }
  59. return -ENODEV;
  60. }
  61. static int db1500_map_pci_irq(const struct pci_dev *d, u8 slot, u8 pin)
  62. {
  63. if ((slot < 12) || (slot > 13) || pin == 0)
  64. return -1;
  65. if (slot == 12)
  66. return (pin == 1) ? AU1500_PCI_INTA : 0xff;
  67. if (slot == 13) {
  68. switch (pin) {
  69. case 1: return AU1500_PCI_INTA;
  70. case 2: return AU1500_PCI_INTB;
  71. case 3: return AU1500_PCI_INTC;
  72. case 4: return AU1500_PCI_INTD;
  73. }
  74. }
  75. return -1;
  76. }
  77. static struct resource alchemy_pci_host_res[] = {
  78. [0] = {
  79. .start = AU1500_PCI_PHYS_ADDR,
  80. .end = AU1500_PCI_PHYS_ADDR + 0xfff,
  81. .flags = IORESOURCE_MEM,
  82. },
  83. };
  84. static struct alchemy_pci_platdata db1500_pci_pd = {
  85. .board_map_irq = db1500_map_pci_irq,
  86. };
  87. static struct platform_device db1500_pci_host_dev = {
  88. .dev.platform_data = &db1500_pci_pd,
  89. .name = "alchemy-pci",
  90. .id = 0,
  91. .num_resources = ARRAY_SIZE(alchemy_pci_host_res),
  92. .resource = alchemy_pci_host_res,
  93. };
  94. int __init db1500_pci_setup(void)
  95. {
  96. return platform_device_register(&db1500_pci_host_dev);
  97. }
  98. static struct resource au1100_lcd_resources[] = {
  99. [0] = {
  100. .start = AU1100_LCD_PHYS_ADDR,
  101. .end = AU1100_LCD_PHYS_ADDR + 0x800 - 1,
  102. .flags = IORESOURCE_MEM,
  103. },
  104. [1] = {
  105. .start = AU1100_LCD_INT,
  106. .end = AU1100_LCD_INT,
  107. .flags = IORESOURCE_IRQ,
  108. }
  109. };
  110. static u64 au1100_lcd_dmamask = DMA_BIT_MASK(32);
  111. static struct platform_device au1100_lcd_device = {
  112. .name = "au1100-lcd",
  113. .id = 0,
  114. .dev = {
  115. .dma_mask = &au1100_lcd_dmamask,
  116. .coherent_dma_mask = DMA_BIT_MASK(32),
  117. },
  118. .num_resources = ARRAY_SIZE(au1100_lcd_resources),
  119. .resource = au1100_lcd_resources,
  120. };
  121. static struct resource alchemy_ac97c_res[] = {
  122. [0] = {
  123. .start = AU1000_AC97_PHYS_ADDR,
  124. .end = AU1000_AC97_PHYS_ADDR + 0xfff,
  125. .flags = IORESOURCE_MEM,
  126. },
  127. [1] = {
  128. .start = DMA_ID_AC97C_TX,
  129. .end = DMA_ID_AC97C_TX,
  130. .flags = IORESOURCE_DMA,
  131. },
  132. [2] = {
  133. .start = DMA_ID_AC97C_RX,
  134. .end = DMA_ID_AC97C_RX,
  135. .flags = IORESOURCE_DMA,
  136. },
  137. };
  138. static struct platform_device alchemy_ac97c_dev = {
  139. .name = "alchemy-ac97c",
  140. .id = -1,
  141. .resource = alchemy_ac97c_res,
  142. .num_resources = ARRAY_SIZE(alchemy_ac97c_res),
  143. };
  144. static struct platform_device alchemy_ac97c_dma_dev = {
  145. .name = "alchemy-pcm-dma",
  146. .id = 0,
  147. };
  148. static struct platform_device db1x00_codec_dev = {
  149. .name = "ac97-codec",
  150. .id = -1,
  151. };
  152. static struct platform_device db1x00_audio_dev = {
  153. .name = "db1000-audio",
  154. };
  155. /******************************************************************************/
  156. static irqreturn_t db1100_mmc_cd(int irq, void *ptr)
  157. {
  158. void (*mmc_cd)(struct mmc_host *, unsigned long);
  159. /* link against CONFIG_MMC=m */
  160. mmc_cd = symbol_get(mmc_detect_change);
  161. mmc_cd(ptr, msecs_to_jiffies(500));
  162. symbol_put(mmc_detect_change);
  163. return IRQ_HANDLED;
  164. }
  165. static int db1100_mmc_cd_setup(void *mmc_host, int en)
  166. {
  167. int ret = 0, irq;
  168. if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
  169. irq = AU1100_GPIO19_INT;
  170. else
  171. irq = AU1100_GPIO14_INT; /* PB1100 SD0 CD# */
  172. if (en) {
  173. irq_set_irq_type(irq, IRQ_TYPE_EDGE_BOTH);
  174. ret = request_irq(irq, db1100_mmc_cd, 0,
  175. "sd0_cd", mmc_host);
  176. } else
  177. free_irq(irq, mmc_host);
  178. return ret;
  179. }
  180. static int db1100_mmc1_cd_setup(void *mmc_host, int en)
  181. {
  182. int ret = 0, irq;
  183. if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
  184. irq = AU1100_GPIO20_INT;
  185. else
  186. irq = AU1100_GPIO15_INT; /* PB1100 SD1 CD# */
  187. if (en) {
  188. irq_set_irq_type(irq, IRQ_TYPE_EDGE_BOTH);
  189. ret = request_irq(irq, db1100_mmc_cd, 0,
  190. "sd1_cd", mmc_host);
  191. } else
  192. free_irq(irq, mmc_host);
  193. return ret;
  194. }
  195. static int db1100_mmc_card_readonly(void *mmc_host)
  196. {
  197. /* testing suggests that this bit is inverted */
  198. return (bcsr_read(BCSR_STATUS) & BCSR_STATUS_SD0WP) ? 0 : 1;
  199. }
  200. static int db1100_mmc_card_inserted(void *mmc_host)
  201. {
  202. return !alchemy_gpio_get_value(19);
  203. }
  204. static void db1100_mmc_set_power(void *mmc_host, int state)
  205. {
  206. int bit;
  207. if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
  208. bit = BCSR_BOARD_SD0PWR;
  209. else
  210. bit = BCSR_BOARD_PB1100_SD0PWR;
  211. if (state) {
  212. bcsr_mod(BCSR_BOARD, 0, bit);
  213. msleep(400); /* stabilization time */
  214. } else
  215. bcsr_mod(BCSR_BOARD, bit, 0);
  216. }
  217. static void db1100_mmcled_set(struct led_classdev *led, enum led_brightness b)
  218. {
  219. if (b != LED_OFF)
  220. bcsr_mod(BCSR_LEDS, BCSR_LEDS_LED0, 0);
  221. else
  222. bcsr_mod(BCSR_LEDS, 0, BCSR_LEDS_LED0);
  223. }
  224. static struct led_classdev db1100_mmc_led = {
  225. .brightness_set = db1100_mmcled_set,
  226. };
  227. static int db1100_mmc1_card_readonly(void *mmc_host)
  228. {
  229. return (bcsr_read(BCSR_BOARD) & BCSR_BOARD_SD1WP) ? 1 : 0;
  230. }
  231. static int db1100_mmc1_card_inserted(void *mmc_host)
  232. {
  233. return !alchemy_gpio_get_value(20);
  234. }
  235. static void db1100_mmc1_set_power(void *mmc_host, int state)
  236. {
  237. int bit;
  238. if (BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI)) == BCSR_WHOAMI_DB1100)
  239. bit = BCSR_BOARD_SD1PWR;
  240. else
  241. bit = BCSR_BOARD_PB1100_SD1PWR;
  242. if (state) {
  243. bcsr_mod(BCSR_BOARD, 0, bit);
  244. msleep(400); /* stabilization time */
  245. } else
  246. bcsr_mod(BCSR_BOARD, bit, 0);
  247. }
  248. static void db1100_mmc1led_set(struct led_classdev *led, enum led_brightness b)
  249. {
  250. if (b != LED_OFF)
  251. bcsr_mod(BCSR_LEDS, BCSR_LEDS_LED1, 0);
  252. else
  253. bcsr_mod(BCSR_LEDS, 0, BCSR_LEDS_LED1);
  254. }
  255. static struct led_classdev db1100_mmc1_led = {
  256. .brightness_set = db1100_mmc1led_set,
  257. };
  258. static struct au1xmmc_platform_data db1100_mmc_platdata[2] = {
  259. [0] = {
  260. .cd_setup = db1100_mmc_cd_setup,
  261. .set_power = db1100_mmc_set_power,
  262. .card_inserted = db1100_mmc_card_inserted,
  263. .card_readonly = db1100_mmc_card_readonly,
  264. .led = &db1100_mmc_led,
  265. },
  266. [1] = {
  267. .cd_setup = db1100_mmc1_cd_setup,
  268. .set_power = db1100_mmc1_set_power,
  269. .card_inserted = db1100_mmc1_card_inserted,
  270. .card_readonly = db1100_mmc1_card_readonly,
  271. .led = &db1100_mmc1_led,
  272. },
  273. };
  274. static struct resource au1100_mmc0_resources[] = {
  275. [0] = {
  276. .start = AU1100_SD0_PHYS_ADDR,
  277. .end = AU1100_SD0_PHYS_ADDR + 0xfff,
  278. .flags = IORESOURCE_MEM,
  279. },
  280. [1] = {
  281. .start = AU1100_SD_INT,
  282. .end = AU1100_SD_INT,
  283. .flags = IORESOURCE_IRQ,
  284. },
  285. [2] = {
  286. .start = DMA_ID_SD0_TX,
  287. .end = DMA_ID_SD0_TX,
  288. .flags = IORESOURCE_DMA,
  289. },
  290. [3] = {
  291. .start = DMA_ID_SD0_RX,
  292. .end = DMA_ID_SD0_RX,
  293. .flags = IORESOURCE_DMA,
  294. }
  295. };
  296. static u64 au1xxx_mmc_dmamask = DMA_BIT_MASK(32);
  297. static struct platform_device db1100_mmc0_dev = {
  298. .name = "au1xxx-mmc",
  299. .id = 0,
  300. .dev = {
  301. .dma_mask = &au1xxx_mmc_dmamask,
  302. .coherent_dma_mask = DMA_BIT_MASK(32),
  303. .platform_data = &db1100_mmc_platdata[0],
  304. },
  305. .num_resources = ARRAY_SIZE(au1100_mmc0_resources),
  306. .resource = au1100_mmc0_resources,
  307. };
  308. static struct resource au1100_mmc1_res[] = {
  309. [0] = {
  310. .start = AU1100_SD1_PHYS_ADDR,
  311. .end = AU1100_SD1_PHYS_ADDR + 0xfff,
  312. .flags = IORESOURCE_MEM,
  313. },
  314. [1] = {
  315. .start = AU1100_SD_INT,
  316. .end = AU1100_SD_INT,
  317. .flags = IORESOURCE_IRQ,
  318. },
  319. [2] = {
  320. .start = DMA_ID_SD1_TX,
  321. .end = DMA_ID_SD1_TX,
  322. .flags = IORESOURCE_DMA,
  323. },
  324. [3] = {
  325. .start = DMA_ID_SD1_RX,
  326. .end = DMA_ID_SD1_RX,
  327. .flags = IORESOURCE_DMA,
  328. }
  329. };
  330. static struct platform_device db1100_mmc1_dev = {
  331. .name = "au1xxx-mmc",
  332. .id = 1,
  333. .dev = {
  334. .dma_mask = &au1xxx_mmc_dmamask,
  335. .coherent_dma_mask = DMA_BIT_MASK(32),
  336. .platform_data = &db1100_mmc_platdata[1],
  337. },
  338. .num_resources = ARRAY_SIZE(au1100_mmc1_res),
  339. .resource = au1100_mmc1_res,
  340. };
  341. /******************************************************************************/
  342. static void db1000_irda_set_phy_mode(int mode)
  343. {
  344. unsigned short mask = BCSR_RESETS_IRDA_MODE_MASK | BCSR_RESETS_FIR_SEL;
  345. switch (mode) {
  346. case AU1000_IRDA_PHY_MODE_OFF:
  347. bcsr_mod(BCSR_RESETS, mask, BCSR_RESETS_IRDA_MODE_OFF);
  348. break;
  349. case AU1000_IRDA_PHY_MODE_SIR:
  350. bcsr_mod(BCSR_RESETS, mask, BCSR_RESETS_IRDA_MODE_FULL);
  351. break;
  352. case AU1000_IRDA_PHY_MODE_FIR:
  353. bcsr_mod(BCSR_RESETS, mask, BCSR_RESETS_IRDA_MODE_FULL |
  354. BCSR_RESETS_FIR_SEL);
  355. break;
  356. }
  357. }
  358. static struct au1k_irda_platform_data db1000_irda_platdata = {
  359. .set_phy_mode = db1000_irda_set_phy_mode,
  360. };
  361. static struct resource au1000_irda_res[] = {
  362. [0] = {
  363. .start = AU1000_IRDA_PHYS_ADDR,
  364. .end = AU1000_IRDA_PHYS_ADDR + 0x0fff,
  365. .flags = IORESOURCE_MEM,
  366. },
  367. [1] = {
  368. .start = AU1000_IRDA_TX_INT,
  369. .end = AU1000_IRDA_TX_INT,
  370. .flags = IORESOURCE_IRQ,
  371. },
  372. [2] = {
  373. .start = AU1000_IRDA_RX_INT,
  374. .end = AU1000_IRDA_RX_INT,
  375. .flags = IORESOURCE_IRQ,
  376. },
  377. };
  378. static struct platform_device db1000_irda_dev = {
  379. .name = "au1000-irda",
  380. .id = -1,
  381. .dev = {
  382. .platform_data = &db1000_irda_platdata,
  383. },
  384. .resource = au1000_irda_res,
  385. .num_resources = ARRAY_SIZE(au1000_irda_res),
  386. };
  387. /******************************************************************************/
  388. static struct ads7846_platform_data db1100_touch_pd = {
  389. .model = 7846,
  390. .vref_mv = 3300,
  391. .gpio_pendown = 21,
  392. };
  393. static struct spi_gpio_platform_data db1100_spictl_pd = {
  394. .sck = 209,
  395. .mosi = 208,
  396. .miso = 207,
  397. .num_chipselect = 1,
  398. };
  399. static struct spi_board_info db1100_spi_info[] __initdata = {
  400. [0] = {
  401. .modalias = "ads7846",
  402. .max_speed_hz = 3250000,
  403. .bus_num = 0,
  404. .chip_select = 0,
  405. .mode = 0,
  406. .irq = AU1100_GPIO21_INT,
  407. .platform_data = &db1100_touch_pd,
  408. .controller_data = (void *)210, /* for spi_gpio: CS# GPIO210 */
  409. },
  410. };
  411. static struct platform_device db1100_spi_dev = {
  412. .name = "spi_gpio",
  413. .id = 0,
  414. .dev = {
  415. .platform_data = &db1100_spictl_pd,
  416. },
  417. };
  418. static struct platform_device *db1x00_devs[] = {
  419. &db1x00_codec_dev,
  420. &alchemy_ac97c_dma_dev,
  421. &alchemy_ac97c_dev,
  422. &db1x00_audio_dev,
  423. };
  424. static struct platform_device *db1000_devs[] = {
  425. &db1000_irda_dev,
  426. };
  427. static struct platform_device *db1100_devs[] = {
  428. &au1100_lcd_device,
  429. &db1100_mmc0_dev,
  430. &db1100_mmc1_dev,
  431. &db1000_irda_dev,
  432. };
  433. int __init db1000_dev_setup(void)
  434. {
  435. int board = BCSR_WHOAMI_BOARD(bcsr_read(BCSR_WHOAMI));
  436. int c0, c1, d0, d1, s0, s1, flashsize = 32, twosocks = 1;
  437. unsigned long pfc;
  438. struct clk *c, *p;
  439. if (board == BCSR_WHOAMI_DB1500) {
  440. c0 = AU1500_GPIO2_INT;
  441. c1 = AU1500_GPIO5_INT;
  442. d0 = 0; /* GPIO number, NOT irq! */
  443. d1 = 3; /* GPIO number, NOT irq! */
  444. s0 = AU1500_GPIO1_INT;
  445. s1 = AU1500_GPIO4_INT;
  446. } else if (board == BCSR_WHOAMI_DB1100) {
  447. c0 = AU1100_GPIO2_INT;
  448. c1 = AU1100_GPIO5_INT;
  449. d0 = 0; /* GPIO number, NOT irq! */
  450. d1 = 3; /* GPIO number, NOT irq! */
  451. s0 = AU1100_GPIO1_INT;
  452. s1 = AU1100_GPIO4_INT;
  453. gpio_request(19, "sd0_cd");
  454. gpio_request(20, "sd1_cd");
  455. gpio_direction_input(19); /* sd0 cd# */
  456. gpio_direction_input(20); /* sd1 cd# */
  457. /* spi_gpio on SSI0 pins */
  458. pfc = alchemy_rdsys(AU1000_SYS_PINFUNC);
  459. pfc |= (1 << 0); /* SSI0 pins as GPIOs */
  460. alchemy_wrsys(pfc, AU1000_SYS_PINFUNC);
  461. spi_register_board_info(db1100_spi_info,
  462. ARRAY_SIZE(db1100_spi_info));
  463. /* link LCD clock to AUXPLL */
  464. p = clk_get(NULL, "auxpll_clk");
  465. c = clk_get(NULL, "lcd_intclk");
  466. if (!IS_ERR(c) && !IS_ERR(p)) {
  467. clk_set_parent(c, p);
  468. clk_set_rate(c, clk_get_rate(p));
  469. }
  470. if (!IS_ERR(c))
  471. clk_put(c);
  472. if (!IS_ERR(p))
  473. clk_put(p);
  474. platform_add_devices(db1100_devs, ARRAY_SIZE(db1100_devs));
  475. platform_device_register(&db1100_spi_dev);
  476. } else if (board == BCSR_WHOAMI_DB1000) {
  477. c0 = AU1000_GPIO2_INT;
  478. c1 = AU1000_GPIO5_INT;
  479. d0 = 0; /* GPIO number, NOT irq! */
  480. d1 = 3; /* GPIO number, NOT irq! */
  481. s0 = AU1000_GPIO1_INT;
  482. s1 = AU1000_GPIO4_INT;
  483. platform_add_devices(db1000_devs, ARRAY_SIZE(db1000_devs));
  484. } else if ((board == BCSR_WHOAMI_PB1500) ||
  485. (board == BCSR_WHOAMI_PB1500R2)) {
  486. c0 = AU1500_GPIO203_INT;
  487. d0 = 1; /* GPIO number, NOT irq! */
  488. s0 = AU1500_GPIO202_INT;
  489. twosocks = 0;
  490. flashsize = 64;
  491. /* RTC and daughtercard irqs */
  492. irq_set_irq_type(AU1500_GPIO204_INT, IRQ_TYPE_LEVEL_LOW);
  493. irq_set_irq_type(AU1500_GPIO205_INT, IRQ_TYPE_LEVEL_LOW);
  494. /* EPSON S1D13806 0x1b000000
  495. * SRAM 1MB/2MB 0x1a000000
  496. * DS1693 RTC 0x0c000000
  497. */
  498. } else if (board == BCSR_WHOAMI_PB1100) {
  499. c0 = AU1100_GPIO11_INT;
  500. d0 = 9; /* GPIO number, NOT irq! */
  501. s0 = AU1100_GPIO10_INT;
  502. twosocks = 0;
  503. flashsize = 64;
  504. /* pendown, rtc, daughtercard irqs */
  505. irq_set_irq_type(AU1100_GPIO8_INT, IRQ_TYPE_LEVEL_LOW);
  506. irq_set_irq_type(AU1100_GPIO12_INT, IRQ_TYPE_LEVEL_LOW);
  507. irq_set_irq_type(AU1100_GPIO13_INT, IRQ_TYPE_LEVEL_LOW);
  508. /* EPSON S1D13806 0x1b000000
  509. * SRAM 1MB/2MB 0x1a000000
  510. * DiskOnChip 0x0d000000
  511. * DS1693 RTC 0x0c000000
  512. */
  513. platform_add_devices(db1100_devs, ARRAY_SIZE(db1100_devs));
  514. } else
  515. return 0; /* unknown board, no further dev setup to do */
  516. irq_set_irq_type(c0, IRQ_TYPE_LEVEL_LOW);
  517. irq_set_irq_type(s0, IRQ_TYPE_LEVEL_LOW);
  518. db1x_register_pcmcia_socket(
  519. AU1000_PCMCIA_ATTR_PHYS_ADDR,
  520. AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
  521. AU1000_PCMCIA_MEM_PHYS_ADDR,
  522. AU1000_PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1,
  523. AU1000_PCMCIA_IO_PHYS_ADDR,
  524. AU1000_PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1,
  525. c0, d0, /*s0*/0, 0, 0);
  526. if (twosocks) {
  527. irq_set_irq_type(c1, IRQ_TYPE_LEVEL_LOW);
  528. irq_set_irq_type(s1, IRQ_TYPE_LEVEL_LOW);
  529. db1x_register_pcmcia_socket(
  530. AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004000000,
  531. AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1,
  532. AU1000_PCMCIA_MEM_PHYS_ADDR + 0x004000000,
  533. AU1000_PCMCIA_MEM_PHYS_ADDR + 0x004400000 - 1,
  534. AU1000_PCMCIA_IO_PHYS_ADDR + 0x004000000,
  535. AU1000_PCMCIA_IO_PHYS_ADDR + 0x004010000 - 1,
  536. c1, d1, /*s1*/0, 0, 1);
  537. }
  538. platform_add_devices(db1x00_devs, ARRAY_SIZE(db1x00_devs));
  539. db1x_register_norflash(flashsize << 20, 4 /* 32bit */, F_SWAPPED);
  540. return 0;
  541. }