mach-otom.c 2.9 KB

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