mach-otom.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. // SPDX-License-Identifier: GPL-2.0
  2. //
  3. // Copyright (c) 2004 Nex Vision
  4. // Guillaume GOURAT <[email protected]>
  5. #include <linux/kernel.h>
  6. #include <linux/types.h>
  7. #include <linux/interrupt.h>
  8. #include <linux/list.h>
  9. #include <linux/timer.h>
  10. #include <linux/init.h>
  11. #include <linux/serial_core.h>
  12. #include <linux/serial_s3c.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/io.h>
  15. #include <linux/platform_data/i2c-s3c2410.h>
  16. #include <asm/irq.h>
  17. #include <asm/mach-types.h>
  18. #include <asm/mach/arch.h>
  19. #include <asm/mach/map.h>
  20. #include <asm/mach/irq.h>
  21. #include "gpio-samsung.h"
  22. #include "gpio-cfg.h"
  23. #include "cpu.h"
  24. #include "devs.h"
  25. #include "s3c24xx.h"
  26. #include "otom.h"
  27. static struct map_desc otom11_iodesc[] __initdata = {
  28. /* Device area */
  29. { (u32)OTOM_VA_CS8900A_BASE, OTOM_PA_CS8900A_BASE, SZ_16M, MT_DEVICE },
  30. };
  31. #define UCON S3C2410_UCON_DEFAULT
  32. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
  33. #define UFCON S3C2410_UFCON_RXTRIG12 | S3C2410_UFCON_FIFOMODE
  34. static struct s3c2410_uartcfg otom11_uartcfgs[] __initdata = {
  35. [0] = {
  36. .hwport = 0,
  37. .flags = 0,
  38. .ucon = UCON,
  39. .ulcon = ULCON,
  40. .ufcon = UFCON,
  41. },
  42. [1] = {
  43. .hwport = 1,
  44. .flags = 0,
  45. .ucon = UCON,
  46. .ulcon = ULCON,
  47. .ufcon = UFCON,
  48. },
  49. /* port 2 is not actually used */
  50. [2] = {
  51. .hwport = 2,
  52. .flags = 0,
  53. .ucon = UCON,
  54. .ulcon = ULCON,
  55. .ufcon = UFCON,
  56. }
  57. };
  58. /* NOR Flash on NexVision OTOM board */
  59. static struct resource otom_nor_resource[] = {
  60. [0] = DEFINE_RES_MEM(S3C2410_CS0, SZ_4M),
  61. };
  62. static struct platform_device otom_device_nor = {
  63. .name = "mtd-flash",
  64. .id = -1,
  65. .num_resources = ARRAY_SIZE(otom_nor_resource),
  66. .resource = otom_nor_resource,
  67. };
  68. /* Standard OTOM devices */
  69. static struct platform_device *otom11_devices[] __initdata = {
  70. &s3c_device_ohci,
  71. &s3c_device_lcd,
  72. &s3c_device_wdt,
  73. &s3c_device_i2c0,
  74. &s3c_device_iis,
  75. &s3c_device_rtc,
  76. &otom_device_nor,
  77. };
  78. static void __init otom11_map_io(void)
  79. {
  80. s3c24xx_init_io(otom11_iodesc, ARRAY_SIZE(otom11_iodesc));
  81. s3c24xx_init_uarts(otom11_uartcfgs, ARRAY_SIZE(otom11_uartcfgs));
  82. s3c24xx_set_timer_source(S3C24XX_PWM3, S3C24XX_PWM4);
  83. }
  84. static void __init otom11_init_time(void)
  85. {
  86. s3c2410_init_clocks(12000000);
  87. s3c24xx_timer_init();
  88. }
  89. static void __init otom11_init(void)
  90. {
  91. s3c_i2c0_set_platdata(NULL);
  92. /* Configure the I2S pins (GPE0...GPE4) in correct mode */
  93. s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2),
  94. S3C_GPIO_PULL_NONE);
  95. platform_add_devices(otom11_devices, ARRAY_SIZE(otom11_devices));
  96. }
  97. MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
  98. /* Maintainer: Guillaume GOURAT <[email protected]> */
  99. .atag_offset = 0x100,
  100. .nr_irqs = NR_IRQS_S3C2410,
  101. .map_io = otom11_map_io,
  102. .init_machine = otom11_init,
  103. .init_irq = s3c2410_init_irq,
  104. .init_time = otom11_init_time,
  105. MACHINE_END