mach-smdk2443.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. // SPDX-License-Identifier: GPL-2.0
  2. //
  3. // Copyright (c) 2007 Simtec Electronics
  4. // Ben Dooks <ben@simtec.co.uk>
  5. //
  6. // http://www.fluff.org/ben/smdk2443/
  7. //
  8. // Thanks to Samsung for the loan of an SMDK2443
  9. #include <linux/kernel.h>
  10. #include <linux/types.h>
  11. #include <linux/interrupt.h>
  12. #include <linux/list.h>
  13. #include <linux/timer.h>
  14. #include <linux/init.h>
  15. #include <linux/serial_core.h>
  16. #include <linux/serial_s3c.h>
  17. #include <linux/platform_device.h>
  18. #include <linux/io.h>
  19. #include <asm/mach/arch.h>
  20. #include <asm/mach/map.h>
  21. #include <asm/mach/irq.h>
  22. #include <mach/hardware.h>
  23. #include <asm/irq.h>
  24. #include <asm/mach-types.h>
  25. #include <mach/regs-gpio.h>
  26. #include <mach/regs-lcd.h>
  27. #include <mach/fb.h>
  28. #include <linux/platform_data/i2c-s3c2410.h>
  29. #include <plat/devs.h>
  30. #include <plat/cpu.h>
  31. #include <plat/samsung-time.h>
  32. #include "common.h"
  33. #include "common-smdk.h"
  34. static struct map_desc smdk2443_iodesc[] __initdata = {
  35. /* ISA IO Space map (memory space selected by A24) */
  36. {
  37. .virtual = (u32)S3C24XX_VA_ISA_WORD,
  38. .pfn = __phys_to_pfn(S3C2410_CS2),
  39. .length = 0x10000,
  40. .type = MT_DEVICE,
  41. }, {
  42. .virtual = (u32)S3C24XX_VA_ISA_WORD + 0x10000,
  43. .pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
  44. .length = SZ_4M,
  45. .type = MT_DEVICE,
  46. }, {
  47. .virtual = (u32)S3C24XX_VA_ISA_BYTE,
  48. .pfn = __phys_to_pfn(S3C2410_CS2),
  49. .length = 0x10000,
  50. .type = MT_DEVICE,
  51. }, {
  52. .virtual = (u32)S3C24XX_VA_ISA_BYTE + 0x10000,
  53. .pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
  54. .length = SZ_4M,
  55. .type = MT_DEVICE,
  56. }
  57. };
  58. #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
  59. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
  60. #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  61. static struct s3c2410_uartcfg smdk2443_uartcfgs[] __initdata = {
  62. [0] = {
  63. .hwport = 0,
  64. .flags = 0,
  65. .ucon = 0x3c5,
  66. .ulcon = 0x03,
  67. .ufcon = 0x51,
  68. },
  69. [1] = {
  70. .hwport = 1,
  71. .flags = 0,
  72. .ucon = 0x3c5,
  73. .ulcon = 0x03,
  74. .ufcon = 0x51,
  75. },
  76. /* IR port */
  77. [2] = {
  78. .hwport = 2,
  79. .flags = 0,
  80. .ucon = 0x3c5,
  81. .ulcon = 0x43,
  82. .ufcon = 0x51,
  83. },
  84. [3] = {
  85. .hwport = 3,
  86. .flags = 0,
  87. .ucon = 0x3c5,
  88. .ulcon = 0x03,
  89. .ufcon = 0x51,
  90. }
  91. };
  92. static struct platform_device *smdk2443_devices[] __initdata = {
  93. &s3c_device_wdt,
  94. &s3c_device_i2c0,
  95. &s3c_device_hsmmc1,
  96. &s3c2443_device_dma,
  97. };
  98. static void __init smdk2443_map_io(void)
  99. {
  100. s3c24xx_init_io(smdk2443_iodesc, ARRAY_SIZE(smdk2443_iodesc));
  101. s3c24xx_init_uarts(smdk2443_uartcfgs, ARRAY_SIZE(smdk2443_uartcfgs));
  102. samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
  103. }
  104. static void __init smdk2443_init_time(void)
  105. {
  106. s3c2443_init_clocks(12000000);
  107. samsung_timer_init();
  108. }
  109. static void __init smdk2443_machine_init(void)
  110. {
  111. s3c_i2c0_set_platdata(NULL);
  112. platform_add_devices(smdk2443_devices, ARRAY_SIZE(smdk2443_devices));
  113. smdk_machine_init();
  114. }
  115. MACHINE_START(SMDK2443, "SMDK2443")
  116. /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
  117. .atag_offset = 0x100,
  118. .init_irq = s3c2443_init_irq,
  119. .map_io = smdk2443_map_io,
  120. .init_machine = smdk2443_machine_init,
  121. .init_time = smdk2443_init_time,
  122. MACHINE_END