at91sam9260_devices.c 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199
  1. /*
  2. * arch/arm/mach-at91/at91sam9260_devices.c
  3. *
  4. * Copyright (C) 2006 Atmel
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. */
  12. #include <asm/mach/arch.h>
  13. #include <asm/mach/map.h>
  14. #include <linux/dma-mapping.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/i2c-gpio.h>
  17. #include <asm/arch/board.h>
  18. #include <asm/arch/gpio.h>
  19. #include <asm/arch/at91sam9260.h>
  20. #include <asm/arch/at91sam9260_matrix.h>
  21. #include <asm/arch/at91sam9_smc.h>
  22. #include "generic.h"
  23. /* --------------------------------------------------------------------
  24. * USB Host
  25. * -------------------------------------------------------------------- */
  26. #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
  27. static u64 ohci_dmamask = DMA_BIT_MASK(32);
  28. static struct at91_usbh_data usbh_data;
  29. static struct resource usbh_resources[] = {
  30. [0] = {
  31. .start = AT91SAM9260_UHP_BASE,
  32. .end = AT91SAM9260_UHP_BASE + SZ_1M - 1,
  33. .flags = IORESOURCE_MEM,
  34. },
  35. [1] = {
  36. .start = AT91SAM9260_ID_UHP,
  37. .end = AT91SAM9260_ID_UHP,
  38. .flags = IORESOURCE_IRQ,
  39. },
  40. };
  41. static struct platform_device at91_usbh_device = {
  42. .name = "at91_ohci",
  43. .id = -1,
  44. .dev = {
  45. .dma_mask = &ohci_dmamask,
  46. .coherent_dma_mask = DMA_BIT_MASK(32),
  47. .platform_data = &usbh_data,
  48. },
  49. .resource = usbh_resources,
  50. .num_resources = ARRAY_SIZE(usbh_resources),
  51. };
  52. void __init at91_add_device_usbh(struct at91_usbh_data *data)
  53. {
  54. if (!data)
  55. return;
  56. usbh_data = *data;
  57. platform_device_register(&at91_usbh_device);
  58. }
  59. #else
  60. void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
  61. #endif
  62. /* --------------------------------------------------------------------
  63. * USB Device (Gadget)
  64. * -------------------------------------------------------------------- */
  65. #ifdef CONFIG_USB_GADGET_AT91
  66. static struct at91_udc_data udc_data;
  67. static struct resource udc_resources[] = {
  68. [0] = {
  69. .start = AT91SAM9260_BASE_UDP,
  70. .end = AT91SAM9260_BASE_UDP + SZ_16K - 1,
  71. .flags = IORESOURCE_MEM,
  72. },
  73. [1] = {
  74. .start = AT91SAM9260_ID_UDP,
  75. .end = AT91SAM9260_ID_UDP,
  76. .flags = IORESOURCE_IRQ,
  77. },
  78. };
  79. static struct platform_device at91_udc_device = {
  80. .name = "at91_udc",
  81. .id = -1,
  82. .dev = {
  83. .platform_data = &udc_data,
  84. },
  85. .resource = udc_resources,
  86. .num_resources = ARRAY_SIZE(udc_resources),
  87. };
  88. void __init at91_add_device_udc(struct at91_udc_data *data)
  89. {
  90. if (!data)
  91. return;
  92. if (data->vbus_pin) {
  93. at91_set_gpio_input(data->vbus_pin, 0);
  94. at91_set_deglitch(data->vbus_pin, 1);
  95. }
  96. /* Pullup pin is handled internally by USB device peripheral */
  97. udc_data = *data;
  98. platform_device_register(&at91_udc_device);
  99. }
  100. #else
  101. void __init at91_add_device_udc(struct at91_udc_data *data) {}
  102. #endif
  103. /* --------------------------------------------------------------------
  104. * Ethernet
  105. * -------------------------------------------------------------------- */
  106. #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
  107. static u64 eth_dmamask = DMA_BIT_MASK(32);
  108. static struct at91_eth_data eth_data;
  109. static struct resource eth_resources[] = {
  110. [0] = {
  111. .start = AT91SAM9260_BASE_EMAC,
  112. .end = AT91SAM9260_BASE_EMAC + SZ_16K - 1,
  113. .flags = IORESOURCE_MEM,
  114. },
  115. [1] = {
  116. .start = AT91SAM9260_ID_EMAC,
  117. .end = AT91SAM9260_ID_EMAC,
  118. .flags = IORESOURCE_IRQ,
  119. },
  120. };
  121. static struct platform_device at91sam9260_eth_device = {
  122. .name = "macb",
  123. .id = -1,
  124. .dev = {
  125. .dma_mask = &eth_dmamask,
  126. .coherent_dma_mask = DMA_BIT_MASK(32),
  127. .platform_data = &eth_data,
  128. },
  129. .resource = eth_resources,
  130. .num_resources = ARRAY_SIZE(eth_resources),
  131. };
  132. void __init at91_add_device_eth(struct at91_eth_data *data)
  133. {
  134. if (!data)
  135. return;
  136. if (data->phy_irq_pin) {
  137. at91_set_gpio_input(data->phy_irq_pin, 0);
  138. at91_set_deglitch(data->phy_irq_pin, 1);
  139. }
  140. /* Pins used for MII and RMII */
  141. at91_set_A_periph(AT91_PIN_PA19, 0); /* ETXCK_EREFCK */
  142. at91_set_A_periph(AT91_PIN_PA17, 0); /* ERXDV */
  143. at91_set_A_periph(AT91_PIN_PA14, 0); /* ERX0 */
  144. at91_set_A_periph(AT91_PIN_PA15, 0); /* ERX1 */
  145. at91_set_A_periph(AT91_PIN_PA18, 0); /* ERXER */
  146. at91_set_A_periph(AT91_PIN_PA16, 0); /* ETXEN */
  147. at91_set_A_periph(AT91_PIN_PA12, 0); /* ETX0 */
  148. at91_set_A_periph(AT91_PIN_PA13, 0); /* ETX1 */
  149. at91_set_A_periph(AT91_PIN_PA21, 0); /* EMDIO */
  150. at91_set_A_periph(AT91_PIN_PA20, 0); /* EMDC */
  151. if (!data->is_rmii) {
  152. at91_set_B_periph(AT91_PIN_PA28, 0); /* ECRS */
  153. at91_set_B_periph(AT91_PIN_PA29, 0); /* ECOL */
  154. at91_set_B_periph(AT91_PIN_PA25, 0); /* ERX2 */
  155. at91_set_B_periph(AT91_PIN_PA26, 0); /* ERX3 */
  156. at91_set_B_periph(AT91_PIN_PA27, 0); /* ERXCK */
  157. at91_set_B_periph(AT91_PIN_PA23, 0); /* ETX2 */
  158. at91_set_B_periph(AT91_PIN_PA24, 0); /* ETX3 */
  159. at91_set_B_periph(AT91_PIN_PA22, 0); /* ETXER */
  160. }
  161. eth_data = *data;
  162. platform_device_register(&at91sam9260_eth_device);
  163. }
  164. #else
  165. void __init at91_add_device_eth(struct at91_eth_data *data) {}
  166. #endif
  167. /* --------------------------------------------------------------------
  168. * MMC / SD
  169. * -------------------------------------------------------------------- */
  170. #if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
  171. static u64 mmc_dmamask = DMA_BIT_MASK(32);
  172. static struct at91_mmc_data mmc_data;
  173. static struct resource mmc_resources[] = {
  174. [0] = {
  175. .start = AT91SAM9260_BASE_MCI,
  176. .end = AT91SAM9260_BASE_MCI + SZ_16K - 1,
  177. .flags = IORESOURCE_MEM,
  178. },
  179. [1] = {
  180. .start = AT91SAM9260_ID_MCI,
  181. .end = AT91SAM9260_ID_MCI,
  182. .flags = IORESOURCE_IRQ,
  183. },
  184. };
  185. static struct platform_device at91sam9260_mmc_device = {
  186. .name = "at91_mci",
  187. .id = -1,
  188. .dev = {
  189. .dma_mask = &mmc_dmamask,
  190. .coherent_dma_mask = DMA_BIT_MASK(32),
  191. .platform_data = &mmc_data,
  192. },
  193. .resource = mmc_resources,
  194. .num_resources = ARRAY_SIZE(mmc_resources),
  195. };
  196. void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
  197. {
  198. if (!data)
  199. return;
  200. /* input/irq */
  201. if (data->det_pin) {
  202. at91_set_gpio_input(data->det_pin, 1);
  203. at91_set_deglitch(data->det_pin, 1);
  204. }
  205. if (data->wp_pin)
  206. at91_set_gpio_input(data->wp_pin, 1);
  207. if (data->vcc_pin)
  208. at91_set_gpio_output(data->vcc_pin, 0);
  209. /* CLK */
  210. at91_set_A_periph(AT91_PIN_PA8, 0);
  211. if (data->slot_b) {
  212. /* CMD */
  213. at91_set_B_periph(AT91_PIN_PA1, 1);
  214. /* DAT0, maybe DAT1..DAT3 */
  215. at91_set_B_periph(AT91_PIN_PA0, 1);
  216. if (data->wire4) {
  217. at91_set_B_periph(AT91_PIN_PA5, 1);
  218. at91_set_B_periph(AT91_PIN_PA4, 1);
  219. at91_set_B_periph(AT91_PIN_PA3, 1);
  220. }
  221. } else {
  222. /* CMD */
  223. at91_set_A_periph(AT91_PIN_PA7, 1);
  224. /* DAT0, maybe DAT1..DAT3 */
  225. at91_set_A_periph(AT91_PIN_PA6, 1);
  226. if (data->wire4) {
  227. at91_set_A_periph(AT91_PIN_PA9, 1);
  228. at91_set_A_periph(AT91_PIN_PA10, 1);
  229. at91_set_A_periph(AT91_PIN_PA11, 1);
  230. }
  231. }
  232. mmc_data = *data;
  233. platform_device_register(&at91sam9260_mmc_device);
  234. }
  235. #else
  236. void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
  237. #endif
  238. /* --------------------------------------------------------------------
  239. * NAND / SmartMedia
  240. * -------------------------------------------------------------------- */
  241. #if defined(CONFIG_MTD_NAND_AT91) || defined(CONFIG_MTD_NAND_AT91_MODULE)
  242. static struct at91_nand_data nand_data;
  243. #define NAND_BASE AT91_CHIPSELECT_3
  244. static struct resource nand_resources[] = {
  245. [0] = {
  246. .start = NAND_BASE,
  247. .end = NAND_BASE + SZ_256M - 1,
  248. .flags = IORESOURCE_MEM,
  249. },
  250. [1] = {
  251. .start = AT91_BASE_SYS + AT91_ECC,
  252. .end = AT91_BASE_SYS + AT91_ECC + SZ_512 - 1,
  253. .flags = IORESOURCE_MEM,
  254. }
  255. };
  256. static struct platform_device at91sam9260_nand_device = {
  257. .name = "at91_nand",
  258. .id = -1,
  259. .dev = {
  260. .platform_data = &nand_data,
  261. },
  262. .resource = nand_resources,
  263. .num_resources = ARRAY_SIZE(nand_resources),
  264. };
  265. void __init at91_add_device_nand(struct at91_nand_data *data)
  266. {
  267. unsigned long csa, mode;
  268. if (!data)
  269. return;
  270. csa = at91_sys_read(AT91_MATRIX_EBICSA);
  271. at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
  272. /* set the bus interface characteristics */
  273. at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(0) | AT91_SMC_NCS_WRSETUP_(0)
  274. | AT91_SMC_NRDSETUP_(0) | AT91_SMC_NCS_RDSETUP_(0));
  275. at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3)
  276. | AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3));
  277. at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5));
  278. if (data->bus_width_16)
  279. mode = AT91_SMC_DBW_16;
  280. else
  281. mode = AT91_SMC_DBW_8;
  282. at91_sys_write(AT91_SMC_MODE(3), mode | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(2));
  283. /* enable pin */
  284. if (data->enable_pin)
  285. at91_set_gpio_output(data->enable_pin, 1);
  286. /* ready/busy pin */
  287. if (data->rdy_pin)
  288. at91_set_gpio_input(data->rdy_pin, 1);
  289. /* card detect pin */
  290. if (data->det_pin)
  291. at91_set_gpio_input(data->det_pin, 1);
  292. nand_data = *data;
  293. platform_device_register(&at91sam9260_nand_device);
  294. }
  295. #else
  296. void __init at91_add_device_nand(struct at91_nand_data *data) {}
  297. #endif
  298. /* --------------------------------------------------------------------
  299. * TWI (i2c)
  300. * -------------------------------------------------------------------- */
  301. /*
  302. * Prefer the GPIO code since the TWI controller isn't robust
  303. * (gets overruns and underruns under load) and can only issue
  304. * repeated STARTs in one scenario (the driver doesn't yet handle them).
  305. */
  306. #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
  307. static struct i2c_gpio_platform_data pdata = {
  308. .sda_pin = AT91_PIN_PA23,
  309. .sda_is_open_drain = 1,
  310. .scl_pin = AT91_PIN_PA24,
  311. .scl_is_open_drain = 1,
  312. .udelay = 2, /* ~100 kHz */
  313. };
  314. static struct platform_device at91sam9260_twi_device = {
  315. .name = "i2c-gpio",
  316. .id = -1,
  317. .dev.platform_data = &pdata,
  318. };
  319. void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
  320. {
  321. at91_set_GPIO_periph(AT91_PIN_PA23, 1); /* TWD (SDA) */
  322. at91_set_multi_drive(AT91_PIN_PA23, 1);
  323. at91_set_GPIO_periph(AT91_PIN_PA24, 1); /* TWCK (SCL) */
  324. at91_set_multi_drive(AT91_PIN_PA24, 1);
  325. i2c_register_board_info(0, devices, nr_devices);
  326. platform_device_register(&at91sam9260_twi_device);
  327. }
  328. #elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
  329. static struct resource twi_resources[] = {
  330. [0] = {
  331. .start = AT91SAM9260_BASE_TWI,
  332. .end = AT91SAM9260_BASE_TWI + SZ_16K - 1,
  333. .flags = IORESOURCE_MEM,
  334. },
  335. [1] = {
  336. .start = AT91SAM9260_ID_TWI,
  337. .end = AT91SAM9260_ID_TWI,
  338. .flags = IORESOURCE_IRQ,
  339. },
  340. };
  341. static struct platform_device at91sam9260_twi_device = {
  342. .name = "at91_i2c",
  343. .id = -1,
  344. .resource = twi_resources,
  345. .num_resources = ARRAY_SIZE(twi_resources),
  346. };
  347. void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
  348. {
  349. /* pins used for TWI interface */
  350. at91_set_A_periph(AT91_PIN_PA23, 0); /* TWD */
  351. at91_set_multi_drive(AT91_PIN_PA23, 1);
  352. at91_set_A_periph(AT91_PIN_PA24, 0); /* TWCK */
  353. at91_set_multi_drive(AT91_PIN_PA24, 1);
  354. i2c_register_board_info(0, devices, nr_devices);
  355. platform_device_register(&at91sam9260_twi_device);
  356. }
  357. #else
  358. void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {}
  359. #endif
  360. /* --------------------------------------------------------------------
  361. * SPI
  362. * -------------------------------------------------------------------- */
  363. #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
  364. static u64 spi_dmamask = DMA_BIT_MASK(32);
  365. static struct resource spi0_resources[] = {
  366. [0] = {
  367. .start = AT91SAM9260_BASE_SPI0,
  368. .end = AT91SAM9260_BASE_SPI0 + SZ_16K - 1,
  369. .flags = IORESOURCE_MEM,
  370. },
  371. [1] = {
  372. .start = AT91SAM9260_ID_SPI0,
  373. .end = AT91SAM9260_ID_SPI0,
  374. .flags = IORESOURCE_IRQ,
  375. },
  376. };
  377. static struct platform_device at91sam9260_spi0_device = {
  378. .name = "atmel_spi",
  379. .id = 0,
  380. .dev = {
  381. .dma_mask = &spi_dmamask,
  382. .coherent_dma_mask = DMA_BIT_MASK(32),
  383. },
  384. .resource = spi0_resources,
  385. .num_resources = ARRAY_SIZE(spi0_resources),
  386. };
  387. static const unsigned spi0_standard_cs[4] = { AT91_PIN_PA3, AT91_PIN_PC11, AT91_PIN_PC16, AT91_PIN_PC17 };
  388. static struct resource spi1_resources[] = {
  389. [0] = {
  390. .start = AT91SAM9260_BASE_SPI1,
  391. .end = AT91SAM9260_BASE_SPI1 + SZ_16K - 1,
  392. .flags = IORESOURCE_MEM,
  393. },
  394. [1] = {
  395. .start = AT91SAM9260_ID_SPI1,
  396. .end = AT91SAM9260_ID_SPI1,
  397. .flags = IORESOURCE_IRQ,
  398. },
  399. };
  400. static struct platform_device at91sam9260_spi1_device = {
  401. .name = "atmel_spi",
  402. .id = 1,
  403. .dev = {
  404. .dma_mask = &spi_dmamask,
  405. .coherent_dma_mask = DMA_BIT_MASK(32),
  406. },
  407. .resource = spi1_resources,
  408. .num_resources = ARRAY_SIZE(spi1_resources),
  409. };
  410. static const unsigned spi1_standard_cs[4] = { AT91_PIN_PB3, AT91_PIN_PC5, AT91_PIN_PC4, AT91_PIN_PC3 };
  411. void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
  412. {
  413. int i;
  414. unsigned long cs_pin;
  415. short enable_spi0 = 0;
  416. short enable_spi1 = 0;
  417. /* Choose SPI chip-selects */
  418. for (i = 0; i < nr_devices; i++) {
  419. if (devices[i].controller_data)
  420. cs_pin = (unsigned long) devices[i].controller_data;
  421. else if (devices[i].bus_num == 0)
  422. cs_pin = spi0_standard_cs[devices[i].chip_select];
  423. else
  424. cs_pin = spi1_standard_cs[devices[i].chip_select];
  425. if (devices[i].bus_num == 0)
  426. enable_spi0 = 1;
  427. else
  428. enable_spi1 = 1;
  429. /* enable chip-select pin */
  430. at91_set_gpio_output(cs_pin, 1);
  431. /* pass chip-select pin to driver */
  432. devices[i].controller_data = (void *) cs_pin;
  433. }
  434. spi_register_board_info(devices, nr_devices);
  435. /* Configure SPI bus(es) */
  436. if (enable_spi0) {
  437. at91_set_A_periph(AT91_PIN_PA0, 0); /* SPI0_MISO */
  438. at91_set_A_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */
  439. at91_set_A_periph(AT91_PIN_PA2, 0); /* SPI1_SPCK */
  440. at91_clock_associate("spi0_clk", &at91sam9260_spi0_device.dev, "spi_clk");
  441. platform_device_register(&at91sam9260_spi0_device);
  442. }
  443. if (enable_spi1) {
  444. at91_set_A_periph(AT91_PIN_PB0, 0); /* SPI1_MISO */
  445. at91_set_A_periph(AT91_PIN_PB1, 0); /* SPI1_MOSI */
  446. at91_set_A_periph(AT91_PIN_PB2, 0); /* SPI1_SPCK */
  447. at91_clock_associate("spi1_clk", &at91sam9260_spi1_device.dev, "spi_clk");
  448. platform_device_register(&at91sam9260_spi1_device);
  449. }
  450. }
  451. #else
  452. void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {}
  453. #endif
  454. /* --------------------------------------------------------------------
  455. * Timer/Counter blocks
  456. * -------------------------------------------------------------------- */
  457. #ifdef CONFIG_ATMEL_TCLIB
  458. static struct resource tcb0_resources[] = {
  459. [0] = {
  460. .start = AT91SAM9260_BASE_TCB0,
  461. .end = AT91SAM9260_BASE_TCB0 + SZ_16K - 1,
  462. .flags = IORESOURCE_MEM,
  463. },
  464. [1] = {
  465. .start = AT91SAM9260_ID_TC0,
  466. .end = AT91SAM9260_ID_TC0,
  467. .flags = IORESOURCE_IRQ,
  468. },
  469. [2] = {
  470. .start = AT91SAM9260_ID_TC1,
  471. .end = AT91SAM9260_ID_TC1,
  472. .flags = IORESOURCE_IRQ,
  473. },
  474. [3] = {
  475. .start = AT91SAM9260_ID_TC2,
  476. .end = AT91SAM9260_ID_TC2,
  477. .flags = IORESOURCE_IRQ,
  478. },
  479. };
  480. static struct platform_device at91sam9260_tcb0_device = {
  481. .name = "atmel_tcb",
  482. .id = 0,
  483. .resource = tcb0_resources,
  484. .num_resources = ARRAY_SIZE(tcb0_resources),
  485. };
  486. static struct resource tcb1_resources[] = {
  487. [0] = {
  488. .start = AT91SAM9260_BASE_TCB1,
  489. .end = AT91SAM9260_BASE_TCB1 + SZ_16K - 1,
  490. .flags = IORESOURCE_MEM,
  491. },
  492. [1] = {
  493. .start = AT91SAM9260_ID_TC3,
  494. .end = AT91SAM9260_ID_TC3,
  495. .flags = IORESOURCE_IRQ,
  496. },
  497. [2] = {
  498. .start = AT91SAM9260_ID_TC4,
  499. .end = AT91SAM9260_ID_TC4,
  500. .flags = IORESOURCE_IRQ,
  501. },
  502. [3] = {
  503. .start = AT91SAM9260_ID_TC5,
  504. .end = AT91SAM9260_ID_TC5,
  505. .flags = IORESOURCE_IRQ,
  506. },
  507. };
  508. static struct platform_device at91sam9260_tcb1_device = {
  509. .name = "atmel_tcb",
  510. .id = 1,
  511. .resource = tcb1_resources,
  512. .num_resources = ARRAY_SIZE(tcb1_resources),
  513. };
  514. static void __init at91_add_device_tc(void)
  515. {
  516. /* this chip has a separate clock and irq for each TC channel */
  517. at91_clock_associate("tc0_clk", &at91sam9260_tcb0_device.dev, "t0_clk");
  518. at91_clock_associate("tc1_clk", &at91sam9260_tcb0_device.dev, "t1_clk");
  519. at91_clock_associate("tc2_clk", &at91sam9260_tcb0_device.dev, "t2_clk");
  520. platform_device_register(&at91sam9260_tcb0_device);
  521. at91_clock_associate("tc3_clk", &at91sam9260_tcb1_device.dev, "t0_clk");
  522. at91_clock_associate("tc4_clk", &at91sam9260_tcb1_device.dev, "t1_clk");
  523. at91_clock_associate("tc5_clk", &at91sam9260_tcb1_device.dev, "t2_clk");
  524. platform_device_register(&at91sam9260_tcb1_device);
  525. }
  526. #else
  527. static void __init at91_add_device_tc(void) { }
  528. #endif
  529. /* --------------------------------------------------------------------
  530. * RTT
  531. * -------------------------------------------------------------------- */
  532. static struct resource rtt_resources[] = {
  533. {
  534. .start = AT91_BASE_SYS + AT91_RTT,
  535. .end = AT91_BASE_SYS + AT91_RTT + SZ_16 - 1,
  536. .flags = IORESOURCE_MEM,
  537. }
  538. };
  539. static struct platform_device at91sam9260_rtt_device = {
  540. .name = "at91_rtt",
  541. .id = 0,
  542. .resource = rtt_resources,
  543. .num_resources = ARRAY_SIZE(rtt_resources),
  544. };
  545. static void __init at91_add_device_rtt(void)
  546. {
  547. platform_device_register(&at91sam9260_rtt_device);
  548. }
  549. /* --------------------------------------------------------------------
  550. * Watchdog
  551. * -------------------------------------------------------------------- */
  552. #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE)
  553. static struct platform_device at91sam9260_wdt_device = {
  554. .name = "at91_wdt",
  555. .id = -1,
  556. .num_resources = 0,
  557. };
  558. static void __init at91_add_device_watchdog(void)
  559. {
  560. platform_device_register(&at91sam9260_wdt_device);
  561. }
  562. #else
  563. static void __init at91_add_device_watchdog(void) {}
  564. #endif
  565. /* --------------------------------------------------------------------
  566. * SSC -- Synchronous Serial Controller
  567. * -------------------------------------------------------------------- */
  568. #if defined(CONFIG_ATMEL_SSC) || defined(CONFIG_ATMEL_SSC_MODULE)
  569. static u64 ssc_dmamask = DMA_BIT_MASK(32);
  570. static struct resource ssc_resources[] = {
  571. [0] = {
  572. .start = AT91SAM9260_BASE_SSC,
  573. .end = AT91SAM9260_BASE_SSC + SZ_16K - 1,
  574. .flags = IORESOURCE_MEM,
  575. },
  576. [1] = {
  577. .start = AT91SAM9260_ID_SSC,
  578. .end = AT91SAM9260_ID_SSC,
  579. .flags = IORESOURCE_IRQ,
  580. },
  581. };
  582. static struct platform_device at91sam9260_ssc_device = {
  583. .name = "ssc",
  584. .id = 0,
  585. .dev = {
  586. .dma_mask = &ssc_dmamask,
  587. .coherent_dma_mask = DMA_BIT_MASK(32),
  588. },
  589. .resource = ssc_resources,
  590. .num_resources = ARRAY_SIZE(ssc_resources),
  591. };
  592. static inline void configure_ssc_pins(unsigned pins)
  593. {
  594. if (pins & ATMEL_SSC_TF)
  595. at91_set_A_periph(AT91_PIN_PB17, 1);
  596. if (pins & ATMEL_SSC_TK)
  597. at91_set_A_periph(AT91_PIN_PB16, 1);
  598. if (pins & ATMEL_SSC_TD)
  599. at91_set_A_periph(AT91_PIN_PB18, 1);
  600. if (pins & ATMEL_SSC_RD)
  601. at91_set_A_periph(AT91_PIN_PB19, 1);
  602. if (pins & ATMEL_SSC_RK)
  603. at91_set_A_periph(AT91_PIN_PB20, 1);
  604. if (pins & ATMEL_SSC_RF)
  605. at91_set_A_periph(AT91_PIN_PB21, 1);
  606. }
  607. /*
  608. * SSC controllers are accessed through library code, instead of any
  609. * kind of all-singing/all-dancing driver. For example one could be
  610. * used by a particular I2S audio codec's driver, while another one
  611. * on the same system might be used by a custom data capture driver.
  612. */
  613. void __init at91_add_device_ssc(unsigned id, unsigned pins)
  614. {
  615. struct platform_device *pdev;
  616. /*
  617. * NOTE: caller is responsible for passing information matching
  618. * "pins" to whatever will be using each particular controller.
  619. */
  620. switch (id) {
  621. case AT91SAM9260_ID_SSC:
  622. pdev = &at91sam9260_ssc_device;
  623. configure_ssc_pins(pins);
  624. at91_clock_associate("ssc_clk", &pdev->dev, "pclk");
  625. break;
  626. default:
  627. return;
  628. }
  629. platform_device_register(pdev);
  630. }
  631. #else
  632. void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
  633. #endif
  634. /* --------------------------------------------------------------------
  635. * UART
  636. * -------------------------------------------------------------------- */
  637. #if defined(CONFIG_SERIAL_ATMEL)
  638. static struct resource dbgu_resources[] = {
  639. [0] = {
  640. .start = AT91_VA_BASE_SYS + AT91_DBGU,
  641. .end = AT91_VA_BASE_SYS + AT91_DBGU + SZ_512 - 1,
  642. .flags = IORESOURCE_MEM,
  643. },
  644. [1] = {
  645. .start = AT91_ID_SYS,
  646. .end = AT91_ID_SYS,
  647. .flags = IORESOURCE_IRQ,
  648. },
  649. };
  650. static struct atmel_uart_data dbgu_data = {
  651. .use_dma_tx = 0,
  652. .use_dma_rx = 0, /* DBGU not capable of receive DMA */
  653. .regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
  654. };
  655. static u64 dbgu_dmamask = DMA_BIT_MASK(32);
  656. static struct platform_device at91sam9260_dbgu_device = {
  657. .name = "atmel_usart",
  658. .id = 0,
  659. .dev = {
  660. .dma_mask = &dbgu_dmamask,
  661. .coherent_dma_mask = DMA_BIT_MASK(32),
  662. .platform_data = &dbgu_data,
  663. },
  664. .resource = dbgu_resources,
  665. .num_resources = ARRAY_SIZE(dbgu_resources),
  666. };
  667. static inline void configure_dbgu_pins(void)
  668. {
  669. at91_set_A_periph(AT91_PIN_PB14, 0); /* DRXD */
  670. at91_set_A_periph(AT91_PIN_PB15, 1); /* DTXD */
  671. }
  672. static struct resource uart0_resources[] = {
  673. [0] = {
  674. .start = AT91SAM9260_BASE_US0,
  675. .end = AT91SAM9260_BASE_US0 + SZ_16K - 1,
  676. .flags = IORESOURCE_MEM,
  677. },
  678. [1] = {
  679. .start = AT91SAM9260_ID_US0,
  680. .end = AT91SAM9260_ID_US0,
  681. .flags = IORESOURCE_IRQ,
  682. },
  683. };
  684. static struct atmel_uart_data uart0_data = {
  685. .use_dma_tx = 1,
  686. .use_dma_rx = 1,
  687. };
  688. static u64 uart0_dmamask = DMA_BIT_MASK(32);
  689. static struct platform_device at91sam9260_uart0_device = {
  690. .name = "atmel_usart",
  691. .id = 1,
  692. .dev = {
  693. .dma_mask = &uart0_dmamask,
  694. .coherent_dma_mask = DMA_BIT_MASK(32),
  695. .platform_data = &uart0_data,
  696. },
  697. .resource = uart0_resources,
  698. .num_resources = ARRAY_SIZE(uart0_resources),
  699. };
  700. static inline void configure_usart0_pins(unsigned pins)
  701. {
  702. at91_set_A_periph(AT91_PIN_PB4, 1); /* TXD0 */
  703. at91_set_A_periph(AT91_PIN_PB5, 0); /* RXD0 */
  704. if (pins & ATMEL_UART_RTS)
  705. at91_set_A_periph(AT91_PIN_PB26, 0); /* RTS0 */
  706. if (pins & ATMEL_UART_CTS)
  707. at91_set_A_periph(AT91_PIN_PB27, 0); /* CTS0 */
  708. if (pins & ATMEL_UART_DTR)
  709. at91_set_A_periph(AT91_PIN_PB24, 0); /* DTR0 */
  710. if (pins & ATMEL_UART_DSR)
  711. at91_set_A_periph(AT91_PIN_PB22, 0); /* DSR0 */
  712. if (pins & ATMEL_UART_DCD)
  713. at91_set_A_periph(AT91_PIN_PB23, 0); /* DCD0 */
  714. if (pins & ATMEL_UART_RI)
  715. at91_set_A_periph(AT91_PIN_PB25, 0); /* RI0 */
  716. }
  717. static struct resource uart1_resources[] = {
  718. [0] = {
  719. .start = AT91SAM9260_BASE_US1,
  720. .end = AT91SAM9260_BASE_US1 + SZ_16K - 1,
  721. .flags = IORESOURCE_MEM,
  722. },
  723. [1] = {
  724. .start = AT91SAM9260_ID_US1,
  725. .end = AT91SAM9260_ID_US1,
  726. .flags = IORESOURCE_IRQ,
  727. },
  728. };
  729. static struct atmel_uart_data uart1_data = {
  730. .use_dma_tx = 1,
  731. .use_dma_rx = 1,
  732. };
  733. static u64 uart1_dmamask = DMA_BIT_MASK(32);
  734. static struct platform_device at91sam9260_uart1_device = {
  735. .name = "atmel_usart",
  736. .id = 2,
  737. .dev = {
  738. .dma_mask = &uart1_dmamask,
  739. .coherent_dma_mask = DMA_BIT_MASK(32),
  740. .platform_data = &uart1_data,
  741. },
  742. .resource = uart1_resources,
  743. .num_resources = ARRAY_SIZE(uart1_resources),
  744. };
  745. static inline void configure_usart1_pins(unsigned pins)
  746. {
  747. at91_set_A_periph(AT91_PIN_PB6, 1); /* TXD1 */
  748. at91_set_A_periph(AT91_PIN_PB7, 0); /* RXD1 */
  749. if (pins & ATMEL_UART_RTS)
  750. at91_set_A_periph(AT91_PIN_PB28, 0); /* RTS1 */
  751. if (pins & ATMEL_UART_CTS)
  752. at91_set_A_periph(AT91_PIN_PB29, 0); /* CTS1 */
  753. }
  754. static struct resource uart2_resources[] = {
  755. [0] = {
  756. .start = AT91SAM9260_BASE_US2,
  757. .end = AT91SAM9260_BASE_US2 + SZ_16K - 1,
  758. .flags = IORESOURCE_MEM,
  759. },
  760. [1] = {
  761. .start = AT91SAM9260_ID_US2,
  762. .end = AT91SAM9260_ID_US2,
  763. .flags = IORESOURCE_IRQ,
  764. },
  765. };
  766. static struct atmel_uart_data uart2_data = {
  767. .use_dma_tx = 1,
  768. .use_dma_rx = 1,
  769. };
  770. static u64 uart2_dmamask = DMA_BIT_MASK(32);
  771. static struct platform_device at91sam9260_uart2_device = {
  772. .name = "atmel_usart",
  773. .id = 3,
  774. .dev = {
  775. .dma_mask = &uart2_dmamask,
  776. .coherent_dma_mask = DMA_BIT_MASK(32),
  777. .platform_data = &uart2_data,
  778. },
  779. .resource = uart2_resources,
  780. .num_resources = ARRAY_SIZE(uart2_resources),
  781. };
  782. static inline void configure_usart2_pins(unsigned pins)
  783. {
  784. at91_set_A_periph(AT91_PIN_PB8, 1); /* TXD2 */
  785. at91_set_A_periph(AT91_PIN_PB9, 0); /* RXD2 */
  786. if (pins & ATMEL_UART_RTS)
  787. at91_set_A_periph(AT91_PIN_PA4, 0); /* RTS2 */
  788. if (pins & ATMEL_UART_CTS)
  789. at91_set_A_periph(AT91_PIN_PA5, 0); /* CTS2 */
  790. }
  791. static struct resource uart3_resources[] = {
  792. [0] = {
  793. .start = AT91SAM9260_BASE_US3,
  794. .end = AT91SAM9260_BASE_US3 + SZ_16K - 1,
  795. .flags = IORESOURCE_MEM,
  796. },
  797. [1] = {
  798. .start = AT91SAM9260_ID_US3,
  799. .end = AT91SAM9260_ID_US3,
  800. .flags = IORESOURCE_IRQ,
  801. },
  802. };
  803. static struct atmel_uart_data uart3_data = {
  804. .use_dma_tx = 1,
  805. .use_dma_rx = 1,
  806. };
  807. static u64 uart3_dmamask = DMA_BIT_MASK(32);
  808. static struct platform_device at91sam9260_uart3_device = {
  809. .name = "atmel_usart",
  810. .id = 4,
  811. .dev = {
  812. .dma_mask = &uart3_dmamask,
  813. .coherent_dma_mask = DMA_BIT_MASK(32),
  814. .platform_data = &uart3_data,
  815. },
  816. .resource = uart3_resources,
  817. .num_resources = ARRAY_SIZE(uart3_resources),
  818. };
  819. static inline void configure_usart3_pins(unsigned pins)
  820. {
  821. at91_set_A_periph(AT91_PIN_PB10, 1); /* TXD3 */
  822. at91_set_A_periph(AT91_PIN_PB11, 0); /* RXD3 */
  823. if (pins & ATMEL_UART_RTS)
  824. at91_set_B_periph(AT91_PIN_PC8, 0); /* RTS3 */
  825. if (pins & ATMEL_UART_CTS)
  826. at91_set_B_periph(AT91_PIN_PC10, 0); /* CTS3 */
  827. }
  828. static struct resource uart4_resources[] = {
  829. [0] = {
  830. .start = AT91SAM9260_BASE_US4,
  831. .end = AT91SAM9260_BASE_US4 + SZ_16K - 1,
  832. .flags = IORESOURCE_MEM,
  833. },
  834. [1] = {
  835. .start = AT91SAM9260_ID_US4,
  836. .end = AT91SAM9260_ID_US4,
  837. .flags = IORESOURCE_IRQ,
  838. },
  839. };
  840. static struct atmel_uart_data uart4_data = {
  841. .use_dma_tx = 1,
  842. .use_dma_rx = 1,
  843. };
  844. static u64 uart4_dmamask = DMA_BIT_MASK(32);
  845. static struct platform_device at91sam9260_uart4_device = {
  846. .name = "atmel_usart",
  847. .id = 5,
  848. .dev = {
  849. .dma_mask = &uart4_dmamask,
  850. .coherent_dma_mask = DMA_BIT_MASK(32),
  851. .platform_data = &uart4_data,
  852. },
  853. .resource = uart4_resources,
  854. .num_resources = ARRAY_SIZE(uart4_resources),
  855. };
  856. static inline void configure_usart4_pins(void)
  857. {
  858. at91_set_B_periph(AT91_PIN_PA31, 1); /* TXD4 */
  859. at91_set_B_periph(AT91_PIN_PA30, 0); /* RXD4 */
  860. }
  861. static struct resource uart5_resources[] = {
  862. [0] = {
  863. .start = AT91SAM9260_BASE_US5,
  864. .end = AT91SAM9260_BASE_US5 + SZ_16K - 1,
  865. .flags = IORESOURCE_MEM,
  866. },
  867. [1] = {
  868. .start = AT91SAM9260_ID_US5,
  869. .end = AT91SAM9260_ID_US5,
  870. .flags = IORESOURCE_IRQ,
  871. },
  872. };
  873. static struct atmel_uart_data uart5_data = {
  874. .use_dma_tx = 1,
  875. .use_dma_rx = 1,
  876. };
  877. static u64 uart5_dmamask = DMA_BIT_MASK(32);
  878. static struct platform_device at91sam9260_uart5_device = {
  879. .name = "atmel_usart",
  880. .id = 6,
  881. .dev = {
  882. .dma_mask = &uart5_dmamask,
  883. .coherent_dma_mask = DMA_BIT_MASK(32),
  884. .platform_data = &uart5_data,
  885. },
  886. .resource = uart5_resources,
  887. .num_resources = ARRAY_SIZE(uart5_resources),
  888. };
  889. static inline void configure_usart5_pins(void)
  890. {
  891. at91_set_A_periph(AT91_PIN_PB12, 1); /* TXD5 */
  892. at91_set_A_periph(AT91_PIN_PB13, 0); /* RXD5 */
  893. }
  894. static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
  895. struct platform_device *atmel_default_console_device; /* the serial console device */
  896. void __init __deprecated at91_init_serial(struct at91_uart_config *config)
  897. {
  898. int i;
  899. /* Fill in list of supported UARTs */
  900. for (i = 0; i < config->nr_tty; i++) {
  901. switch (config->tty_map[i]) {
  902. case 0:
  903. configure_usart0_pins(ATMEL_UART_CTS | ATMEL_UART_RTS | ATMEL_UART_DSR | ATMEL_UART_DTR | ATMEL_UART_DCD | ATMEL_UART_RI);
  904. at91_uarts[i] = &at91sam9260_uart0_device;
  905. at91_clock_associate("usart0_clk", &at91sam9260_uart0_device.dev, "usart");
  906. break;
  907. case 1:
  908. configure_usart1_pins(ATMEL_UART_CTS | ATMEL_UART_RTS);
  909. at91_uarts[i] = &at91sam9260_uart1_device;
  910. at91_clock_associate("usart1_clk", &at91sam9260_uart1_device.dev, "usart");
  911. break;
  912. case 2:
  913. configure_usart2_pins(0);
  914. at91_uarts[i] = &at91sam9260_uart2_device;
  915. at91_clock_associate("usart2_clk", &at91sam9260_uart2_device.dev, "usart");
  916. break;
  917. case 3:
  918. configure_usart3_pins(0);
  919. at91_uarts[i] = &at91sam9260_uart3_device;
  920. at91_clock_associate("usart3_clk", &at91sam9260_uart3_device.dev, "usart");
  921. break;
  922. case 4:
  923. configure_usart4_pins();
  924. at91_uarts[i] = &at91sam9260_uart4_device;
  925. at91_clock_associate("usart4_clk", &at91sam9260_uart4_device.dev, "usart");
  926. break;
  927. case 5:
  928. configure_usart5_pins();
  929. at91_uarts[i] = &at91sam9260_uart5_device;
  930. at91_clock_associate("usart5_clk", &at91sam9260_uart5_device.dev, "usart");
  931. break;
  932. case 6:
  933. configure_dbgu_pins();
  934. at91_uarts[i] = &at91sam9260_dbgu_device;
  935. at91_clock_associate("mck", &at91sam9260_dbgu_device.dev, "usart");
  936. break;
  937. default:
  938. continue;
  939. }
  940. at91_uarts[i]->id = i; /* update ID number to mapped ID */
  941. }
  942. /* Set serial console device */
  943. if (config->console_tty < ATMEL_MAX_UART)
  944. atmel_default_console_device = at91_uarts[config->console_tty];
  945. if (!atmel_default_console_device)
  946. printk(KERN_INFO "AT91: No default serial console defined.\n");
  947. }
  948. void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
  949. {
  950. struct platform_device *pdev;
  951. switch (id) {
  952. case 0: /* DBGU */
  953. pdev = &at91sam9260_dbgu_device;
  954. configure_dbgu_pins();
  955. at91_clock_associate("mck", &pdev->dev, "usart");
  956. break;
  957. case AT91SAM9260_ID_US0:
  958. pdev = &at91sam9260_uart0_device;
  959. configure_usart0_pins(pins);
  960. at91_clock_associate("usart0_clk", &pdev->dev, "usart");
  961. break;
  962. case AT91SAM9260_ID_US1:
  963. pdev = &at91sam9260_uart1_device;
  964. configure_usart1_pins(pins);
  965. at91_clock_associate("usart1_clk", &pdev->dev, "usart");
  966. break;
  967. case AT91SAM9260_ID_US2:
  968. pdev = &at91sam9260_uart2_device;
  969. configure_usart2_pins(pins);
  970. at91_clock_associate("usart2_clk", &pdev->dev, "usart");
  971. break;
  972. case AT91SAM9260_ID_US3:
  973. pdev = &at91sam9260_uart3_device;
  974. configure_usart3_pins(pins);
  975. at91_clock_associate("usart3_clk", &pdev->dev, "usart");
  976. break;
  977. case AT91SAM9260_ID_US4:
  978. pdev = &at91sam9260_uart4_device;
  979. configure_usart4_pins();
  980. at91_clock_associate("usart4_clk", &pdev->dev, "usart");
  981. break;
  982. case AT91SAM9260_ID_US5:
  983. pdev = &at91sam9260_uart5_device;
  984. configure_usart5_pins();
  985. at91_clock_associate("usart5_clk", &pdev->dev, "usart");
  986. break;
  987. default:
  988. return;
  989. }
  990. pdev->id = portnr; /* update to mapped ID */
  991. if (portnr < ATMEL_MAX_UART)
  992. at91_uarts[portnr] = pdev;
  993. }
  994. void __init at91_set_serial_console(unsigned portnr)
  995. {
  996. if (portnr < ATMEL_MAX_UART)
  997. atmel_default_console_device = at91_uarts[portnr];
  998. if (!atmel_default_console_device)
  999. printk(KERN_INFO "AT91: No default serial console defined.\n");
  1000. }
  1001. void __init at91_add_device_serial(void)
  1002. {
  1003. int i;
  1004. for (i = 0; i < ATMEL_MAX_UART; i++) {
  1005. if (at91_uarts[i])
  1006. platform_device_register(at91_uarts[i]);
  1007. }
  1008. }
  1009. #else
  1010. void __init __deprecated at91_init_serial(struct at91_uart_config *config) {}
  1011. void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
  1012. void __init at91_set_serial_console(unsigned portnr) {}
  1013. void __init at91_add_device_serial(void) {}
  1014. #endif
  1015. /* -------------------------------------------------------------------- */
  1016. /*
  1017. * These devices are always present and don't need any board-specific
  1018. * setup.
  1019. */
  1020. static int __init at91_add_standard_devices(void)
  1021. {
  1022. at91_add_device_rtt();
  1023. at91_add_device_watchdog();
  1024. at91_add_device_tc();
  1025. return 0;
  1026. }
  1027. arch_initcall(at91_add_standard_devices);