mach-vstms.c 3.6 KB

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