mach-origen.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /* linux/arch/arm/mach-exynos4/mach-origen.c
  2. *
  3. * Copyright (c) 2011 Insignal Co., Ltd.
  4. * http://www.insignal.co.kr/
  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 <linux/io.h>
  15. #include <linux/input.h>
  16. #include <asm/mach/arch.h>
  17. #include <asm/mach-types.h>
  18. #include <plat/regs-serial.h>
  19. #include <plat/exynos4.h>
  20. #include <plat/cpu.h>
  21. #include <plat/devs.h>
  22. #include <plat/sdhci.h>
  23. #include <plat/iic.h>
  24. #include <mach/map.h>
  25. /* Following are default values for UCON, ULCON and UFCON UART registers */
  26. #define ORIGEN_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
  27. S3C2410_UCON_RXILEVEL | \
  28. S3C2410_UCON_TXIRQMODE | \
  29. S3C2410_UCON_RXIRQMODE | \
  30. S3C2410_UCON_RXFIFO_TOI | \
  31. S3C2443_UCON_RXERR_IRQEN)
  32. #define ORIGEN_ULCON_DEFAULT S3C2410_LCON_CS8
  33. #define ORIGEN_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
  34. S5PV210_UFCON_TXTRIG4 | \
  35. S5PV210_UFCON_RXTRIG4)
  36. static struct s3c2410_uartcfg origen_uartcfgs[] __initdata = {
  37. [0] = {
  38. .hwport = 0,
  39. .flags = 0,
  40. .ucon = ORIGEN_UCON_DEFAULT,
  41. .ulcon = ORIGEN_ULCON_DEFAULT,
  42. .ufcon = ORIGEN_UFCON_DEFAULT,
  43. },
  44. [1] = {
  45. .hwport = 1,
  46. .flags = 0,
  47. .ucon = ORIGEN_UCON_DEFAULT,
  48. .ulcon = ORIGEN_ULCON_DEFAULT,
  49. .ufcon = ORIGEN_UFCON_DEFAULT,
  50. },
  51. [2] = {
  52. .hwport = 2,
  53. .flags = 0,
  54. .ucon = ORIGEN_UCON_DEFAULT,
  55. .ulcon = ORIGEN_ULCON_DEFAULT,
  56. .ufcon = ORIGEN_UFCON_DEFAULT,
  57. },
  58. [3] = {
  59. .hwport = 3,
  60. .flags = 0,
  61. .ucon = ORIGEN_UCON_DEFAULT,
  62. .ulcon = ORIGEN_ULCON_DEFAULT,
  63. .ufcon = ORIGEN_UFCON_DEFAULT,
  64. },
  65. };
  66. static struct s3c_sdhci_platdata origen_hsmmc2_pdata __initdata = {
  67. .cd_type = S3C_SDHCI_CD_GPIO,
  68. .ext_cd_gpio = EXYNOS4_GPK2(2),
  69. .ext_cd_gpio_invert = 1,
  70. .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
  71. };
  72. static struct platform_device *origen_devices[] __initdata = {
  73. &s3c_device_hsmmc2,
  74. &s3c_device_rtc,
  75. &s3c_device_wdt,
  76. };
  77. static void __init origen_map_io(void)
  78. {
  79. s5p_init_io(NULL, 0, S5P_VA_CHIPID);
  80. s3c24xx_init_clocks(24000000);
  81. s3c24xx_init_uarts(origen_uartcfgs, ARRAY_SIZE(origen_uartcfgs));
  82. }
  83. static void __init origen_machine_init(void)
  84. {
  85. s3c_sdhci2_set_platdata(&origen_hsmmc2_pdata);
  86. platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices));
  87. }
  88. MACHINE_START(ORIGEN, "ORIGEN")
  89. /* Maintainer: JeongHyeon Kim <jhkim@insignal.co.kr> */
  90. .atag_offset = 0x100,
  91. .init_irq = exynos4_init_irq,
  92. .map_io = origen_map_io,
  93. .init_machine = origen_machine_init,
  94. .timer = &exynos4_timer,
  95. MACHINE_END