mach-smdkv310.c 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /* linux/arch/arm/mach-s5pv310/mach-smdkv310.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/serial_core.h>
  11. #include <linux/gpio.h>
  12. #include <linux/mmc/host.h>
  13. #include <linux/platform_device.h>
  14. #include <asm/mach/arch.h>
  15. #include <asm/mach-types.h>
  16. #include <asm/hardware/cache-l2x0.h>
  17. #include <plat/regs-serial.h>
  18. #include <plat/s5pv310.h>
  19. #include <plat/cpu.h>
  20. #include <plat/devs.h>
  21. #include <plat/sdhci.h>
  22. #include <mach/map.h>
  23. /* Following are default values for UCON, ULCON and UFCON UART registers */
  24. #define SMDKV310_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
  25. S3C2410_UCON_RXILEVEL | \
  26. S3C2410_UCON_TXIRQMODE | \
  27. S3C2410_UCON_RXIRQMODE | \
  28. S3C2410_UCON_RXFIFO_TOI | \
  29. S3C2443_UCON_RXERR_IRQEN)
  30. #define SMDKV310_ULCON_DEFAULT S3C2410_LCON_CS8
  31. #define SMDKV310_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
  32. S5PV210_UFCON_TXTRIG4 | \
  33. S5PV210_UFCON_RXTRIG4)
  34. static struct s3c2410_uartcfg smdkv310_uartcfgs[] __initdata = {
  35. [0] = {
  36. .hwport = 0,
  37. .flags = 0,
  38. .ucon = SMDKV310_UCON_DEFAULT,
  39. .ulcon = SMDKV310_ULCON_DEFAULT,
  40. .ufcon = SMDKV310_UFCON_DEFAULT,
  41. },
  42. [1] = {
  43. .hwport = 1,
  44. .flags = 0,
  45. .ucon = SMDKV310_UCON_DEFAULT,
  46. .ulcon = SMDKV310_ULCON_DEFAULT,
  47. .ufcon = SMDKV310_UFCON_DEFAULT,
  48. },
  49. [2] = {
  50. .hwport = 2,
  51. .flags = 0,
  52. .ucon = SMDKV310_UCON_DEFAULT,
  53. .ulcon = SMDKV310_ULCON_DEFAULT,
  54. .ufcon = SMDKV310_UFCON_DEFAULT,
  55. },
  56. [3] = {
  57. .hwport = 3,
  58. .flags = 0,
  59. .ucon = SMDKV310_UCON_DEFAULT,
  60. .ulcon = SMDKV310_ULCON_DEFAULT,
  61. .ufcon = SMDKV310_UFCON_DEFAULT,
  62. },
  63. };
  64. static struct s3c_sdhci_platdata smdkv310_hsmmc0_pdata __initdata = {
  65. .cd_type = S3C_SDHCI_CD_GPIO,
  66. .ext_cd_gpio = S5PV310_GPK0(2),
  67. .ext_cd_gpio_invert = 1,
  68. #ifdef CONFIG_S5PV310_SDHCI_CH0_8BIT
  69. .max_width = 8,
  70. .host_caps = MMC_CAP_8_BIT_DATA,
  71. #endif
  72. };
  73. static struct s3c_sdhci_platdata smdkv310_hsmmc1_pdata __initdata = {
  74. .cd_type = S3C_SDHCI_CD_GPIO,
  75. .ext_cd_gpio = S5PV310_GPK0(2),
  76. .ext_cd_gpio_invert = 1,
  77. };
  78. static struct s3c_sdhci_platdata smdkv310_hsmmc2_pdata __initdata = {
  79. .cd_type = S3C_SDHCI_CD_GPIO,
  80. .ext_cd_gpio = S5PV310_GPK2(2),
  81. .ext_cd_gpio_invert = 1,
  82. #ifdef CONFIG_S5PV310_SDHCI_CH2_8BIT
  83. .max_width = 8,
  84. .host_caps = MMC_CAP_8_BIT_DATA,
  85. #endif
  86. };
  87. static struct s3c_sdhci_platdata smdkv310_hsmmc3_pdata __initdata = {
  88. .cd_type = S3C_SDHCI_CD_GPIO,
  89. .ext_cd_gpio = S5PV310_GPK2(2),
  90. .ext_cd_gpio_invert = 1,
  91. };
  92. static struct platform_device *smdkv310_devices[] __initdata = {
  93. &s3c_device_hsmmc0,
  94. &s3c_device_hsmmc1,
  95. &s3c_device_hsmmc2,
  96. &s3c_device_hsmmc3,
  97. &s3c_device_rtc,
  98. &s3c_device_wdt,
  99. };
  100. static void __init smdkv310_map_io(void)
  101. {
  102. s5p_init_io(NULL, 0, S5P_VA_CHIPID);
  103. s3c24xx_init_clocks(24000000);
  104. s3c24xx_init_uarts(smdkv310_uartcfgs, ARRAY_SIZE(smdkv310_uartcfgs));
  105. }
  106. static void __init smdkv310_machine_init(void)
  107. {
  108. s3c_sdhci0_set_platdata(&smdkv310_hsmmc0_pdata);
  109. s3c_sdhci1_set_platdata(&smdkv310_hsmmc1_pdata);
  110. s3c_sdhci2_set_platdata(&smdkv310_hsmmc2_pdata);
  111. s3c_sdhci3_set_platdata(&smdkv310_hsmmc3_pdata);
  112. #ifdef CONFIG_CACHE_L2X0
  113. l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff);
  114. #endif
  115. platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices));
  116. }
  117. MACHINE_START(SMDKV310, "SMDKV310")
  118. /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
  119. /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
  120. .phys_io = S3C_PA_UART & 0xfff00000,
  121. .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
  122. .boot_params = S5P_PA_SDRAM + 0x100,
  123. .init_irq = s5pv310_init_irq,
  124. .map_io = smdkv310_map_io,
  125. .init_machine = smdkv310_machine_init,
  126. .timer = &s5pv310_timer,
  127. MACHINE_END