mach-bast.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  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. s3c2410_gpio_setpin(S3C2410_GPA(21), 1);
  193. s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPIO_OUTPUT);
  194. return 0;
  195. }
  196. static int bast_pm_resume(struct sys_device *sd)
  197. {
  198. s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT);
  199. return 0;
  200. }
  201. #else
  202. #define bast_pm_suspend NULL
  203. #define bast_pm_resume NULL
  204. #endif
  205. static struct sysdev_class bast_pm_sysclass = {
  206. .name = "mach-bast",
  207. .suspend = bast_pm_suspend,
  208. .resume = bast_pm_resume,
  209. };
  210. static struct sys_device bast_pm_sysdev = {
  211. .cls = &bast_pm_sysclass,
  212. };
  213. static int smartmedia_map[] = { 0 };
  214. static int chip0_map[] = { 1 };
  215. static int chip1_map[] = { 2 };
  216. static int chip2_map[] = { 3 };
  217. static struct mtd_partition __initdata bast_default_nand_part[] = {
  218. [0] = {
  219. .name = "Boot Agent",
  220. .size = SZ_16K,
  221. .offset = 0,
  222. },
  223. [1] = {
  224. .name = "/boot",
  225. .size = SZ_4M - SZ_16K,
  226. .offset = SZ_16K,
  227. },
  228. [2] = {
  229. .name = "user",
  230. .offset = SZ_4M,
  231. .size = MTDPART_SIZ_FULL,
  232. }
  233. };
  234. /* the bast has 4 selectable slots for nand-flash, the three
  235. * on-board chip areas, as well as the external SmartMedia
  236. * slot.
  237. *
  238. * Note, there is no current hot-plug support for the SmartMedia
  239. * socket.
  240. */
  241. static struct s3c2410_nand_set __initdata bast_nand_sets[] = {
  242. [0] = {
  243. .name = "SmartMedia",
  244. .nr_chips = 1,
  245. .nr_map = smartmedia_map,
  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. .nr_partitions = ARRAY_SIZE(bast_default_nand_part),
  261. .partitions = bast_default_nand_part,
  262. },
  263. [3] = {
  264. .name = "chip2",
  265. .nr_chips = 1,
  266. .nr_map = chip2_map,
  267. .nr_partitions = ARRAY_SIZE(bast_default_nand_part),
  268. .partitions = bast_default_nand_part,
  269. }
  270. };
  271. static void bast_nand_select(struct s3c2410_nand_set *set, int slot)
  272. {
  273. unsigned int tmp;
  274. slot = set->nr_map[slot] & 3;
  275. pr_debug("bast_nand: selecting slot %d (set %p,%p)\n",
  276. slot, set, set->nr_map);
  277. tmp = __raw_readb(BAST_VA_CTRL2);
  278. tmp &= BAST_CPLD_CTLR2_IDERST;
  279. tmp |= slot;
  280. tmp |= BAST_CPLD_CTRL2_WNAND;
  281. pr_debug("bast_nand: ctrl2 now %02x\n", tmp);
  282. __raw_writeb(tmp, BAST_VA_CTRL2);
  283. }
  284. static struct s3c2410_platform_nand __initdata bast_nand_info = {
  285. .tacls = 30,
  286. .twrph0 = 60,
  287. .twrph1 = 60,
  288. .nr_sets = ARRAY_SIZE(bast_nand_sets),
  289. .sets = bast_nand_sets,
  290. .select_chip = bast_nand_select,
  291. };
  292. /* DM9000 */
  293. static struct resource bast_dm9k_resource[] = {
  294. [0] = {
  295. .start = S3C2410_CS5 + BAST_PA_DM9000,
  296. .end = S3C2410_CS5 + BAST_PA_DM9000 + 3,
  297. .flags = IORESOURCE_MEM,
  298. },
  299. [1] = {
  300. .start = S3C2410_CS5 + BAST_PA_DM9000 + 0x40,
  301. .end = S3C2410_CS5 + BAST_PA_DM9000 + 0x40 + 0x3f,
  302. .flags = IORESOURCE_MEM,
  303. },
  304. [2] = {
  305. .start = IRQ_DM9000,
  306. .end = IRQ_DM9000,
  307. .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
  308. }
  309. };
  310. /* for the moment we limit ourselves to 16bit IO until some
  311. * better IO routines can be written and tested
  312. */
  313. static struct dm9000_plat_data bast_dm9k_platdata = {
  314. .flags = DM9000_PLATF_16BITONLY,
  315. };
  316. static struct platform_device bast_device_dm9k = {
  317. .name = "dm9000",
  318. .id = 0,
  319. .num_resources = ARRAY_SIZE(bast_dm9k_resource),
  320. .resource = bast_dm9k_resource,
  321. .dev = {
  322. .platform_data = &bast_dm9k_platdata,
  323. }
  324. };
  325. /* serial devices */
  326. #define SERIAL_BASE (S3C2410_CS2 + BAST_PA_SUPERIO)
  327. #define SERIAL_FLAGS (UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SHARE_IRQ)
  328. #define SERIAL_CLK (1843200)
  329. static struct plat_serial8250_port bast_sio_data[] = {
  330. [0] = {
  331. .mapbase = SERIAL_BASE + 0x2f8,
  332. .irq = IRQ_PCSERIAL1,
  333. .flags = SERIAL_FLAGS,
  334. .iotype = UPIO_MEM,
  335. .regshift = 0,
  336. .uartclk = SERIAL_CLK,
  337. },
  338. [1] = {
  339. .mapbase = SERIAL_BASE + 0x3f8,
  340. .irq = IRQ_PCSERIAL2,
  341. .flags = SERIAL_FLAGS,
  342. .iotype = UPIO_MEM,
  343. .regshift = 0,
  344. .uartclk = SERIAL_CLK,
  345. },
  346. { }
  347. };
  348. static struct platform_device bast_sio = {
  349. .name = "serial8250",
  350. .id = PLAT8250_DEV_PLATFORM,
  351. .dev = {
  352. .platform_data = &bast_sio_data,
  353. },
  354. };
  355. /* we have devices on the bus which cannot work much over the
  356. * standard 100KHz i2c bus frequency
  357. */
  358. static struct s3c2410_platform_i2c __initdata bast_i2c_info = {
  359. .flags = 0,
  360. .slave_addr = 0x10,
  361. .frequency = 100*1000,
  362. };
  363. /* Asix AX88796 10/100 ethernet controller */
  364. static struct ax_plat_data bast_asix_platdata = {
  365. .flags = AXFLG_MAC_FROMDEV,
  366. .wordlength = 2,
  367. .dcr_val = 0x48,
  368. .rcr_val = 0x40,
  369. };
  370. static struct resource bast_asix_resource[] = {
  371. [0] = {
  372. .start = S3C2410_CS5 + BAST_PA_ASIXNET,
  373. .end = S3C2410_CS5 + BAST_PA_ASIXNET + (0x18 * 0x20) - 1,
  374. .flags = IORESOURCE_MEM,
  375. },
  376. [1] = {
  377. .start = S3C2410_CS5 + BAST_PA_ASIXNET + (0x1f * 0x20),
  378. .end = S3C2410_CS5 + BAST_PA_ASIXNET + (0x1f * 0x20),
  379. .flags = IORESOURCE_MEM,
  380. },
  381. [2] = {
  382. .start = IRQ_ASIX,
  383. .end = IRQ_ASIX,
  384. .flags = IORESOURCE_IRQ
  385. }
  386. };
  387. static struct platform_device bast_device_asix = {
  388. .name = "ax88796",
  389. .id = 0,
  390. .num_resources = ARRAY_SIZE(bast_asix_resource),
  391. .resource = bast_asix_resource,
  392. .dev = {
  393. .platform_data = &bast_asix_platdata
  394. }
  395. };
  396. /* Asix AX88796 10/100 ethernet controller parallel port */
  397. static struct resource bast_asixpp_resource[] = {
  398. [0] = {
  399. .start = S3C2410_CS5 + BAST_PA_ASIXNET + (0x18 * 0x20),
  400. .end = S3C2410_CS5 + BAST_PA_ASIXNET + (0x1b * 0x20) - 1,
  401. .flags = IORESOURCE_MEM,
  402. }
  403. };
  404. static struct platform_device bast_device_axpp = {
  405. .name = "ax88796-pp",
  406. .id = 0,
  407. .num_resources = ARRAY_SIZE(bast_asixpp_resource),
  408. .resource = bast_asixpp_resource,
  409. };
  410. /* LCD/VGA controller */
  411. static struct s3c2410fb_display __initdata bast_lcd_info[] = {
  412. {
  413. .type = S3C2410_LCDCON1_TFT,
  414. .width = 640,
  415. .height = 480,
  416. .pixclock = 33333,
  417. .xres = 640,
  418. .yres = 480,
  419. .bpp = 4,
  420. .left_margin = 40,
  421. .right_margin = 20,
  422. .hsync_len = 88,
  423. .upper_margin = 30,
  424. .lower_margin = 32,
  425. .vsync_len = 3,
  426. .lcdcon5 = 0x00014b02,
  427. },
  428. {
  429. .type = S3C2410_LCDCON1_TFT,
  430. .width = 640,
  431. .height = 480,
  432. .pixclock = 33333,
  433. .xres = 640,
  434. .yres = 480,
  435. .bpp = 8,
  436. .left_margin = 40,
  437. .right_margin = 20,
  438. .hsync_len = 88,
  439. .upper_margin = 30,
  440. .lower_margin = 32,
  441. .vsync_len = 3,
  442. .lcdcon5 = 0x00014b02,
  443. },
  444. {
  445. .type = S3C2410_LCDCON1_TFT,
  446. .width = 640,
  447. .height = 480,
  448. .pixclock = 33333,
  449. .xres = 640,
  450. .yres = 480,
  451. .bpp = 16,
  452. .left_margin = 40,
  453. .right_margin = 20,
  454. .hsync_len = 88,
  455. .upper_margin = 30,
  456. .lower_margin = 32,
  457. .vsync_len = 3,
  458. .lcdcon5 = 0x00014b02,
  459. },
  460. };
  461. /* LCD/VGA controller */
  462. static struct s3c2410fb_mach_info __initdata bast_fb_info = {
  463. .displays = bast_lcd_info,
  464. .num_displays = ARRAY_SIZE(bast_lcd_info),
  465. .default_display = 1,
  466. };
  467. /* I2C devices fitted. */
  468. static struct i2c_board_info bast_i2c_devs[] __initdata = {
  469. {
  470. I2C_BOARD_INFO("tlv320aic23", 0x1a),
  471. }, {
  472. I2C_BOARD_INFO("simtec-pmu", 0x6b),
  473. }, {
  474. I2C_BOARD_INFO("ch7013", 0x75),
  475. },
  476. };
  477. static struct s3c_hwmon_pdata bast_hwmon_info = {
  478. /* LCD contrast (0-6.6V) */
  479. .in[0] = &(struct s3c_hwmon_chcfg) {
  480. .name = "lcd-contrast",
  481. .mult = 3300,
  482. .div = 512,
  483. },
  484. /* LED current feedback */
  485. .in[1] = &(struct s3c_hwmon_chcfg) {
  486. .name = "led-feedback",
  487. .mult = 3300,
  488. .div = 1024,
  489. },
  490. /* LCD feedback (0-6.6V) */
  491. .in[2] = &(struct s3c_hwmon_chcfg) {
  492. .name = "lcd-feedback",
  493. .mult = 3300,
  494. .div = 512,
  495. },
  496. /* Vcore (1.8-2.0V), Vref 3.3V */
  497. .in[3] = &(struct s3c_hwmon_chcfg) {
  498. .name = "vcore",
  499. .mult = 3300,
  500. .div = 1024,
  501. },
  502. };
  503. /* Standard BAST devices */
  504. // cat /sys/devices/platform/s3c24xx-adc/s3c-hwmon/in_0
  505. static struct platform_device *bast_devices[] __initdata = {
  506. &s3c_device_usb,
  507. &s3c_device_lcd,
  508. &s3c_device_wdt,
  509. &s3c_device_i2c0,
  510. &s3c_device_rtc,
  511. &s3c_device_nand,
  512. &s3c_device_adc,
  513. &s3c_device_hwmon,
  514. &bast_device_dm9k,
  515. &bast_device_asix,
  516. &bast_device_axpp,
  517. &bast_sio,
  518. };
  519. static struct clk *bast_clocks[] __initdata = {
  520. &s3c24xx_dclk0,
  521. &s3c24xx_dclk1,
  522. &s3c24xx_clkout0,
  523. &s3c24xx_clkout1,
  524. &s3c24xx_uclk,
  525. };
  526. static struct s3c_cpufreq_board __initdata bast_cpufreq = {
  527. .refresh = 7800, /* 7.8usec */
  528. .auto_io = 1,
  529. .need_io = 1,
  530. };
  531. static struct s3c24xx_audio_simtec_pdata __initdata bast_audio = {
  532. .have_mic = 1,
  533. .have_lout = 1,
  534. };
  535. static void __init bast_map_io(void)
  536. {
  537. /* initialise the clocks */
  538. s3c24xx_dclk0.parent = &clk_upll;
  539. s3c24xx_dclk0.rate = 12*1000*1000;
  540. s3c24xx_dclk1.parent = &clk_upll;
  541. s3c24xx_dclk1.rate = 24*1000*1000;
  542. s3c24xx_clkout0.parent = &s3c24xx_dclk0;
  543. s3c24xx_clkout1.parent = &s3c24xx_dclk1;
  544. s3c24xx_uclk.parent = &s3c24xx_clkout1;
  545. s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks));
  546. s3c_device_hwmon.dev.platform_data = &bast_hwmon_info;
  547. s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
  548. s3c24xx_init_clocks(0);
  549. s3c24xx_init_uarts(bast_uartcfgs, ARRAY_SIZE(bast_uartcfgs));
  550. }
  551. static void __init bast_init(void)
  552. {
  553. sysdev_class_register(&bast_pm_sysclass);
  554. sysdev_register(&bast_pm_sysdev);
  555. s3c_i2c0_set_platdata(&bast_i2c_info);
  556. s3c_nand_set_platdata(&bast_nand_info);
  557. s3c24xx_fb_set_platdata(&bast_fb_info);
  558. platform_add_devices(bast_devices, ARRAY_SIZE(bast_devices));
  559. i2c_register_board_info(0, bast_i2c_devs,
  560. ARRAY_SIZE(bast_i2c_devs));
  561. usb_simtec_init();
  562. nor_simtec_init();
  563. simtec_audio_add(NULL, true, &bast_audio);
  564. s3c_cpufreq_setboard(&bast_cpufreq);
  565. }
  566. MACHINE_START(BAST, "Simtec-BAST")
  567. /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
  568. .phys_io = S3C2410_PA_UART,
  569. .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
  570. .boot_params = S3C2410_SDRAM_PA + 0x100,
  571. .map_io = bast_map_io,
  572. .init_irq = s3c24xx_init_irq,
  573. .init_machine = bast_init,
  574. .timer = &s3c24xx_timer,
  575. MACHINE_END