mach-bast.c 15 KB

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