mach-otom.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // SPDX-License-Identifier: GPL-2.0
  2. //
  3. // Copyright (c) 2004 Nex Vision
  4. // Guillaume GOURAT <guillaume.gourat@nexvision.fr>
  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 <mach/hardware.h>
  22. #include <mach/regs-gpio.h>
  23. #include <plat/cpu.h>
  24. #include <plat/devs.h>
  25. #include <plat/samsung-time.h>
  26. #include "common.h"
  27. #include "otom.h"
  28. static struct map_desc otom11_iodesc[] __initdata = {
  29. /* Device area */
  30. { (u32)OTOM_VA_CS8900A_BASE, OTOM_PA_CS8900A_BASE, SZ_16M, MT_DEVICE },
  31. };
  32. #define UCON S3C2410_UCON_DEFAULT
  33. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
  34. #define UFCON S3C2410_UFCON_RXTRIG12 | S3C2410_UFCON_FIFOMODE
  35. static struct s3c2410_uartcfg otom11_uartcfgs[] __initdata = {
  36. [0] = {
  37. .hwport = 0,
  38. .flags = 0,
  39. .ucon = UCON,
  40. .ulcon = ULCON,
  41. .ufcon = UFCON,
  42. },
  43. [1] = {
  44. .hwport = 1,
  45. .flags = 0,
  46. .ucon = UCON,
  47. .ulcon = ULCON,
  48. .ufcon = UFCON,
  49. },
  50. /* port 2 is not actually used */
  51. [2] = {
  52. .hwport = 2,
  53. .flags = 0,
  54. .ucon = UCON,
  55. .ulcon = ULCON,
  56. .ufcon = UFCON,
  57. }
  58. };
  59. /* NOR Flash on NexVision OTOM board */
  60. static struct resource otom_nor_resource[] = {
  61. [0] = DEFINE_RES_MEM(S3C2410_CS0, SZ_4M),
  62. };
  63. static struct platform_device otom_device_nor = {
  64. .name = "mtd-flash",
  65. .id = -1,
  66. .num_resources = ARRAY_SIZE(otom_nor_resource),
  67. .resource = otom_nor_resource,
  68. };
  69. /* Standard OTOM devices */
  70. static struct platform_device *otom11_devices[] __initdata = {
  71. &s3c_device_ohci,
  72. &s3c_device_lcd,
  73. &s3c_device_wdt,
  74. &s3c_device_i2c0,
  75. &s3c_device_iis,
  76. &s3c_device_rtc,
  77. &otom_device_nor,
  78. };
  79. static void __init otom11_map_io(void)
  80. {
  81. s3c24xx_init_io(otom11_iodesc, ARRAY_SIZE(otom11_iodesc));
  82. s3c24xx_init_uarts(otom11_uartcfgs, ARRAY_SIZE(otom11_uartcfgs));
  83. samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
  84. }
  85. static void __init otom11_init_time(void)
  86. {
  87. s3c2410_init_clocks(12000000);
  88. samsung_timer_init();
  89. }
  90. static void __init otom11_init(void)
  91. {
  92. s3c_i2c0_set_platdata(NULL);
  93. platform_add_devices(otom11_devices, ARRAY_SIZE(otom11_devices));
  94. }
  95. MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
  96. /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */
  97. .atag_offset = 0x100,
  98. .map_io = otom11_map_io,
  99. .init_machine = otom11_init,
  100. .init_irq = s3c2410_init_irq,
  101. .init_time = otom11_init_time,
  102. MACHINE_END