mach-smdkv210.c 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /* linux/arch/arm/mach-s5pv210/mach-smdkv210.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/init.h>
  13. #include <linux/serial_core.h>
  14. #include <asm/mach/arch.h>
  15. #include <asm/mach/map.h>
  16. #include <asm/setup.h>
  17. #include <asm/mach-types.h>
  18. #include <mach/map.h>
  19. #include <mach/regs-clock.h>
  20. #include <plat/regs-serial.h>
  21. #include <plat/s5pv210.h>
  22. #include <plat/devs.h>
  23. #include <plat/cpu.h>
  24. #include <plat/adc.h>
  25. #include <plat/ts.h>
  26. #include <plat/ata.h>
  27. #include <plat/keypad.h>
  28. /* Following are default values for UCON, ULCON and UFCON UART registers */
  29. #define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
  30. S3C2410_UCON_RXILEVEL | \
  31. S3C2410_UCON_TXIRQMODE | \
  32. S3C2410_UCON_RXIRQMODE | \
  33. S3C2410_UCON_RXFIFO_TOI | \
  34. S3C2443_UCON_RXERR_IRQEN)
  35. #define S5PV210_ULCON_DEFAULT S3C2410_LCON_CS8
  36. #define S5PV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
  37. S5PV210_UFCON_TXTRIG4 | \
  38. S5PV210_UFCON_RXTRIG4)
  39. static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
  40. [0] = {
  41. .hwport = 0,
  42. .flags = 0,
  43. .ucon = S5PV210_UCON_DEFAULT,
  44. .ulcon = S5PV210_ULCON_DEFAULT,
  45. .ufcon = S5PV210_UFCON_DEFAULT,
  46. },
  47. [1] = {
  48. .hwport = 1,
  49. .flags = 0,
  50. .ucon = S5PV210_UCON_DEFAULT,
  51. .ulcon = S5PV210_ULCON_DEFAULT,
  52. .ufcon = S5PV210_UFCON_DEFAULT,
  53. },
  54. [2] = {
  55. .hwport = 2,
  56. .flags = 0,
  57. .ucon = S5PV210_UCON_DEFAULT,
  58. .ulcon = S5PV210_ULCON_DEFAULT,
  59. .ufcon = S5PV210_UFCON_DEFAULT,
  60. },
  61. [3] = {
  62. .hwport = 3,
  63. .flags = 0,
  64. .ucon = S5PV210_UCON_DEFAULT,
  65. .ulcon = S5PV210_ULCON_DEFAULT,
  66. .ufcon = S5PV210_UFCON_DEFAULT,
  67. },
  68. };
  69. static struct s3c_ide_platdata smdkv210_ide_pdata __initdata = {
  70. .setup_gpio = s5pv210_ide_setup_gpio,
  71. };
  72. static uint32_t smdkv210_keymap[] __initdata = {
  73. /* KEY(row, col, keycode) */
  74. KEY(0, 3, KEY_1), KEY(0, 4, KEY_2), KEY(0, 5, KEY_3),
  75. KEY(0, 6, KEY_4), KEY(0, 7, KEY_5),
  76. KEY(1, 3, KEY_A), KEY(1, 4, KEY_B), KEY(1, 5, KEY_C),
  77. KEY(1, 6, KEY_D), KEY(1, 7, KEY_E)
  78. };
  79. static struct matrix_keymap_data smdkv210_keymap_data __initdata = {
  80. .keymap = smdkv210_keymap,
  81. .keymap_size = ARRAY_SIZE(smdkv210_keymap),
  82. };
  83. static struct samsung_keypad_platdata smdkv210_keypad_data __initdata = {
  84. .keymap_data = &smdkv210_keymap_data,
  85. .rows = 8,
  86. .cols = 8,
  87. };
  88. static struct platform_device *smdkv210_devices[] __initdata = {
  89. &s5pv210_device_iis0,
  90. &s5pv210_device_ac97,
  91. &s3c_device_adc,
  92. &s3c_device_cfcon,
  93. &samsung_device_keypad,
  94. &s3c_device_ts,
  95. &s3c_device_wdt,
  96. };
  97. static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
  98. .delay = 10000,
  99. .presc = 49,
  100. .oversampling_shift = 2,
  101. };
  102. static void __init smdkv210_map_io(void)
  103. {
  104. s5p_init_io(NULL, 0, S5P_VA_CHIPID);
  105. s3c24xx_init_clocks(24000000);
  106. s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
  107. }
  108. static void __init smdkv210_machine_init(void)
  109. {
  110. samsung_keypad_set_platdata(&smdkv210_keypad_data);
  111. s3c24xx_ts_set_platdata(&s3c_ts_platform);
  112. s3c_ide_set_platdata(&smdkv210_ide_pdata);
  113. platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices));
  114. }
  115. MACHINE_START(SMDKV210, "SMDKV210")
  116. /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
  117. .phys_io = S3C_PA_UART & 0xfff00000,
  118. .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
  119. .boot_params = S5P_PA_SDRAM + 0x100,
  120. .init_irq = s5pv210_init_irq,
  121. .map_io = smdkv210_map_io,
  122. .init_machine = smdkv210_machine_init,
  123. .timer = &s3c24xx_timer,
  124. MACHINE_END