mach-vstms.c 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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/devs.h>
  39. #include <plat/cpu.h>
  40. #include <plat/samsung-time.h>
  41. #include "common.h"
  42. static struct map_desc vstms_iodesc[] __initdata = {
  43. };
  44. static struct s3c2410_uartcfg vstms_uartcfgs[] __initdata = {
  45. [0] = {
  46. .hwport = 0,
  47. .flags = 0,
  48. .ucon = 0x3c5,
  49. .ulcon = 0x03,
  50. .ufcon = 0x51,
  51. },
  52. [1] = {
  53. .hwport = 1,
  54. .flags = 0,
  55. .ucon = 0x3c5,
  56. .ulcon = 0x03,
  57. .ufcon = 0x51,
  58. },
  59. [2] = {
  60. .hwport = 2,
  61. .flags = 0,
  62. .ucon = 0x3c5,
  63. .ulcon = 0x03,
  64. .ufcon = 0x51,
  65. }
  66. };
  67. static struct mtd_partition __initdata vstms_nand_part[] = {
  68. [0] = {
  69. .name = "Boot Agent",
  70. .size = 0x7C000,
  71. .offset = 0,
  72. },
  73. [1] = {
  74. .name = "UBoot Config",
  75. .offset = 0x7C000,
  76. .size = 0x4000,
  77. },
  78. [2] = {
  79. .name = "Kernel",
  80. .offset = 0x80000,
  81. .size = 0x200000,
  82. },
  83. [3] = {
  84. .name = "RFS",
  85. .offset = 0x280000,
  86. .size = 0x3d80000,
  87. },
  88. };
  89. static struct s3c2410_nand_set __initdata vstms_nand_sets[] = {
  90. [0] = {
  91. .name = "NAND",
  92. .nr_chips = 1,
  93. .nr_partitions = ARRAY_SIZE(vstms_nand_part),
  94. .partitions = vstms_nand_part,
  95. },
  96. };
  97. /* choose a set of timings which should suit most 512Mbit
  98. * chips and beyond.
  99. */
  100. static struct s3c2410_platform_nand __initdata vstms_nand_info = {
  101. .tacls = 20,
  102. .twrph0 = 60,
  103. .twrph1 = 20,
  104. .nr_sets = ARRAY_SIZE(vstms_nand_sets),
  105. .sets = vstms_nand_sets,
  106. };
  107. static struct platform_device *vstms_devices[] __initdata = {
  108. &s3c_device_ohci,
  109. &s3c_device_wdt,
  110. &s3c_device_i2c0,
  111. &s3c_device_iis,
  112. &s3c_device_rtc,
  113. &s3c_device_nand,
  114. &s3c2412_device_dma,
  115. };
  116. static void __init vstms_fixup(struct tag *tags, char **cmdline)
  117. {
  118. if (tags != phys_to_virt(S3C2410_SDRAM_PA + 0x100)) {
  119. memblock_add(0x30000000, SZ_64M);
  120. }
  121. }
  122. static void __init vstms_map_io(void)
  123. {
  124. s3c24xx_init_io(vstms_iodesc, ARRAY_SIZE(vstms_iodesc));
  125. s3c24xx_init_uarts(vstms_uartcfgs, ARRAY_SIZE(vstms_uartcfgs));
  126. samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
  127. }
  128. static void __init vstms_init_time(void)
  129. {
  130. s3c2412_init_clocks(12000000);
  131. samsung_timer_init();
  132. }
  133. static void __init vstms_init(void)
  134. {
  135. s3c_i2c0_set_platdata(NULL);
  136. s3c_nand_set_platdata(&vstms_nand_info);
  137. platform_add_devices(vstms_devices, ARRAY_SIZE(vstms_devices));
  138. }
  139. MACHINE_START(VSTMS, "VSTMS")
  140. .atag_offset = 0x100,
  141. .fixup = vstms_fixup,
  142. .init_irq = s3c2412_init_irq,
  143. .init_machine = vstms_init,
  144. .map_io = vstms_map_io,
  145. .init_time = vstms_init_time,
  146. MACHINE_END