mach-vstms.c 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /* linux/arch/arm/mach-s3c2412/mach-vstms.c
  2. *
  3. * (C) 2006 Thomas Gleixner <tglx@linutronix.de>
  4. *
  5. * Derived from mach-smdk2413.c - (C) 2006 Simtec Electronics
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/types.h>
  13. #include <linux/interrupt.h>
  14. #include <linux/list.h>
  15. #include <linux/timer.h>
  16. #include <linux/init.h>
  17. #include <linux/serial_core.h>
  18. #include <linux/serial_s3c.h>
  19. #include <linux/platform_device.h>
  20. #include <linux/io.h>
  21. #include <linux/mtd/mtd.h>
  22. #include <linux/mtd/nand.h>
  23. #include <linux/mtd/nand_ecc.h>
  24. #include <linux/mtd/partitions.h>
  25. #include <linux/memblock.h>
  26. #include <asm/mach/arch.h>
  27. #include <asm/mach/map.h>
  28. #include <asm/mach/irq.h>
  29. #include <mach/hardware.h>
  30. #include <asm/setup.h>
  31. #include <asm/irq.h>
  32. #include <asm/mach-types.h>
  33. #include <mach/regs-gpio.h>
  34. #include <mach/regs-lcd.h>
  35. #include <mach/fb.h>
  36. #include <linux/platform_data/i2c-s3c2410.h>
  37. #include <linux/platform_data/mtd-nand-s3c2410.h>
  38. #include <plat/clock.h>
  39. #include <plat/devs.h>
  40. #include <plat/cpu.h>
  41. #include <plat/samsung-time.h>
  42. #include "common.h"
  43. static struct map_desc vstms_iodesc[] __initdata = {
  44. };
  45. static struct s3c2410_uartcfg vstms_uartcfgs[] __initdata = {
  46. [0] = {
  47. .hwport = 0,
  48. .flags = 0,
  49. .ucon = 0x3c5,
  50. .ulcon = 0x03,
  51. .ufcon = 0x51,
  52. },
  53. [1] = {
  54. .hwport = 1,
  55. .flags = 0,
  56. .ucon = 0x3c5,
  57. .ulcon = 0x03,
  58. .ufcon = 0x51,
  59. },
  60. [2] = {
  61. .hwport = 2,
  62. .flags = 0,
  63. .ucon = 0x3c5,
  64. .ulcon = 0x03,
  65. .ufcon = 0x51,
  66. }
  67. };
  68. static struct mtd_partition __initdata vstms_nand_part[] = {
  69. [0] = {
  70. .name = "Boot Agent",
  71. .size = 0x7C000,
  72. .offset = 0,
  73. },
  74. [1] = {
  75. .name = "UBoot Config",
  76. .offset = 0x7C000,
  77. .size = 0x4000,
  78. },
  79. [2] = {
  80. .name = "Kernel",
  81. .offset = 0x80000,
  82. .size = 0x200000,
  83. },
  84. [3] = {
  85. .name = "RFS",
  86. .offset = 0x280000,
  87. .size = 0x3d80000,
  88. },
  89. };
  90. static struct s3c2410_nand_set __initdata vstms_nand_sets[] = {
  91. [0] = {
  92. .name = "NAND",
  93. .nr_chips = 1,
  94. .nr_partitions = ARRAY_SIZE(vstms_nand_part),
  95. .partitions = vstms_nand_part,
  96. },
  97. };
  98. /* choose a set of timings which should suit most 512Mbit
  99. * chips and beyond.
  100. */
  101. static struct s3c2410_platform_nand __initdata vstms_nand_info = {
  102. .tacls = 20,
  103. .twrph0 = 60,
  104. .twrph1 = 20,
  105. .nr_sets = ARRAY_SIZE(vstms_nand_sets),
  106. .sets = vstms_nand_sets,
  107. };
  108. static struct platform_device *vstms_devices[] __initdata = {
  109. &s3c_device_ohci,
  110. &s3c_device_wdt,
  111. &s3c_device_i2c0,
  112. &s3c_device_iis,
  113. &s3c_device_rtc,
  114. &s3c_device_nand,
  115. &s3c2412_device_dma,
  116. };
  117. static void __init vstms_fixup(struct tag *tags, char **cmdline)
  118. {
  119. if (tags != phys_to_virt(S3C2410_SDRAM_PA + 0x100)) {
  120. memblock_add(0x30000000, SZ_64M);
  121. }
  122. }
  123. static void __init vstms_map_io(void)
  124. {
  125. s3c24xx_init_io(vstms_iodesc, ARRAY_SIZE(vstms_iodesc));
  126. s3c24xx_init_uarts(vstms_uartcfgs, ARRAY_SIZE(vstms_uartcfgs));
  127. samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
  128. }
  129. static void __init vstms_init_time(void)
  130. {
  131. s3c2412_init_clocks(12000000);
  132. samsung_timer_init();
  133. }
  134. static void __init vstms_init(void)
  135. {
  136. s3c_i2c0_set_platdata(NULL);
  137. s3c_nand_set_platdata(&vstms_nand_info);
  138. platform_add_devices(vstms_devices, ARRAY_SIZE(vstms_devices));
  139. }
  140. MACHINE_START(VSTMS, "VSTMS")
  141. .atag_offset = 0x100,
  142. .fixup = vstms_fixup,
  143. .init_irq = s3c2412_init_irq,
  144. .init_machine = vstms_init,
  145. .map_io = vstms_map_io,
  146. .init_time = vstms_init_time,
  147. .restart = s3c2412_restart,
  148. MACHINE_END