core.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. /*
  2. * arch/arm/mach-ep93xx/core.c
  3. * Core routines for Cirrus EP93xx chips.
  4. *
  5. * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
  6. * Copyright (C) 2007 Herbert Valerio Riedel <hvr@gnu.org>
  7. *
  8. * Thanks go to Michael Burian and Ray Lehtiniemi for their key
  9. * role in the ep93xx linux community.
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or (at
  14. * your option) any later version.
  15. */
  16. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/platform_device.h>
  19. #include <linux/interrupt.h>
  20. #include <linux/dma-mapping.h>
  21. #include <linux/timex.h>
  22. #include <linux/io.h>
  23. #include <linux/gpio.h>
  24. #include <linux/termios.h>
  25. #include <linux/amba/bus.h>
  26. #include <linux/amba/serial.h>
  27. #include <linux/i2c.h>
  28. #include <linux/i2c-gpio.h>
  29. #include <mach/hardware.h>
  30. #include <asm/mach/map.h>
  31. #include <asm/mach/time.h>
  32. #include <asm/mach/irq.h>
  33. #include <asm/hardware/vic.h>
  34. /*************************************************************************
  35. * Static I/O mappings that are needed for all EP93xx platforms
  36. *************************************************************************/
  37. static struct map_desc ep93xx_io_desc[] __initdata = {
  38. {
  39. .virtual = EP93XX_AHB_VIRT_BASE,
  40. .pfn = __phys_to_pfn(EP93XX_AHB_PHYS_BASE),
  41. .length = EP93XX_AHB_SIZE,
  42. .type = MT_DEVICE,
  43. }, {
  44. .virtual = EP93XX_APB_VIRT_BASE,
  45. .pfn = __phys_to_pfn(EP93XX_APB_PHYS_BASE),
  46. .length = EP93XX_APB_SIZE,
  47. .type = MT_DEVICE,
  48. },
  49. };
  50. void __init ep93xx_map_io(void)
  51. {
  52. iotable_init(ep93xx_io_desc, ARRAY_SIZE(ep93xx_io_desc));
  53. }
  54. /*************************************************************************
  55. * Timer handling for EP93xx
  56. *************************************************************************
  57. * The ep93xx has four internal timers. Timers 1, 2 (both 16 bit) and
  58. * 3 (32 bit) count down at 508 kHz, are self-reloading, and can generate
  59. * an interrupt on underflow. Timer 4 (40 bit) counts down at 983.04 kHz,
  60. * is free-running, and can't generate interrupts.
  61. *
  62. * The 508 kHz timers are ideal for use for the timer interrupt, as the
  63. * most common values of HZ divide 508 kHz nicely. We pick one of the 16
  64. * bit timers (timer 1) since we don't need more than 16 bits of reload
  65. * value as long as HZ >= 8.
  66. *
  67. * The higher clock rate of timer 4 makes it a better choice than the
  68. * other timers for use in gettimeoffset(), while the fact that it can't
  69. * generate interrupts means we don't have to worry about not being able
  70. * to use this timer for something else. We also use timer 4 for keeping
  71. * track of lost jiffies.
  72. */
  73. static unsigned int last_jiffy_time;
  74. #define TIMER4_TICKS_PER_JIFFY ((CLOCK_TICK_RATE + (HZ/2)) / HZ)
  75. static irqreturn_t ep93xx_timer_interrupt(int irq, void *dev_id)
  76. {
  77. __raw_writel(1, EP93XX_TIMER1_CLEAR);
  78. while ((signed long)
  79. (__raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time)
  80. >= TIMER4_TICKS_PER_JIFFY) {
  81. last_jiffy_time += TIMER4_TICKS_PER_JIFFY;
  82. timer_tick();
  83. }
  84. return IRQ_HANDLED;
  85. }
  86. static struct irqaction ep93xx_timer_irq = {
  87. .name = "ep93xx timer",
  88. .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
  89. .handler = ep93xx_timer_interrupt,
  90. };
  91. static void __init ep93xx_timer_init(void)
  92. {
  93. /* Enable periodic HZ timer. */
  94. __raw_writel(0x48, EP93XX_TIMER1_CONTROL);
  95. __raw_writel((508469 / HZ) - 1, EP93XX_TIMER1_LOAD);
  96. __raw_writel(0xc8, EP93XX_TIMER1_CONTROL);
  97. /* Enable lost jiffy timer. */
  98. __raw_writel(0x100, EP93XX_TIMER4_VALUE_HIGH);
  99. setup_irq(IRQ_EP93XX_TIMER1, &ep93xx_timer_irq);
  100. }
  101. static unsigned long ep93xx_gettimeoffset(void)
  102. {
  103. int offset;
  104. offset = __raw_readl(EP93XX_TIMER4_VALUE_LOW) - last_jiffy_time;
  105. /* Calculate (1000000 / 983040) * offset. */
  106. return offset + (53 * offset / 3072);
  107. }
  108. struct sys_timer ep93xx_timer = {
  109. .init = ep93xx_timer_init,
  110. .offset = ep93xx_gettimeoffset,
  111. };
  112. /*************************************************************************
  113. * GPIO handling for EP93xx
  114. *************************************************************************/
  115. static unsigned char gpio_int_unmasked[3];
  116. static unsigned char gpio_int_enabled[3];
  117. static unsigned char gpio_int_type1[3];
  118. static unsigned char gpio_int_type2[3];
  119. static unsigned char gpio_int_debounce[3];
  120. /* Port ordering is: A B F */
  121. static const u8 int_type1_register_offset[3] = { 0x90, 0xac, 0x4c };
  122. static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 };
  123. static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 };
  124. static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x58 };
  125. static const u8 int_debounce_register_offset[3] = { 0xa8, 0xc4, 0x64 };
  126. void ep93xx_gpio_update_int_params(unsigned port)
  127. {
  128. BUG_ON(port > 2);
  129. __raw_writeb(0, EP93XX_GPIO_REG(int_en_register_offset[port]));
  130. __raw_writeb(gpio_int_type2[port],
  131. EP93XX_GPIO_REG(int_type2_register_offset[port]));
  132. __raw_writeb(gpio_int_type1[port],
  133. EP93XX_GPIO_REG(int_type1_register_offset[port]));
  134. __raw_writeb(gpio_int_unmasked[port] & gpio_int_enabled[port],
  135. EP93XX_GPIO_REG(int_en_register_offset[port]));
  136. }
  137. void ep93xx_gpio_int_mask(unsigned line)
  138. {
  139. gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7));
  140. }
  141. void ep93xx_gpio_int_debounce(unsigned int irq, int enable)
  142. {
  143. int line = irq_to_gpio(irq);
  144. int port = line >> 3;
  145. int port_mask = 1 << (line & 7);
  146. if (enable)
  147. gpio_int_debounce[port] |= port_mask;
  148. else
  149. gpio_int_debounce[port] &= ~port_mask;
  150. __raw_writeb(gpio_int_debounce[port],
  151. EP93XX_GPIO_REG(int_debounce_register_offset[port]));
  152. }
  153. EXPORT_SYMBOL(ep93xx_gpio_int_debounce);
  154. /*************************************************************************
  155. * EP93xx IRQ handling
  156. *************************************************************************/
  157. static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc)
  158. {
  159. unsigned char status;
  160. int i;
  161. status = __raw_readb(EP93XX_GPIO_A_INT_STATUS);
  162. for (i = 0; i < 8; i++) {
  163. if (status & (1 << i)) {
  164. int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_A(0)) + i;
  165. generic_handle_irq(gpio_irq);
  166. }
  167. }
  168. status = __raw_readb(EP93XX_GPIO_B_INT_STATUS);
  169. for (i = 0; i < 8; i++) {
  170. if (status & (1 << i)) {
  171. int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_B(0)) + i;
  172. desc = irq_desc + gpio_irq;
  173. generic_handle_irq(gpio_irq);
  174. }
  175. }
  176. }
  177. static void ep93xx_gpio_f_irq_handler(unsigned int irq, struct irq_desc *desc)
  178. {
  179. /*
  180. * map discontiguous hw irq range to continous sw irq range:
  181. *
  182. * IRQ_EP93XX_GPIO{0..7}MUX -> gpio_to_irq(EP93XX_GPIO_LINE_F({0..7})
  183. */
  184. int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */
  185. int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_F(0)) + port_f_idx;
  186. generic_handle_irq(gpio_irq);
  187. }
  188. static void ep93xx_gpio_irq_ack(unsigned int irq)
  189. {
  190. int line = irq_to_gpio(irq);
  191. int port = line >> 3;
  192. int port_mask = 1 << (line & 7);
  193. if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
  194. gpio_int_type2[port] ^= port_mask; /* switch edge direction */
  195. ep93xx_gpio_update_int_params(port);
  196. }
  197. __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port]));
  198. }
  199. static void ep93xx_gpio_irq_mask_ack(unsigned int irq)
  200. {
  201. int line = irq_to_gpio(irq);
  202. int port = line >> 3;
  203. int port_mask = 1 << (line & 7);
  204. if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH)
  205. gpio_int_type2[port] ^= port_mask; /* switch edge direction */
  206. gpio_int_unmasked[port] &= ~port_mask;
  207. ep93xx_gpio_update_int_params(port);
  208. __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port]));
  209. }
  210. static void ep93xx_gpio_irq_mask(unsigned int irq)
  211. {
  212. int line = irq_to_gpio(irq);
  213. int port = line >> 3;
  214. gpio_int_unmasked[port] &= ~(1 << (line & 7));
  215. ep93xx_gpio_update_int_params(port);
  216. }
  217. static void ep93xx_gpio_irq_unmask(unsigned int irq)
  218. {
  219. int line = irq_to_gpio(irq);
  220. int port = line >> 3;
  221. gpio_int_unmasked[port] |= 1 << (line & 7);
  222. ep93xx_gpio_update_int_params(port);
  223. }
  224. /*
  225. * gpio_int_type1 controls whether the interrupt is level (0) or
  226. * edge (1) triggered, while gpio_int_type2 controls whether it
  227. * triggers on low/falling (0) or high/rising (1).
  228. */
  229. static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type)
  230. {
  231. struct irq_desc *desc = irq_desc + irq;
  232. const int gpio = irq_to_gpio(irq);
  233. const int port = gpio >> 3;
  234. const int port_mask = 1 << (gpio & 7);
  235. gpio_direction_input(gpio);
  236. switch (type) {
  237. case IRQ_TYPE_EDGE_RISING:
  238. gpio_int_type1[port] |= port_mask;
  239. gpio_int_type2[port] |= port_mask;
  240. desc->handle_irq = handle_edge_irq;
  241. break;
  242. case IRQ_TYPE_EDGE_FALLING:
  243. gpio_int_type1[port] |= port_mask;
  244. gpio_int_type2[port] &= ~port_mask;
  245. desc->handle_irq = handle_edge_irq;
  246. break;
  247. case IRQ_TYPE_LEVEL_HIGH:
  248. gpio_int_type1[port] &= ~port_mask;
  249. gpio_int_type2[port] |= port_mask;
  250. desc->handle_irq = handle_level_irq;
  251. break;
  252. case IRQ_TYPE_LEVEL_LOW:
  253. gpio_int_type1[port] &= ~port_mask;
  254. gpio_int_type2[port] &= ~port_mask;
  255. desc->handle_irq = handle_level_irq;
  256. break;
  257. case IRQ_TYPE_EDGE_BOTH:
  258. gpio_int_type1[port] |= port_mask;
  259. /* set initial polarity based on current input level */
  260. if (gpio_get_value(gpio))
  261. gpio_int_type2[port] &= ~port_mask; /* falling */
  262. else
  263. gpio_int_type2[port] |= port_mask; /* rising */
  264. desc->handle_irq = handle_edge_irq;
  265. break;
  266. default:
  267. pr_err("ep93xx: failed to set irq type %d for gpio %d\n",
  268. type, gpio);
  269. return -EINVAL;
  270. }
  271. gpio_int_enabled[port] |= port_mask;
  272. desc->status &= ~IRQ_TYPE_SENSE_MASK;
  273. desc->status |= type & IRQ_TYPE_SENSE_MASK;
  274. ep93xx_gpio_update_int_params(port);
  275. return 0;
  276. }
  277. static struct irq_chip ep93xx_gpio_irq_chip = {
  278. .name = "GPIO",
  279. .ack = ep93xx_gpio_irq_ack,
  280. .mask_ack = ep93xx_gpio_irq_mask_ack,
  281. .mask = ep93xx_gpio_irq_mask,
  282. .unmask = ep93xx_gpio_irq_unmask,
  283. .set_type = ep93xx_gpio_irq_type,
  284. };
  285. void __init ep93xx_init_irq(void)
  286. {
  287. int gpio_irq;
  288. vic_init(EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK, 0);
  289. vic_init(EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK, 0);
  290. for (gpio_irq = gpio_to_irq(0);
  291. gpio_irq <= gpio_to_irq(EP93XX_GPIO_LINE_MAX_IRQ); ++gpio_irq) {
  292. set_irq_chip(gpio_irq, &ep93xx_gpio_irq_chip);
  293. set_irq_handler(gpio_irq, handle_level_irq);
  294. set_irq_flags(gpio_irq, IRQF_VALID);
  295. }
  296. set_irq_chained_handler(IRQ_EP93XX_GPIO_AB, ep93xx_gpio_ab_irq_handler);
  297. set_irq_chained_handler(IRQ_EP93XX_GPIO0MUX, ep93xx_gpio_f_irq_handler);
  298. set_irq_chained_handler(IRQ_EP93XX_GPIO1MUX, ep93xx_gpio_f_irq_handler);
  299. set_irq_chained_handler(IRQ_EP93XX_GPIO2MUX, ep93xx_gpio_f_irq_handler);
  300. set_irq_chained_handler(IRQ_EP93XX_GPIO3MUX, ep93xx_gpio_f_irq_handler);
  301. set_irq_chained_handler(IRQ_EP93XX_GPIO4MUX, ep93xx_gpio_f_irq_handler);
  302. set_irq_chained_handler(IRQ_EP93XX_GPIO5MUX, ep93xx_gpio_f_irq_handler);
  303. set_irq_chained_handler(IRQ_EP93XX_GPIO6MUX, ep93xx_gpio_f_irq_handler);
  304. set_irq_chained_handler(IRQ_EP93XX_GPIO7MUX, ep93xx_gpio_f_irq_handler);
  305. }
  306. /*************************************************************************
  307. * EP93xx System Controller Software Locked register handling
  308. *************************************************************************/
  309. /*
  310. * syscon_swlock prevents anything else from writing to the syscon
  311. * block while a software locked register is being written.
  312. */
  313. static DEFINE_SPINLOCK(syscon_swlock);
  314. void ep93xx_syscon_swlocked_write(unsigned int val, unsigned int reg)
  315. {
  316. unsigned long flags;
  317. spin_lock_irqsave(&syscon_swlock, flags);
  318. __raw_writel(0xaa, EP93XX_SYSCON_SWLOCK);
  319. __raw_writel(val, reg);
  320. spin_unlock_irqrestore(&syscon_swlock, flags);
  321. }
  322. EXPORT_SYMBOL(ep93xx_syscon_swlocked_write);
  323. void ep93xx_devcfg_set_clear(unsigned int set_bits, unsigned int clear_bits)
  324. {
  325. unsigned long flags;
  326. unsigned int val;
  327. spin_lock_irqsave(&syscon_swlock, flags);
  328. val = __raw_readl(EP93XX_SYSCON_DEVCFG);
  329. val |= set_bits;
  330. val &= ~clear_bits;
  331. __raw_writel(0xaa, EP93XX_SYSCON_SWLOCK);
  332. __raw_writel(val, EP93XX_SYSCON_DEVCFG);
  333. spin_unlock_irqrestore(&syscon_swlock, flags);
  334. }
  335. EXPORT_SYMBOL(ep93xx_devcfg_set_clear);
  336. /*************************************************************************
  337. * EP93xx peripheral handling
  338. *************************************************************************/
  339. #define EP93XX_UART_MCR_OFFSET (0x0100)
  340. static void ep93xx_uart_set_mctrl(struct amba_device *dev,
  341. void __iomem *base, unsigned int mctrl)
  342. {
  343. unsigned int mcr;
  344. mcr = 0;
  345. if (!(mctrl & TIOCM_RTS))
  346. mcr |= 2;
  347. if (!(mctrl & TIOCM_DTR))
  348. mcr |= 1;
  349. __raw_writel(mcr, base + EP93XX_UART_MCR_OFFSET);
  350. }
  351. static struct amba_pl010_data ep93xx_uart_data = {
  352. .set_mctrl = ep93xx_uart_set_mctrl,
  353. };
  354. static struct amba_device uart1_device = {
  355. .dev = {
  356. .init_name = "apb:uart1",
  357. .platform_data = &ep93xx_uart_data,
  358. },
  359. .res = {
  360. .start = EP93XX_UART1_PHYS_BASE,
  361. .end = EP93XX_UART1_PHYS_BASE + 0x0fff,
  362. .flags = IORESOURCE_MEM,
  363. },
  364. .irq = { IRQ_EP93XX_UART1, NO_IRQ },
  365. .periphid = 0x00041010,
  366. };
  367. static struct amba_device uart2_device = {
  368. .dev = {
  369. .init_name = "apb:uart2",
  370. .platform_data = &ep93xx_uart_data,
  371. },
  372. .res = {
  373. .start = EP93XX_UART2_PHYS_BASE,
  374. .end = EP93XX_UART2_PHYS_BASE + 0x0fff,
  375. .flags = IORESOURCE_MEM,
  376. },
  377. .irq = { IRQ_EP93XX_UART2, NO_IRQ },
  378. .periphid = 0x00041010,
  379. };
  380. static struct amba_device uart3_device = {
  381. .dev = {
  382. .init_name = "apb:uart3",
  383. .platform_data = &ep93xx_uart_data,
  384. },
  385. .res = {
  386. .start = EP93XX_UART3_PHYS_BASE,
  387. .end = EP93XX_UART3_PHYS_BASE + 0x0fff,
  388. .flags = IORESOURCE_MEM,
  389. },
  390. .irq = { IRQ_EP93XX_UART3, NO_IRQ },
  391. .periphid = 0x00041010,
  392. };
  393. static struct resource ep93xx_rtc_resource[] = {
  394. {
  395. .start = EP93XX_RTC_PHYS_BASE,
  396. .end = EP93XX_RTC_PHYS_BASE + 0x10c - 1,
  397. .flags = IORESOURCE_MEM,
  398. },
  399. };
  400. static struct platform_device ep93xx_rtc_device = {
  401. .name = "ep93xx-rtc",
  402. .id = -1,
  403. .num_resources = ARRAY_SIZE(ep93xx_rtc_resource),
  404. .resource = ep93xx_rtc_resource,
  405. };
  406. static struct resource ep93xx_ohci_resources[] = {
  407. [0] = {
  408. .start = EP93XX_USB_PHYS_BASE,
  409. .end = EP93XX_USB_PHYS_BASE + 0x0fff,
  410. .flags = IORESOURCE_MEM,
  411. },
  412. [1] = {
  413. .start = IRQ_EP93XX_USB,
  414. .end = IRQ_EP93XX_USB,
  415. .flags = IORESOURCE_IRQ,
  416. },
  417. };
  418. static struct platform_device ep93xx_ohci_device = {
  419. .name = "ep93xx-ohci",
  420. .id = -1,
  421. .dev = {
  422. .dma_mask = &ep93xx_ohci_device.dev.coherent_dma_mask,
  423. .coherent_dma_mask = DMA_BIT_MASK(32),
  424. },
  425. .num_resources = ARRAY_SIZE(ep93xx_ohci_resources),
  426. .resource = ep93xx_ohci_resources,
  427. };
  428. static struct ep93xx_eth_data ep93xx_eth_data;
  429. static struct resource ep93xx_eth_resource[] = {
  430. {
  431. .start = EP93XX_ETHERNET_PHYS_BASE,
  432. .end = EP93XX_ETHERNET_PHYS_BASE + 0xffff,
  433. .flags = IORESOURCE_MEM,
  434. }, {
  435. .start = IRQ_EP93XX_ETHERNET,
  436. .end = IRQ_EP93XX_ETHERNET,
  437. .flags = IORESOURCE_IRQ,
  438. }
  439. };
  440. static struct platform_device ep93xx_eth_device = {
  441. .name = "ep93xx-eth",
  442. .id = -1,
  443. .dev = {
  444. .platform_data = &ep93xx_eth_data,
  445. },
  446. .num_resources = ARRAY_SIZE(ep93xx_eth_resource),
  447. .resource = ep93xx_eth_resource,
  448. };
  449. void __init ep93xx_register_eth(struct ep93xx_eth_data *data, int copy_addr)
  450. {
  451. if (copy_addr)
  452. memcpy_fromio(data->dev_addr, EP93XX_ETHERNET_BASE + 0x50, 6);
  453. ep93xx_eth_data = *data;
  454. platform_device_register(&ep93xx_eth_device);
  455. }
  456. static struct i2c_gpio_platform_data ep93xx_i2c_data = {
  457. .sda_pin = EP93XX_GPIO_LINE_EEDAT,
  458. .sda_is_open_drain = 0,
  459. .scl_pin = EP93XX_GPIO_LINE_EECLK,
  460. .scl_is_open_drain = 0,
  461. .udelay = 2,
  462. };
  463. static struct platform_device ep93xx_i2c_device = {
  464. .name = "i2c-gpio",
  465. .id = 0,
  466. .dev.platform_data = &ep93xx_i2c_data,
  467. };
  468. void __init ep93xx_register_i2c(struct i2c_board_info *devices, int num)
  469. {
  470. i2c_register_board_info(0, devices, num);
  471. platform_device_register(&ep93xx_i2c_device);
  472. }
  473. extern void ep93xx_gpio_init(void);
  474. void __init ep93xx_init_devices(void)
  475. {
  476. /* Disallow access to MaverickCrunch initially */
  477. ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_CPENA);
  478. ep93xx_gpio_init();
  479. amba_device_register(&uart1_device, &iomem_resource);
  480. amba_device_register(&uart2_device, &iomem_resource);
  481. amba_device_register(&uart3_device, &iomem_resource);
  482. platform_device_register(&ep93xx_rtc_device);
  483. platform_device_register(&ep93xx_ohci_device);
  484. }