mach-smdk2443.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. // SPDX-License-Identifier: GPL-2.0
  2. //
  3. // Copyright (c) 2007 Simtec Electronics
  4. // Ben Dooks <[email protected]>
  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 <asm/irq.h>
  23. #include <asm/mach-types.h>
  24. #include "regs-gpio.h"
  25. #include <linux/platform_data/fb-s3c2410.h>
  26. #include <linux/platform_data/i2c-s3c2410.h>
  27. #include "devs.h"
  28. #include "cpu.h"
  29. #include "s3c24xx.h"
  30. #include "common-smdk-s3c24xx.h"
  31. static struct map_desc smdk2443_iodesc[] __initdata = {
  32. /* ISA IO Space map (memory space selected by A24) */
  33. {
  34. .virtual = (u32)S3C24XX_VA_ISA_BYTE,
  35. .pfn = __phys_to_pfn(S3C2410_CS2),
  36. .length = 0x10000,
  37. .type = MT_DEVICE,
  38. }, {
  39. .virtual = (u32)S3C24XX_VA_ISA_BYTE + 0x10000,
  40. .pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
  41. .length = SZ_4M,
  42. .type = MT_DEVICE,
  43. }
  44. };
  45. #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK
  46. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
  47. #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  48. static struct s3c2410_uartcfg smdk2443_uartcfgs[] __initdata = {
  49. [0] = {
  50. .hwport = 0,
  51. .flags = 0,
  52. .ucon = 0x3c5,
  53. .ulcon = 0x03,
  54. .ufcon = 0x51,
  55. },
  56. [1] = {
  57. .hwport = 1,
  58. .flags = 0,
  59. .ucon = 0x3c5,
  60. .ulcon = 0x03,
  61. .ufcon = 0x51,
  62. },
  63. /* IR port */
  64. [2] = {
  65. .hwport = 2,
  66. .flags = 0,
  67. .ucon = 0x3c5,
  68. .ulcon = 0x43,
  69. .ufcon = 0x51,
  70. },
  71. [3] = {
  72. .hwport = 3,
  73. .flags = 0,
  74. .ucon = 0x3c5,
  75. .ulcon = 0x03,
  76. .ufcon = 0x51,
  77. }
  78. };
  79. static struct platform_device *smdk2443_devices[] __initdata = {
  80. &s3c_device_wdt,
  81. &s3c_device_i2c0,
  82. &s3c_device_hsmmc1,
  83. &s3c2443_device_dma,
  84. };
  85. static void __init smdk2443_map_io(void)
  86. {
  87. s3c24xx_init_io(smdk2443_iodesc, ARRAY_SIZE(smdk2443_iodesc));
  88. s3c24xx_init_uarts(smdk2443_uartcfgs, ARRAY_SIZE(smdk2443_uartcfgs));
  89. s3c24xx_set_timer_source(S3C24XX_PWM3, S3C24XX_PWM4);
  90. }
  91. static void __init smdk2443_init_time(void)
  92. {
  93. s3c2443_init_clocks(12000000);
  94. s3c24xx_timer_init();
  95. }
  96. static void __init smdk2443_machine_init(void)
  97. {
  98. s3c_i2c0_set_platdata(NULL);
  99. platform_add_devices(smdk2443_devices, ARRAY_SIZE(smdk2443_devices));
  100. smdk_machine_init();
  101. }
  102. MACHINE_START(SMDK2443, "SMDK2443")
  103. /* Maintainer: Ben Dooks <[email protected]> */
  104. .atag_offset = 0x100,
  105. .nr_irqs = NR_IRQS_S3C2443,
  106. .init_irq = s3c2443_init_irq,
  107. .map_io = smdk2443_map_io,
  108. .init_machine = smdk2443_machine_init,
  109. .init_time = smdk2443_init_time,
  110. MACHINE_END