mach-smdk6440.c 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /* linux/arch/arm/mach-s5p64x0/mach-smdk6440.c
  2. *
  3. * Copyright (c) 2009-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 <asm/mach/arch.h>
  25. #include <asm/mach/map.h>
  26. #include <asm/irq.h>
  27. #include <asm/mach-types.h>
  28. #include <mach/hardware.h>
  29. #include <mach/map.h>
  30. #include <mach/regs-clock.h>
  31. #include <mach/i2c.h>
  32. #include <plat/regs-serial.h>
  33. #include <plat/gpio-cfg.h>
  34. #include <plat/s5p6440.h>
  35. #include <plat/clock.h>
  36. #include <plat/devs.h>
  37. #include <plat/cpu.h>
  38. #include <plat/iic.h>
  39. #include <plat/pll.h>
  40. #include <plat/adc.h>
  41. #include <plat/ts.h>
  42. #define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
  43. S3C2410_UCON_RXILEVEL | \
  44. S3C2410_UCON_TXIRQMODE | \
  45. S3C2410_UCON_RXIRQMODE | \
  46. S3C2410_UCON_RXFIFO_TOI | \
  47. S3C2443_UCON_RXERR_IRQEN)
  48. #define SMDK6440_ULCON_DEFAULT S3C2410_LCON_CS8
  49. #define SMDK6440_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
  50. S3C2440_UFCON_TXTRIG16 | \
  51. S3C2410_UFCON_RXTRIG8)
  52. static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = {
  53. [0] = {
  54. .hwport = 0,
  55. .flags = 0,
  56. .ucon = SMDK6440_UCON_DEFAULT,
  57. .ulcon = SMDK6440_ULCON_DEFAULT,
  58. .ufcon = SMDK6440_UFCON_DEFAULT,
  59. },
  60. [1] = {
  61. .hwport = 1,
  62. .flags = 0,
  63. .ucon = SMDK6440_UCON_DEFAULT,
  64. .ulcon = SMDK6440_ULCON_DEFAULT,
  65. .ufcon = SMDK6440_UFCON_DEFAULT,
  66. },
  67. [2] = {
  68. .hwport = 2,
  69. .flags = 0,
  70. .ucon = SMDK6440_UCON_DEFAULT,
  71. .ulcon = SMDK6440_ULCON_DEFAULT,
  72. .ufcon = SMDK6440_UFCON_DEFAULT,
  73. },
  74. [3] = {
  75. .hwport = 3,
  76. .flags = 0,
  77. .ucon = SMDK6440_UCON_DEFAULT,
  78. .ulcon = SMDK6440_ULCON_DEFAULT,
  79. .ufcon = SMDK6440_UFCON_DEFAULT,
  80. },
  81. };
  82. static struct platform_device *smdk6440_devices[] __initdata = {
  83. &s3c_device_adc,
  84. &s3c_device_rtc,
  85. &s3c_device_i2c0,
  86. &s3c_device_i2c1,
  87. &s3c_device_ts,
  88. &s3c_device_wdt,
  89. &s5p6440_device_iis,
  90. };
  91. static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = {
  92. .flags = 0,
  93. .slave_addr = 0x10,
  94. .frequency = 100*1000,
  95. .sda_delay = 100,
  96. .cfg_gpio = s5p6440_i2c0_cfg_gpio,
  97. };
  98. static struct s3c2410_platform_i2c s5p6440_i2c1_data __initdata = {
  99. .flags = 0,
  100. .bus_num = 1,
  101. .slave_addr = 0x10,
  102. .frequency = 100*1000,
  103. .sda_delay = 100,
  104. .cfg_gpio = s5p6440_i2c1_cfg_gpio,
  105. };
  106. static struct i2c_board_info smdk6440_i2c_devs0[] __initdata = {
  107. { I2C_BOARD_INFO("24c08", 0x50), },
  108. };
  109. static struct i2c_board_info smdk6440_i2c_devs1[] __initdata = {
  110. /* To be populated */
  111. };
  112. static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
  113. .delay = 10000,
  114. .presc = 49,
  115. .oversampling_shift = 2,
  116. };
  117. static void __init smdk6440_map_io(void)
  118. {
  119. s5p_init_io(NULL, 0, S5P64X0_SYS_ID);
  120. s3c24xx_init_clocks(12000000);
  121. s3c24xx_init_uarts(smdk6440_uartcfgs, ARRAY_SIZE(smdk6440_uartcfgs));
  122. }
  123. static void __init smdk6440_machine_init(void)
  124. {
  125. s3c24xx_ts_set_platdata(&s3c_ts_platform);
  126. s3c_i2c0_set_platdata(&s5p6440_i2c0_data);
  127. s3c_i2c1_set_platdata(&s5p6440_i2c1_data);
  128. i2c_register_board_info(0, smdk6440_i2c_devs0,
  129. ARRAY_SIZE(smdk6440_i2c_devs0));
  130. i2c_register_board_info(1, smdk6440_i2c_devs1,
  131. ARRAY_SIZE(smdk6440_i2c_devs1));
  132. platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices));
  133. }
  134. MACHINE_START(SMDK6440, "SMDK6440")
  135. /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
  136. .boot_params = S5P64X0_PA_SDRAM + 0x100,
  137. .init_irq = s5p6440_init_irq,
  138. .map_io = smdk6440_map_io,
  139. .init_machine = smdk6440_machine_init,
  140. .timer = &s3c24xx_timer,
  141. MACHINE_END