mach-tct_hammer.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /* linux/arch/arm/mach-s3c2410/mach-tct_hammer.c
  2. *
  3. * Copyright (c) 2007 TinCanTools
  4. * David Anders <danders@amltd.com>
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  18. * MA 02111-1307 USA
  19. *
  20. * @History:
  21. * derived from linux/arch/arm/mach-s3c2410/mach-bast.c, written by
  22. * Ben Dooks <ben@simtec.co.uk>
  23. *
  24. ***********************************************************************/
  25. #include <linux/kernel.h>
  26. #include <linux/types.h>
  27. #include <linux/interrupt.h>
  28. #include <linux/list.h>
  29. #include <linux/timer.h>
  30. #include <linux/init.h>
  31. #include <linux/device.h>
  32. #include <linux/platform_device.h>
  33. #include <linux/serial_core.h>
  34. #include <linux/io.h>
  35. #include <asm/mach/arch.h>
  36. #include <asm/mach/map.h>
  37. #include <asm/mach/irq.h>
  38. #include <asm/mach/flash.h>
  39. #include <mach/hardware.h>
  40. #include <asm/irq.h>
  41. #include <asm/mach-types.h>
  42. #include <asm/plat-s3c/regs-serial.h>
  43. #include <asm/plat-s3c24xx/devs.h>
  44. #include <asm/plat-s3c24xx/cpu.h>
  45. #ifdef CONFIG_MTD_PARTITIONS
  46. #include <linux/mtd/mtd.h>
  47. #include <linux/mtd/partitions.h>
  48. #include <linux/mtd/map.h>
  49. #include <linux/mtd/physmap.h>
  50. static struct resource tct_hammer_nor_resource = {
  51. .start = 0x00000000,
  52. .end = 0x01000000 - 1,
  53. .flags = IORESOURCE_MEM,
  54. };
  55. static struct mtd_partition tct_hammer_mtd_partitions[] = {
  56. {
  57. .name = "System",
  58. .size = 0x240000,
  59. .offset = 0,
  60. .mask_flags = MTD_WRITEABLE, /* force read-only */
  61. }, {
  62. .name = "JFFS2",
  63. .size = MTDPART_SIZ_FULL,
  64. .offset = MTDPART_OFS_APPEND,
  65. }
  66. };
  67. static struct physmap_flash_data tct_hammer_flash_data = {
  68. .width = 2,
  69. .parts = tct_hammer_mtd_partitions,
  70. .nr_parts = ARRAY_SIZE(tct_hammer_mtd_partitions),
  71. };
  72. static struct platform_device tct_hammer_device_nor = {
  73. .name = "physmap-flash",
  74. .id = 0,
  75. .dev = {
  76. .platform_data = &tct_hammer_flash_data,
  77. },
  78. .num_resources = 1,
  79. .resource = &tct_hammer_nor_resource,
  80. };
  81. #endif
  82. static struct map_desc tct_hammer_iodesc[] __initdata = {
  83. };
  84. #define UCON S3C2410_UCON_DEFAULT
  85. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
  86. #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  87. static struct s3c2410_uartcfg tct_hammer_uartcfgs[] = {
  88. [0] = {
  89. .hwport = 0,
  90. .flags = 0,
  91. .ucon = UCON,
  92. .ulcon = ULCON,
  93. .ufcon = UFCON,
  94. },
  95. [1] = {
  96. .hwport = 1,
  97. .flags = 0,
  98. .ucon = UCON,
  99. .ulcon = ULCON,
  100. .ufcon = UFCON,
  101. },
  102. [2] = {
  103. .hwport = 2,
  104. .flags = 0,
  105. .ucon = UCON,
  106. .ulcon = ULCON,
  107. .ufcon = UFCON,
  108. }
  109. };
  110. static struct platform_device *tct_hammer_devices[] __initdata = {
  111. &s3c_device_adc,
  112. &s3c_device_wdt,
  113. &s3c_device_i2c,
  114. &s3c_device_usb,
  115. &s3c_device_rtc,
  116. &s3c_device_usbgadget,
  117. &s3c_device_sdi,
  118. #ifdef CONFIG_MTD_PARTITIONS
  119. &tct_hammer_device_nor,
  120. #endif
  121. };
  122. static void __init tct_hammer_map_io(void)
  123. {
  124. s3c24xx_init_io(tct_hammer_iodesc, ARRAY_SIZE(tct_hammer_iodesc));
  125. s3c24xx_init_clocks(0);
  126. s3c24xx_init_uarts(tct_hammer_uartcfgs, ARRAY_SIZE(tct_hammer_uartcfgs));
  127. }
  128. static void __init tct_hammer_init(void)
  129. {
  130. platform_add_devices(tct_hammer_devices, ARRAY_SIZE(tct_hammer_devices));
  131. }
  132. MACHINE_START(TCT_HAMMER, "TCT_HAMMER")
  133. .phys_io = S3C2410_PA_UART,
  134. .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
  135. .boot_params = S3C2410_SDRAM_PA + 0x100,
  136. .map_io = tct_hammer_map_io,
  137. .init_irq = s3c24xx_init_irq,
  138. .init_machine = tct_hammer_init,
  139. .timer = &s3c24xx_timer,
  140. MACHINE_END