mach-tct_hammer.c 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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/serial_s3c.h>
  35. #include <linux/io.h>
  36. #include <asm/mach/arch.h>
  37. #include <asm/mach/map.h>
  38. #include <asm/mach/irq.h>
  39. #include <asm/mach/flash.h>
  40. #include <mach/hardware.h>
  41. #include <asm/irq.h>
  42. #include <asm/mach-types.h>
  43. #include <linux/platform_data/i2c-s3c2410.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 <plat/samsung-time.h>
  51. #include "common.h"
  52. static struct resource tct_hammer_nor_resource =
  53. DEFINE_RES_MEM(0x00000000, SZ_16M);
  54. static struct mtd_partition tct_hammer_mtd_partitions[] = {
  55. {
  56. .name = "System",
  57. .size = 0x240000,
  58. .offset = 0,
  59. .mask_flags = MTD_WRITEABLE, /* force read-only */
  60. }, {
  61. .name = "JFFS2",
  62. .size = MTDPART_SIZ_FULL,
  63. .offset = MTDPART_OFS_APPEND,
  64. }
  65. };
  66. static struct physmap_flash_data tct_hammer_flash_data = {
  67. .width = 2,
  68. .parts = tct_hammer_mtd_partitions,
  69. .nr_parts = ARRAY_SIZE(tct_hammer_mtd_partitions),
  70. };
  71. static struct platform_device tct_hammer_device_nor = {
  72. .name = "physmap-flash",
  73. .id = 0,
  74. .dev = {
  75. .platform_data = &tct_hammer_flash_data,
  76. },
  77. .num_resources = 1,
  78. .resource = &tct_hammer_nor_resource,
  79. };
  80. static struct map_desc tct_hammer_iodesc[] __initdata = {
  81. };
  82. #define UCON S3C2410_UCON_DEFAULT
  83. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
  84. #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  85. static struct s3c2410_uartcfg tct_hammer_uartcfgs[] = {
  86. [0] = {
  87. .hwport = 0,
  88. .flags = 0,
  89. .ucon = UCON,
  90. .ulcon = ULCON,
  91. .ufcon = UFCON,
  92. },
  93. [1] = {
  94. .hwport = 1,
  95. .flags = 0,
  96. .ucon = UCON,
  97. .ulcon = ULCON,
  98. .ufcon = UFCON,
  99. },
  100. [2] = {
  101. .hwport = 2,
  102. .flags = 0,
  103. .ucon = UCON,
  104. .ulcon = ULCON,
  105. .ufcon = UFCON,
  106. }
  107. };
  108. static struct platform_device *tct_hammer_devices[] __initdata = {
  109. &s3c_device_adc,
  110. &s3c_device_wdt,
  111. &s3c_device_i2c0,
  112. &s3c_device_ohci,
  113. &s3c_device_rtc,
  114. &s3c_device_usbgadget,
  115. &s3c_device_sdi,
  116. &tct_hammer_device_nor,
  117. };
  118. static void __init tct_hammer_map_io(void)
  119. {
  120. s3c24xx_init_io(tct_hammer_iodesc, ARRAY_SIZE(tct_hammer_iodesc));
  121. s3c24xx_init_uarts(tct_hammer_uartcfgs, ARRAY_SIZE(tct_hammer_uartcfgs));
  122. samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
  123. }
  124. static void __init tct_hammer_init_time(void)
  125. {
  126. s3c2410_init_clocks(12000000);
  127. samsung_timer_init();
  128. }
  129. static void __init tct_hammer_init(void)
  130. {
  131. s3c_i2c0_set_platdata(NULL);
  132. platform_add_devices(tct_hammer_devices, ARRAY_SIZE(tct_hammer_devices));
  133. }
  134. MACHINE_START(TCT_HAMMER, "TCT_HAMMER")
  135. .atag_offset = 0x100,
  136. .map_io = tct_hammer_map_io,
  137. .init_irq = s3c2410_init_irq,
  138. .init_machine = tct_hammer_init,
  139. .init_time = tct_hammer_init_time,
  140. MACHINE_END