mach-smdk6450.c 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. /* linux/arch/arm/mach-s5p64x0/mach-smdk6450.c
  2. *
  3. * Copyright (c) 2010 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com
  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 version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/types.h>
  12. #include <linux/interrupt.h>
  13. #include <linux/list.h>
  14. #include <linux/timer.h>
  15. #include <linux/delay.h>
  16. #include <linux/init.h>
  17. #include <linux/i2c.h>
  18. #include <linux/serial_core.h>
  19. #include <linux/platform_device.h>
  20. #include <linux/io.h>
  21. #include <linux/module.h>
  22. #include <linux/clk.h>
  23. #include <linux/gpio.h>
  24. #include <linux/pwm_backlight.h>
  25. #include <asm/mach/arch.h>
  26. #include <asm/mach/map.h>
  27. #include <asm/irq.h>
  28. #include <asm/mach-types.h>
  29. #include <mach/hardware.h>
  30. #include <mach/map.h>
  31. #include <mach/regs-clock.h>
  32. #include <mach/i2c.h>
  33. #include <mach/regs-gpio.h>
  34. #include <plat/regs-serial.h>
  35. #include <plat/gpio-cfg.h>
  36. #include <plat/s5p6450.h>
  37. #include <plat/clock.h>
  38. #include <plat/devs.h>
  39. #include <plat/cpu.h>
  40. #include <plat/iic.h>
  41. #include <plat/pll.h>
  42. #include <plat/adc.h>
  43. #include <plat/ts.h>
  44. #include <plat/s5p-time.h>
  45. #include <plat/backlight.h>
  46. #define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
  47. S3C2410_UCON_RXILEVEL | \
  48. S3C2410_UCON_TXIRQMODE | \
  49. S3C2410_UCON_RXIRQMODE | \
  50. S3C2410_UCON_RXFIFO_TOI | \
  51. S3C2443_UCON_RXERR_IRQEN)
  52. #define SMDK6450_ULCON_DEFAULT S3C2410_LCON_CS8
  53. #define SMDK6450_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
  54. S3C2440_UFCON_TXTRIG16 | \
  55. S3C2410_UFCON_RXTRIG8)
  56. static struct s3c2410_uartcfg smdk6450_uartcfgs[] __initdata = {
  57. [0] = {
  58. .hwport = 0,
  59. .flags = 0,
  60. .ucon = SMDK6450_UCON_DEFAULT,
  61. .ulcon = SMDK6450_ULCON_DEFAULT,
  62. .ufcon = SMDK6450_UFCON_DEFAULT,
  63. },
  64. [1] = {
  65. .hwport = 1,
  66. .flags = 0,
  67. .ucon = SMDK6450_UCON_DEFAULT,
  68. .ulcon = SMDK6450_ULCON_DEFAULT,
  69. .ufcon = SMDK6450_UFCON_DEFAULT,
  70. },
  71. [2] = {
  72. .hwport = 2,
  73. .flags = 0,
  74. .ucon = SMDK6450_UCON_DEFAULT,
  75. .ulcon = SMDK6450_ULCON_DEFAULT,
  76. .ufcon = SMDK6450_UFCON_DEFAULT,
  77. },
  78. [3] = {
  79. .hwport = 3,
  80. .flags = 0,
  81. .ucon = SMDK6450_UCON_DEFAULT,
  82. .ulcon = SMDK6450_ULCON_DEFAULT,
  83. .ufcon = SMDK6450_UFCON_DEFAULT,
  84. },
  85. #if CONFIG_SERIAL_SAMSUNG_UARTS > 4
  86. [4] = {
  87. .hwport = 4,
  88. .flags = 0,
  89. .ucon = SMDK6450_UCON_DEFAULT,
  90. .ulcon = SMDK6450_ULCON_DEFAULT,
  91. .ufcon = SMDK6450_UFCON_DEFAULT,
  92. },
  93. #endif
  94. #if CONFIG_SERIAL_SAMSUNG_UARTS > 5
  95. [5] = {
  96. .hwport = 5,
  97. .flags = 0,
  98. .ucon = SMDK6450_UCON_DEFAULT,
  99. .ulcon = SMDK6450_ULCON_DEFAULT,
  100. .ufcon = SMDK6450_UFCON_DEFAULT,
  101. },
  102. #endif
  103. };
  104. static struct platform_device *smdk6450_devices[] __initdata = {
  105. &s3c_device_adc,
  106. &s3c_device_rtc,
  107. &s3c_device_i2c0,
  108. &s3c_device_i2c1,
  109. &s3c_device_ts,
  110. &s3c_device_wdt,
  111. &samsung_asoc_dma,
  112. &s5p6450_device_iis0,
  113. /* s5p6450_device_spi0 will be added */
  114. };
  115. static struct s3c2410_platform_i2c s5p6450_i2c0_data __initdata = {
  116. .flags = 0,
  117. .slave_addr = 0x10,
  118. .frequency = 100*1000,
  119. .sda_delay = 100,
  120. .cfg_gpio = s5p6450_i2c0_cfg_gpio,
  121. };
  122. static struct s3c2410_platform_i2c s5p6450_i2c1_data __initdata = {
  123. .flags = 0,
  124. .bus_num = 1,
  125. .slave_addr = 0x10,
  126. .frequency = 100*1000,
  127. .sda_delay = 100,
  128. .cfg_gpio = s5p6450_i2c1_cfg_gpio,
  129. };
  130. static struct i2c_board_info smdk6450_i2c_devs0[] __initdata = {
  131. { I2C_BOARD_INFO("wm8580", 0x1b), },
  132. { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung KS24C080C EEPROM */
  133. };
  134. static struct i2c_board_info smdk6450_i2c_devs1[] __initdata = {
  135. { I2C_BOARD_INFO("24c128", 0x57), },/* Samsung S524AD0XD1 EEPROM */
  136. };
  137. /* LCD Backlight data */
  138. static struct samsung_bl_gpio_info smdk6450_bl_gpio_info = {
  139. .no = S5P6450_GPF(15),
  140. .func = S3C_GPIO_SFN(2),
  141. };
  142. static struct platform_pwm_backlight_data smdk6450_bl_data = {
  143. .pwm_id = 1,
  144. };
  145. static void __init smdk6450_map_io(void)
  146. {
  147. s5p_init_io(NULL, 0, S5P64X0_SYS_ID);
  148. s3c24xx_init_clocks(19200000);
  149. s3c24xx_init_uarts(smdk6450_uartcfgs, ARRAY_SIZE(smdk6450_uartcfgs));
  150. s5p_set_timer_source(S5P_PWM3, S5P_PWM4);
  151. }
  152. static void __init smdk6450_machine_init(void)
  153. {
  154. s3c24xx_ts_set_platdata(NULL);
  155. s3c_i2c0_set_platdata(&s5p6450_i2c0_data);
  156. s3c_i2c1_set_platdata(&s5p6450_i2c1_data);
  157. i2c_register_board_info(0, smdk6450_i2c_devs0,
  158. ARRAY_SIZE(smdk6450_i2c_devs0));
  159. i2c_register_board_info(1, smdk6450_i2c_devs1,
  160. ARRAY_SIZE(smdk6450_i2c_devs1));
  161. samsung_bl_set(&smdk6450_bl_gpio_info, &smdk6450_bl_data);
  162. platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices));
  163. }
  164. MACHINE_START(SMDK6450, "SMDK6450")
  165. /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
  166. .boot_params = S5P64X0_PA_SDRAM + 0x100,
  167. .init_irq = s5p6450_init_irq,
  168. .map_io = smdk6450_map_io,
  169. .init_machine = smdk6450_machine_init,
  170. .timer = &s5p_timer,
  171. MACHINE_END