mach-tct_hammer.c 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. #include "common.h"
  51. static struct resource tct_hammer_nor_resource = {
  52. .start = 0x00000000,
  53. .end = 0x01000000 - 1,
  54. .flags = IORESOURCE_MEM,
  55. };
  56. static struct mtd_partition tct_hammer_mtd_partitions[] = {
  57. {
  58. .name = "System",
  59. .size = 0x240000,
  60. .offset = 0,
  61. .mask_flags = MTD_WRITEABLE, /* force read-only */
  62. }, {
  63. .name = "JFFS2",
  64. .size = MTDPART_SIZ_FULL,
  65. .offset = MTDPART_OFS_APPEND,
  66. }
  67. };
  68. static struct physmap_flash_data tct_hammer_flash_data = {
  69. .width = 2,
  70. .parts = tct_hammer_mtd_partitions,
  71. .nr_parts = ARRAY_SIZE(tct_hammer_mtd_partitions),
  72. };
  73. static struct platform_device tct_hammer_device_nor = {
  74. .name = "physmap-flash",
  75. .id = 0,
  76. .dev = {
  77. .platform_data = &tct_hammer_flash_data,
  78. },
  79. .num_resources = 1,
  80. .resource = &tct_hammer_nor_resource,
  81. };
  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_i2c0,
  114. &s3c_device_ohci,
  115. &s3c_device_rtc,
  116. &s3c_device_usbgadget,
  117. &s3c_device_sdi,
  118. &tct_hammer_device_nor,
  119. };
  120. static void __init tct_hammer_map_io(void)
  121. {
  122. s3c24xx_init_io(tct_hammer_iodesc, ARRAY_SIZE(tct_hammer_iodesc));
  123. s3c24xx_init_clocks(0);
  124. s3c24xx_init_uarts(tct_hammer_uartcfgs, ARRAY_SIZE(tct_hammer_uartcfgs));
  125. }
  126. static void __init tct_hammer_init(void)
  127. {
  128. s3c_i2c0_set_platdata(NULL);
  129. platform_add_devices(tct_hammer_devices, ARRAY_SIZE(tct_hammer_devices));
  130. }
  131. MACHINE_START(TCT_HAMMER, "TCT_HAMMER")
  132. .atag_offset = 0x100,
  133. .map_io = tct_hammer_map_io,
  134. .init_irq = s3c24xx_init_irq,
  135. .init_machine = tct_hammer_init,
  136. .timer = &s3c24xx_timer,
  137. .restart = s3c2410_restart,
  138. MACHINE_END