mach-smdk6440.c 3.6 KB

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