mach-vstms.c 3.4 KB

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