mach-vstms.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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/platform_device.h>
  19. #include <linux/io.h>
  20. #include <linux/mtd/mtd.h>
  21. #include <linux/mtd/nand.h>
  22. #include <linux/mtd/nand_ecc.h>
  23. #include <linux/mtd/partitions.h>
  24. #include <asm/mach/arch.h>
  25. #include <asm/mach/map.h>
  26. #include <asm/mach/irq.h>
  27. #include <mach/hardware.h>
  28. #include <asm/setup.h>
  29. #include <asm/irq.h>
  30. #include <asm/mach-types.h>
  31. #include <plat/regs-serial.h>
  32. #include <mach/regs-gpio.h>
  33. #include <mach/regs-lcd.h>
  34. #include <mach/idle.h>
  35. #include <mach/fb.h>
  36. #include <plat/iic.h>
  37. #include <plat/nand.h>
  38. #include <plat/s3c2410.h>
  39. #include <plat/s3c2412.h>
  40. #include <plat/clock.h>
  41. #include <plat/devs.h>
  42. #include <plat/cpu.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. };
  116. static void __init vstms_fixup(struct tag *tags, char **cmdline,
  117. struct meminfo *mi)
  118. {
  119. if (tags != phys_to_virt(S3C2410_SDRAM_PA + 0x100)) {
  120. mi->nr_banks=1;
  121. mi->bank[0].start = 0x30000000;
  122. mi->bank[0].size = SZ_64M;
  123. }
  124. }
  125. static void __init vstms_map_io(void)
  126. {
  127. s3c24xx_init_io(vstms_iodesc, ARRAY_SIZE(vstms_iodesc));
  128. s3c24xx_init_clocks(12000000);
  129. s3c24xx_init_uarts(vstms_uartcfgs, ARRAY_SIZE(vstms_uartcfgs));
  130. }
  131. static void __init vstms_init(void)
  132. {
  133. s3c_i2c0_set_platdata(NULL);
  134. s3c_nand_set_platdata(&vstms_nand_info);
  135. platform_add_devices(vstms_devices, ARRAY_SIZE(vstms_devices));
  136. }
  137. MACHINE_START(VSTMS, "VSTMS")
  138. .atag_offset = 0x100,
  139. .fixup = vstms_fixup,
  140. .init_irq = s3c24xx_init_irq,
  141. .init_machine = vstms_init,
  142. .map_io = vstms_map_io,
  143. .timer = &s3c24xx_timer,
  144. .restart = s3c2412_restart,
  145. MACHINE_END