mach-tct_hammer.c 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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 <plat/regs-serial.h>
  43. #include <plat/iic.h>
  44. #include <plat/devs.h>
  45. #include <plat/cpu.h>
  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. static struct map_desc tct_hammer_iodesc[] __initdata = {
  82. };
  83. #define UCON S3C2410_UCON_DEFAULT
  84. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
  85. #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  86. static struct s3c2410_uartcfg tct_hammer_uartcfgs[] = {
  87. [0] = {
  88. .hwport = 0,
  89. .flags = 0,
  90. .ucon = UCON,
  91. .ulcon = ULCON,
  92. .ufcon = UFCON,
  93. },
  94. [1] = {
  95. .hwport = 1,
  96. .flags = 0,
  97. .ucon = UCON,
  98. .ulcon = ULCON,
  99. .ufcon = UFCON,
  100. },
  101. [2] = {
  102. .hwport = 2,
  103. .flags = 0,
  104. .ucon = UCON,
  105. .ulcon = ULCON,
  106. .ufcon = UFCON,
  107. }
  108. };
  109. static struct platform_device *tct_hammer_devices[] __initdata = {
  110. &s3c_device_adc,
  111. &s3c_device_wdt,
  112. &s3c_device_i2c0,
  113. &s3c_device_ohci,
  114. &s3c_device_rtc,
  115. &s3c_device_usbgadget,
  116. &s3c_device_sdi,
  117. &tct_hammer_device_nor,
  118. };
  119. static void __init tct_hammer_map_io(void)
  120. {
  121. s3c24xx_init_io(tct_hammer_iodesc, ARRAY_SIZE(tct_hammer_iodesc));
  122. s3c24xx_init_clocks(0);
  123. s3c24xx_init_uarts(tct_hammer_uartcfgs, ARRAY_SIZE(tct_hammer_uartcfgs));
  124. }
  125. static void __init tct_hammer_init(void)
  126. {
  127. s3c_i2c0_set_platdata(NULL);
  128. platform_add_devices(tct_hammer_devices, ARRAY_SIZE(tct_hammer_devices));
  129. }
  130. MACHINE_START(TCT_HAMMER, "TCT_HAMMER")
  131. .atag_offset = 0x100,
  132. .map_io = tct_hammer_map_io,
  133. .init_irq = s3c24xx_init_irq,
  134. .init_machine = tct_hammer_init,
  135. .timer = &s3c24xx_timer,
  136. MACHINE_END