mach-smdkv310.c 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
  69. #ifdef CONFIG_S5PV310_SDHCI_CH0_8BIT
  70. .max_width = 8,
  71. .host_caps = MMC_CAP_8_BIT_DATA,
  72. #endif
  73. };
  74. static struct s3c_sdhci_platdata smdkv310_hsmmc1_pdata __initdata = {
  75. .cd_type = S3C_SDHCI_CD_GPIO,
  76. .ext_cd_gpio = S5PV310_GPK0(2),
  77. .ext_cd_gpio_invert = 1,
  78. .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
  79. };
  80. static struct s3c_sdhci_platdata smdkv310_hsmmc2_pdata __initdata = {
  81. .cd_type = S3C_SDHCI_CD_GPIO,
  82. .ext_cd_gpio = S5PV310_GPK2(2),
  83. .ext_cd_gpio_invert = 1,
  84. .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
  85. #ifdef CONFIG_S5PV310_SDHCI_CH2_8BIT
  86. .max_width = 8,
  87. .host_caps = MMC_CAP_8_BIT_DATA,
  88. #endif
  89. };
  90. static struct s3c_sdhci_platdata smdkv310_hsmmc3_pdata __initdata = {
  91. .cd_type = S3C_SDHCI_CD_GPIO,
  92. .ext_cd_gpio = S5PV310_GPK2(2),
  93. .ext_cd_gpio_invert = 1,
  94. .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
  95. };
  96. static struct platform_device *smdkv310_devices[] __initdata = {
  97. &s3c_device_hsmmc0,
  98. &s3c_device_hsmmc1,
  99. &s3c_device_hsmmc2,
  100. &s3c_device_hsmmc3,
  101. &s3c_device_rtc,
  102. &s3c_device_wdt,
  103. };
  104. static void __init smdkv310_map_io(void)
  105. {
  106. s5p_init_io(NULL, 0, S5P_VA_CHIPID);
  107. s3c24xx_init_clocks(24000000);
  108. s3c24xx_init_uarts(smdkv310_uartcfgs, ARRAY_SIZE(smdkv310_uartcfgs));
  109. }
  110. static void __init smdkv310_machine_init(void)
  111. {
  112. s3c_sdhci0_set_platdata(&smdkv310_hsmmc0_pdata);
  113. s3c_sdhci1_set_platdata(&smdkv310_hsmmc1_pdata);
  114. s3c_sdhci2_set_platdata(&smdkv310_hsmmc2_pdata);
  115. s3c_sdhci3_set_platdata(&smdkv310_hsmmc3_pdata);
  116. #ifdef CONFIG_CACHE_L2X0
  117. l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff);
  118. #endif
  119. platform_add_devices(smdkv310_devices, ARRAY_SIZE(smdkv310_devices));
  120. }
  121. MACHINE_START(SMDKV310, "SMDKV310")
  122. /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
  123. /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
  124. .phys_io = S3C_PA_UART & 0xfff00000,
  125. .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
  126. .boot_params = S5P_PA_SDRAM + 0x100,
  127. .init_irq = s5pv310_init_irq,
  128. .map_io = smdkv310_map_io,
  129. .init_machine = smdkv310_machine_init,
  130. .timer = &s5pv310_timer,
  131. MACHINE_END