mach-bast.c 16 KB

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