mach-bast.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  1. /* linux/arch/arm/mach-s3c2410/mach-bast.c
  2. *
  3. * Copyright 2003-2008 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. *
  6. * http://www.simtec.co.uk/products/EB2410ITX/
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/types.h>
  14. #include <linux/interrupt.h>
  15. #include <linux/list.h>
  16. #include <linux/timer.h>
  17. #include <linux/init.h>
  18. #include <linux/gpio.h>
  19. #include <linux/sysdev.h>
  20. #include <linux/serial_core.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/dm9000.h>
  23. #include <linux/ata_platform.h>
  24. #include <linux/i2c.h>
  25. #include <linux/io.h>
  26. #include <net/ax88796.h>
  27. #include <asm/mach/arch.h>
  28. #include <asm/mach/map.h>
  29. #include <asm/mach/irq.h>
  30. #include <mach/bast-map.h>
  31. #include <mach/bast-irq.h>
  32. #include <mach/bast-cpld.h>
  33. #include <mach/hardware.h>
  34. #include <asm/irq.h>
  35. #include <asm/mach-types.h>
  36. //#include <asm/debug-ll.h>
  37. #include <plat/regs-serial.h>
  38. #include <mach/regs-gpio.h>
  39. #include <mach/regs-mem.h>
  40. #include <mach/regs-lcd.h>
  41. #include <plat/hwmon.h>
  42. #include <plat/nand.h>
  43. #include <plat/iic.h>
  44. #include <mach/fb.h>
  45. #include <linux/mtd/mtd.h>
  46. #include <linux/mtd/nand.h>
  47. #include <linux/mtd/nand_ecc.h>
  48. #include <linux/mtd/partitions.h>
  49. #include <linux/serial_8250.h>
  50. #include <plat/clock.h>
  51. #include <plat/devs.h>
  52. #include <plat/cpu.h>
  53. #include <plat/cpu-freq.h>
  54. #include <plat/audio-simtec.h>
  55. #include "usb-simtec.h"
  56. #include "nor-simtec.h"
  57. #define COPYRIGHT ", Copyright 2004-2008 Simtec Electronics"
  58. /* macros for virtual address mods for the io space entries */
  59. #define VA_C5(item) ((unsigned long)(item) + BAST_VAM_CS5)
  60. #define VA_C4(item) ((unsigned long)(item) + BAST_VAM_CS4)
  61. #define VA_C3(item) ((unsigned long)(item) + BAST_VAM_CS3)
  62. #define VA_C2(item) ((unsigned long)(item) + BAST_VAM_CS2)
  63. /* macros to modify the physical addresses for io space */
  64. #define PA_CS2(item) (__phys_to_pfn((item) + S3C2410_CS2))
  65. #define PA_CS3(item) (__phys_to_pfn((item) + S3C2410_CS3))
  66. #define PA_CS4(item) (__phys_to_pfn((item) + S3C2410_CS4))
  67. #define PA_CS5(item) (__phys_to_pfn((item) + S3C2410_CS5))
  68. static struct map_desc bast_iodesc[] __initdata = {
  69. /* ISA IO areas */
  70. {
  71. .virtual = (u32)S3C24XX_VA_ISA_BYTE,
  72. .pfn = PA_CS2(BAST_PA_ISAIO),
  73. .length = SZ_16M,
  74. .type = MT_DEVICE,
  75. }, {
  76. .virtual = (u32)S3C24XX_VA_ISA_WORD,
  77. .pfn = PA_CS3(BAST_PA_ISAIO),
  78. .length = SZ_16M,
  79. .type = MT_DEVICE,
  80. },
  81. /* bast CPLD control registers, and external interrupt controls */
  82. {
  83. .virtual = (u32)BAST_VA_CTRL1,
  84. .pfn = __phys_to_pfn(BAST_PA_CTRL1),
  85. .length = SZ_1M,
  86. .type = MT_DEVICE,
  87. }, {
  88. .virtual = (u32)BAST_VA_CTRL2,
  89. .pfn = __phys_to_pfn(BAST_PA_CTRL2),
  90. .length = SZ_1M,
  91. .type = MT_DEVICE,
  92. }, {
  93. .virtual = (u32)BAST_VA_CTRL3,
  94. .pfn = __phys_to_pfn(BAST_PA_CTRL3),
  95. .length = SZ_1M,
  96. .type = MT_DEVICE,
  97. }, {
  98. .virtual = (u32)BAST_VA_CTRL4,
  99. .pfn = __phys_to_pfn(BAST_PA_CTRL4),
  100. .length = SZ_1M,
  101. .type = MT_DEVICE,
  102. },
  103. /* PC104 IRQ mux */
  104. {
  105. .virtual = (u32)BAST_VA_PC104_IRQREQ,
  106. .pfn = __phys_to_pfn(BAST_PA_PC104_IRQREQ),
  107. .length = SZ_1M,
  108. .type = MT_DEVICE,
  109. }, {
  110. .virtual = (u32)BAST_VA_PC104_IRQRAW,
  111. .pfn = __phys_to_pfn(BAST_PA_PC104_IRQRAW),
  112. .length = SZ_1M,
  113. .type = MT_DEVICE,
  114. }, {
  115. .virtual = (u32)BAST_VA_PC104_IRQMASK,
  116. .pfn = __phys_to_pfn(BAST_PA_PC104_IRQMASK),
  117. .length = SZ_1M,
  118. .type = MT_DEVICE,
  119. },
  120. /* peripheral space... one for each of fast/slow/byte/16bit */
  121. /* note, ide is only decoded in word space, even though some registers
  122. * are only 8bit */
  123. /* slow, byte */
  124. { VA_C2(BAST_VA_ISAIO), PA_CS2(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
  125. { VA_C2(BAST_VA_ISAMEM), PA_CS2(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
  126. { VA_C2(BAST_VA_SUPERIO), PA_CS2(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
  127. /* slow, word */
  128. { VA_C3(BAST_VA_ISAIO), PA_CS3(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
  129. { VA_C3(BAST_VA_ISAMEM), PA_CS3(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
  130. { VA_C3(BAST_VA_SUPERIO), PA_CS3(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
  131. /* fast, byte */
  132. { VA_C4(BAST_VA_ISAIO), PA_CS4(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
  133. { VA_C4(BAST_VA_ISAMEM), PA_CS4(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
  134. { VA_C4(BAST_VA_SUPERIO), PA_CS4(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
  135. /* fast, word */
  136. { VA_C5(BAST_VA_ISAIO), PA_CS5(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
  137. { VA_C5(BAST_VA_ISAMEM), PA_CS5(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
  138. { VA_C5(BAST_VA_SUPERIO), PA_CS5(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
  139. };
  140. #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
  141. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
  142. #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  143. static struct s3c24xx_uart_clksrc bast_serial_clocks[] = {
  144. [0] = {
  145. .name = "uclk",
  146. .divisor = 1,
  147. .min_baud = 0,
  148. .max_baud = 0,
  149. },
  150. [1] = {
  151. .name = "pclk",
  152. .divisor = 1,
  153. .min_baud = 0,
  154. .max_baud = 0,
  155. }
  156. };
  157. static struct s3c2410_uartcfg bast_uartcfgs[] __initdata = {
  158. [0] = {
  159. .hwport = 0,
  160. .flags = 0,
  161. .ucon = UCON,
  162. .ulcon = ULCON,
  163. .ufcon = UFCON,
  164. .clocks = bast_serial_clocks,
  165. .clocks_size = ARRAY_SIZE(bast_serial_clocks),
  166. },
  167. [1] = {
  168. .hwport = 1,
  169. .flags = 0,
  170. .ucon = UCON,
  171. .ulcon = ULCON,
  172. .ufcon = UFCON,
  173. .clocks = bast_serial_clocks,
  174. .clocks_size = ARRAY_SIZE(bast_serial_clocks),
  175. },
  176. /* port 2 is not actually used */
  177. [2] = {
  178. .hwport = 2,
  179. .flags = 0,
  180. .ucon = UCON,
  181. .ulcon = ULCON,
  182. .ufcon = UFCON,
  183. .clocks = bast_serial_clocks,
  184. .clocks_size = ARRAY_SIZE(bast_serial_clocks),
  185. }
  186. };
  187. /* NAND Flash on BAST board */
  188. #ifdef CONFIG_PM
  189. static int bast_pm_suspend(struct sys_device *sd, pm_message_t state)
  190. {
  191. /* ensure that an nRESET is not generated on resume. */
  192. gpio_direction_output(S3C2410_GPA(21), 1);
  193. return 0;
  194. }
  195. static int bast_pm_resume(struct sys_device *sd)
  196. {
  197. s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT);
  198. return 0;
  199. }
  200. #else
  201. #define bast_pm_suspend NULL
  202. #define bast_pm_resume NULL
  203. #endif
  204. static struct sysdev_class bast_pm_sysclass = {
  205. .name = "mach-bast",
  206. .suspend = bast_pm_suspend,
  207. .resume = bast_pm_resume,
  208. };
  209. static struct sys_device bast_pm_sysdev = {
  210. .cls = &bast_pm_sysclass,
  211. };
  212. static int smartmedia_map[] = { 0 };
  213. static int chip0_map[] = { 1 };
  214. static int chip1_map[] = { 2 };
  215. static int chip2_map[] = { 3 };
  216. static struct mtd_partition __initdata bast_default_nand_part[] = {
  217. [0] = {
  218. .name = "Boot Agent",
  219. .size = SZ_16K,
  220. .offset = 0,
  221. },
  222. [1] = {
  223. .name = "/boot",
  224. .size = SZ_4M - SZ_16K,
  225. .offset = SZ_16K,
  226. },
  227. [2] = {
  228. .name = "user",
  229. .offset = SZ_4M,
  230. .size = MTDPART_SIZ_FULL,
  231. }
  232. };
  233. /* the bast has 4 selectable slots for nand-flash, the three
  234. * on-board chip areas, as well as the external SmartMedia
  235. * slot.
  236. *
  237. * Note, there is no current hot-plug support for the SmartMedia
  238. * socket.
  239. */
  240. static struct s3c2410_nand_set __initdata bast_nand_sets[] = {
  241. [0] = {
  242. .name = "SmartMedia",
  243. .nr_chips = 1,
  244. .nr_map = smartmedia_map,
  245. .options = NAND_SCAN_SILENT_NODEV,
  246. .nr_partitions = ARRAY_SIZE(bast_default_nand_part),
  247. .partitions = bast_default_nand_part,
  248. },
  249. [1] = {
  250. .name = "chip0",
  251. .nr_chips = 1,
  252. .nr_map = chip0_map,
  253. .nr_partitions = ARRAY_SIZE(bast_default_nand_part),
  254. .partitions = bast_default_nand_part,
  255. },
  256. [2] = {
  257. .name = "chip1",
  258. .nr_chips = 1,
  259. .nr_map = chip1_map,
  260. .options = NAND_SCAN_SILENT_NODEV,
  261. .nr_partitions = ARRAY_SIZE(bast_default_nand_part),
  262. .partitions = bast_default_nand_part,
  263. },
  264. [3] = {
  265. .name = "chip2",
  266. .nr_chips = 1,
  267. .nr_map = chip2_map,
  268. .options = NAND_SCAN_SILENT_NODEV,
  269. .nr_partitions = ARRAY_SIZE(bast_default_nand_part),
  270. .partitions = bast_default_nand_part,
  271. }
  272. };
  273. static void bast_nand_select(struct s3c2410_nand_set *set, int slot)
  274. {
  275. unsigned int tmp;
  276. slot = set->nr_map[slot] & 3;
  277. pr_debug("bast_nand: selecting slot %d (set %p,%p)\n",
  278. slot, set, set->nr_map);
  279. tmp = __raw_readb(BAST_VA_CTRL2);
  280. tmp &= BAST_CPLD_CTLR2_IDERST;
  281. tmp |= slot;
  282. tmp |= BAST_CPLD_CTRL2_WNAND;
  283. pr_debug("bast_nand: ctrl2 now %02x\n", tmp);
  284. __raw_writeb(tmp, BAST_VA_CTRL2);
  285. }
  286. static struct s3c2410_platform_nand __initdata bast_nand_info = {
  287. .tacls = 30,
  288. .twrph0 = 60,
  289. .twrph1 = 60,
  290. .nr_sets = ARRAY_SIZE(bast_nand_sets),
  291. .sets = bast_nand_sets,
  292. .select_chip = bast_nand_select,
  293. };
  294. /* DM9000 */
  295. static struct resource bast_dm9k_resource[] = {
  296. [0] = {
  297. .start = S3C2410_CS5 + BAST_PA_DM9000,
  298. .end = S3C2410_CS5 + BAST_PA_DM9000 + 3,
  299. .flags = IORESOURCE_MEM,
  300. },
  301. [1] = {
  302. .start = S3C2410_CS5 + BAST_PA_DM9000 + 0x40,
  303. .end = S3C2410_CS5 + BAST_PA_DM9000 + 0x40 + 0x3f,
  304. .flags = IORESOURCE_MEM,
  305. },
  306. [2] = {
  307. .start = IRQ_DM9000,
  308. .end = IRQ_DM9000,
  309. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  310. }
  311. };
  312. /* for the moment we limit ourselves to 16bit IO until some
  313. * better IO routines can be written and tested
  314. */
  315. static struct dm9000_plat_data bast_dm9k_platdata = {
  316. .flags = DM9000_PLATF_16BITONLY,
  317. };
  318. static struct platform_device bast_device_dm9k = {
  319. .name = "dm9000",
  320. .id = 0,
  321. .num_resources = ARRAY_SIZE(bast_dm9k_resource),
  322. .resource = bast_dm9k_resource,
  323. .dev = {
  324. .platform_data = &bast_dm9k_platdata,
  325. }
  326. };
  327. /* serial devices */
  328. #define SERIAL_BASE (S3C2410_CS2 + BAST_PA_SUPERIO)
  329. #define SERIAL_FLAGS (UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SHARE_IRQ)
  330. #define SERIAL_CLK (1843200)
  331. static struct plat_serial8250_port bast_sio_data[] = {
  332. [0] = {
  333. .mapbase = SERIAL_BASE + 0x2f8,
  334. .irq = IRQ_PCSERIAL1,
  335. .flags = SERIAL_FLAGS,
  336. .iotype = UPIO_MEM,
  337. .regshift = 0,
  338. .uartclk = SERIAL_CLK,
  339. },
  340. [1] = {
  341. .mapbase = SERIAL_BASE + 0x3f8,
  342. .irq = IRQ_PCSERIAL2,
  343. .flags = SERIAL_FLAGS,
  344. .iotype = UPIO_MEM,
  345. .regshift = 0,
  346. .uartclk = SERIAL_CLK,
  347. },
  348. { }
  349. };
  350. static struct platform_device bast_sio = {
  351. .name = "serial8250",
  352. .id = PLAT8250_DEV_PLATFORM,
  353. .dev = {
  354. .platform_data = &bast_sio_data,
  355. },
  356. };
  357. /* we have devices on the bus which cannot work much over the
  358. * standard 100KHz i2c bus frequency
  359. */
  360. static struct s3c2410_platform_i2c __initdata bast_i2c_info = {
  361. .flags = 0,
  362. .slave_addr = 0x10,
  363. .frequency = 100*1000,
  364. };
  365. /* Asix AX88796 10/100 ethernet controller */
  366. static struct ax_plat_data bast_asix_platdata = {
  367. .flags = AXFLG_MAC_FROMDEV,
  368. .wordlength = 2,
  369. .dcr_val = 0x48,
  370. .rcr_val = 0x40,
  371. };
  372. static struct resource bast_asix_resource[] = {
  373. [0] = {
  374. .start = S3C2410_CS5 + BAST_PA_ASIXNET,
  375. .end = S3C2410_CS5 + BAST_PA_ASIXNET + (0x18 * 0x20) - 1,
  376. .flags = IORESOURCE_MEM,
  377. },
  378. [1] = {
  379. .start = S3C2410_CS5 + BAST_PA_ASIXNET + (0x1f * 0x20),
  380. .end = S3C2410_CS5 + BAST_PA_ASIXNET + (0x1f * 0x20),
  381. .flags = IORESOURCE_MEM,
  382. },
  383. [2] = {
  384. .start = IRQ_ASIX,
  385. .end = IRQ_ASIX,
  386. .flags = IORESOURCE_IRQ
  387. }
  388. };
  389. static struct platform_device bast_device_asix = {
  390. .name = "ax88796",
  391. .id = 0,
  392. .num_resources = ARRAY_SIZE(bast_asix_resource),
  393. .resource = bast_asix_resource,
  394. .dev = {
  395. .platform_data = &bast_asix_platdata
  396. }
  397. };
  398. /* Asix AX88796 10/100 ethernet controller parallel port */
  399. static struct resource bast_asixpp_resource[] = {
  400. [0] = {
  401. .start = S3C2410_CS5 + BAST_PA_ASIXNET + (0x18 * 0x20),
  402. .end = S3C2410_CS5 + BAST_PA_ASIXNET + (0x1b * 0x20) - 1,
  403. .flags = IORESOURCE_MEM,
  404. }
  405. };
  406. static struct platform_device bast_device_axpp = {
  407. .name = "ax88796-pp",
  408. .id = 0,
  409. .num_resources = ARRAY_SIZE(bast_asixpp_resource),
  410. .resource = bast_asixpp_resource,
  411. };
  412. /* LCD/VGA controller */
  413. static struct s3c2410fb_display __initdata bast_lcd_info[] = {
  414. {
  415. .type = S3C2410_LCDCON1_TFT,
  416. .width = 640,
  417. .height = 480,
  418. .pixclock = 33333,
  419. .xres = 640,
  420. .yres = 480,
  421. .bpp = 4,
  422. .left_margin = 40,
  423. .right_margin = 20,
  424. .hsync_len = 88,
  425. .upper_margin = 30,
  426. .lower_margin = 32,
  427. .vsync_len = 3,
  428. .lcdcon5 = 0x00014b02,
  429. },
  430. {
  431. .type = S3C2410_LCDCON1_TFT,
  432. .width = 640,
  433. .height = 480,
  434. .pixclock = 33333,
  435. .xres = 640,
  436. .yres = 480,
  437. .bpp = 8,
  438. .left_margin = 40,
  439. .right_margin = 20,
  440. .hsync_len = 88,
  441. .upper_margin = 30,
  442. .lower_margin = 32,
  443. .vsync_len = 3,
  444. .lcdcon5 = 0x00014b02,
  445. },
  446. {
  447. .type = S3C2410_LCDCON1_TFT,
  448. .width = 640,
  449. .height = 480,
  450. .pixclock = 33333,
  451. .xres = 640,
  452. .yres = 480,
  453. .bpp = 16,
  454. .left_margin = 40,
  455. .right_margin = 20,
  456. .hsync_len = 88,
  457. .upper_margin = 30,
  458. .lower_margin = 32,
  459. .vsync_len = 3,
  460. .lcdcon5 = 0x00014b02,
  461. },
  462. };
  463. /* LCD/VGA controller */
  464. static struct s3c2410fb_mach_info __initdata bast_fb_info = {
  465. .displays = bast_lcd_info,
  466. .num_displays = ARRAY_SIZE(bast_lcd_info),
  467. .default_display = 1,
  468. };
  469. /* I2C devices fitted. */
  470. static struct i2c_board_info bast_i2c_devs[] __initdata = {
  471. {
  472. I2C_BOARD_INFO("tlv320aic23", 0x1a),
  473. }, {
  474. I2C_BOARD_INFO("simtec-pmu", 0x6b),
  475. }, {
  476. I2C_BOARD_INFO("ch7013", 0x75),
  477. },
  478. };
  479. static struct s3c_hwmon_pdata bast_hwmon_info = {
  480. /* LCD contrast (0-6.6V) */
  481. .in[0] = &(struct s3c_hwmon_chcfg) {
  482. .name = "lcd-contrast",
  483. .mult = 3300,
  484. .div = 512,
  485. },
  486. /* LED current feedback */
  487. .in[1] = &(struct s3c_hwmon_chcfg) {
  488. .name = "led-feedback",
  489. .mult = 3300,
  490. .div = 1024,
  491. },
  492. /* LCD feedback (0-6.6V) */
  493. .in[2] = &(struct s3c_hwmon_chcfg) {
  494. .name = "lcd-feedback",
  495. .mult = 3300,
  496. .div = 512,
  497. },
  498. /* Vcore (1.8-2.0V), Vref 3.3V */
  499. .in[3] = &(struct s3c_hwmon_chcfg) {
  500. .name = "vcore",
  501. .mult = 3300,
  502. .div = 1024,
  503. },
  504. };
  505. /* Standard BAST devices */
  506. // cat /sys/devices/platform/s3c24xx-adc/s3c-hwmon/in_0
  507. static struct platform_device *bast_devices[] __initdata = {
  508. &s3c_device_ohci,
  509. &s3c_device_lcd,
  510. &s3c_device_wdt,
  511. &s3c_device_i2c0,
  512. &s3c_device_rtc,
  513. &s3c_device_nand,
  514. &s3c_device_adc,
  515. &s3c_device_hwmon,
  516. &bast_device_dm9k,
  517. &bast_device_asix,
  518. &bast_device_axpp,
  519. &bast_sio,
  520. };
  521. static struct clk *bast_clocks[] __initdata = {
  522. &s3c24xx_dclk0,
  523. &s3c24xx_dclk1,
  524. &s3c24xx_clkout0,
  525. &s3c24xx_clkout1,
  526. &s3c24xx_uclk,
  527. };
  528. static struct s3c_cpufreq_board __initdata bast_cpufreq = {
  529. .refresh = 7800, /* 7.8usec */
  530. .auto_io = 1,
  531. .need_io = 1,
  532. };
  533. static struct s3c24xx_audio_simtec_pdata __initdata bast_audio = {
  534. .have_mic = 1,
  535. .have_lout = 1,
  536. };
  537. static void __init bast_map_io(void)
  538. {
  539. /* initialise the clocks */
  540. s3c24xx_dclk0.parent = &clk_upll;
  541. s3c24xx_dclk0.rate = 12*1000*1000;
  542. s3c24xx_dclk1.parent = &clk_upll;
  543. s3c24xx_dclk1.rate = 24*1000*1000;
  544. s3c24xx_clkout0.parent = &s3c24xx_dclk0;
  545. s3c24xx_clkout1.parent = &s3c24xx_dclk1;
  546. s3c24xx_uclk.parent = &s3c24xx_clkout1;
  547. s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks));
  548. s3c_device_hwmon.dev.platform_data = &bast_hwmon_info;
  549. s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
  550. s3c24xx_init_clocks(0);
  551. s3c24xx_init_uarts(bast_uartcfgs, ARRAY_SIZE(bast_uartcfgs));
  552. }
  553. static void __init bast_init(void)
  554. {
  555. sysdev_class_register(&bast_pm_sysclass);
  556. sysdev_register(&bast_pm_sysdev);
  557. s3c_i2c0_set_platdata(&bast_i2c_info);
  558. s3c_nand_set_platdata(&bast_nand_info);
  559. s3c24xx_fb_set_platdata(&bast_fb_info);
  560. platform_add_devices(bast_devices, ARRAY_SIZE(bast_devices));
  561. i2c_register_board_info(0, bast_i2c_devs,
  562. ARRAY_SIZE(bast_i2c_devs));
  563. usb_simtec_init();
  564. nor_simtec_init();
  565. simtec_audio_add(NULL, true, &bast_audio);
  566. WARN_ON(gpio_request(S3C2410_GPA(21), "bast nreset"));
  567. s3c_cpufreq_setboard(&bast_cpufreq);
  568. }
  569. MACHINE_START(BAST, "Simtec-BAST")
  570. /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
  571. .phys_io = S3C2410_PA_UART,
  572. .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
  573. .boot_params = S3C2410_SDRAM_PA + 0x100,
  574. .map_io = bast_map_io,
  575. .init_irq = s3c24xx_init_irq,
  576. .init_machine = bast_init,
  577. .timer = &s3c24xx_timer,
  578. MACHINE_END