mach-vstms.c 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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/mtd/mtd.h>
  20. #include <linux/mtd/nand.h>
  21. #include <linux/mtd/nand_ecc.h>
  22. #include <linux/mtd/partitions.h>
  23. #include <asm/mach/arch.h>
  24. #include <asm/mach/map.h>
  25. #include <asm/mach/irq.h>
  26. #include <asm/hardware.h>
  27. #include <asm/setup.h>
  28. #include <asm/io.h>
  29. #include <asm/irq.h>
  30. #include <asm/mach-types.h>
  31. #include <asm/arch/regs-serial.h>
  32. #include <asm/arch/regs-gpio.h>
  33. #include <asm/arch/regs-lcd.h>
  34. #include <asm/arch/idle.h>
  35. #include <asm/arch/fb.h>
  36. #include <asm/arch/nand.h>
  37. #include <asm/plat-s3c24xx/s3c2410.h>
  38. #include <asm/plat-s3c24xx/s3c2412.h>
  39. #include <asm/plat-s3c24xx/clock.h>
  40. #include <asm/plat-s3c24xx/devs.h>
  41. #include <asm/plat-s3c24xx/cpu.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 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 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 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_usb,
  109. &s3c_device_wdt,
  110. &s3c_device_i2c,
  111. &s3c_device_iis,
  112. &s3c_device_rtc,
  113. &s3c_device_nand,
  114. };
  115. static struct s3c24xx_board vstms_board __initdata = {
  116. .devices = vstms_devices,
  117. .devices_count = ARRAY_SIZE(vstms_devices)
  118. };
  119. static void __init vstms_fixup(struct machine_desc *desc,
  120. struct tag *tags, char **cmdline,
  121. struct meminfo *mi)
  122. {
  123. if (tags != phys_to_virt(S3C2410_SDRAM_PA + 0x100)) {
  124. mi->nr_banks=1;
  125. mi->bank[0].start = 0x30000000;
  126. mi->bank[0].size = SZ_64M;
  127. mi->bank[0].node = 0;
  128. }
  129. }
  130. static void __init vstms_map_io(void)
  131. {
  132. s3c_device_nand.dev.platform_data = &vstms_nand_info;
  133. s3c24xx_init_io(vstms_iodesc, ARRAY_SIZE(vstms_iodesc));
  134. s3c24xx_init_clocks(12000000);
  135. s3c24xx_init_uarts(vstms_uartcfgs, ARRAY_SIZE(vstms_uartcfgs));
  136. s3c24xx_set_board(&vstms_board);
  137. }
  138. MACHINE_START(VSTMS, "VSTMS")
  139. .phys_io = S3C2410_PA_UART,
  140. .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
  141. .boot_params = S3C2410_SDRAM_PA + 0x100,
  142. .fixup = vstms_fixup,
  143. .init_irq = s3c24xx_init_irq,
  144. .map_io = vstms_map_io,
  145. .timer = &s3c24xx_timer,
  146. MACHINE_END