mach-tct_hammer.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. // SPDX-License-Identifier: GPL-2.0+
  2. //
  3. // Copyright (c) 2007 TinCanTools
  4. // David Anders <danders@amltd.com>
  5. //
  6. // @History:
  7. // derived from linux/arch/arm/mach-s3c2410/mach-bast.c, written by
  8. // Ben Dooks <ben@simtec.co.uk>
  9. #include <linux/kernel.h>
  10. #include <linux/types.h>
  11. #include <linux/interrupt.h>
  12. #include <linux/list.h>
  13. #include <linux/timer.h>
  14. #include <linux/init.h>
  15. #include <linux/device.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/serial_core.h>
  18. #include <linux/serial_s3c.h>
  19. #include <linux/io.h>
  20. #include <asm/mach/arch.h>
  21. #include <asm/mach/map.h>
  22. #include <asm/mach/irq.h>
  23. #include <asm/mach/flash.h>
  24. #include <mach/hardware.h>
  25. #include <asm/irq.h>
  26. #include <asm/mach-types.h>
  27. #include <linux/platform_data/i2c-s3c2410.h>
  28. #include <plat/devs.h>
  29. #include <plat/cpu.h>
  30. #include <linux/mtd/mtd.h>
  31. #include <linux/mtd/partitions.h>
  32. #include <linux/mtd/map.h>
  33. #include <linux/mtd/physmap.h>
  34. #include <plat/samsung-time.h>
  35. #include "common.h"
  36. static struct resource tct_hammer_nor_resource =
  37. DEFINE_RES_MEM(0x00000000, SZ_16M);
  38. static struct mtd_partition tct_hammer_mtd_partitions[] = {
  39. {
  40. .name = "System",
  41. .size = 0x240000,
  42. .offset = 0,
  43. .mask_flags = MTD_WRITEABLE, /* force read-only */
  44. }, {
  45. .name = "JFFS2",
  46. .size = MTDPART_SIZ_FULL,
  47. .offset = MTDPART_OFS_APPEND,
  48. }
  49. };
  50. static struct physmap_flash_data tct_hammer_flash_data = {
  51. .width = 2,
  52. .parts = tct_hammer_mtd_partitions,
  53. .nr_parts = ARRAY_SIZE(tct_hammer_mtd_partitions),
  54. };
  55. static struct platform_device tct_hammer_device_nor = {
  56. .name = "physmap-flash",
  57. .id = 0,
  58. .dev = {
  59. .platform_data = &tct_hammer_flash_data,
  60. },
  61. .num_resources = 1,
  62. .resource = &tct_hammer_nor_resource,
  63. };
  64. static struct map_desc tct_hammer_iodesc[] __initdata = {
  65. };
  66. #define UCON S3C2410_UCON_DEFAULT
  67. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
  68. #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  69. static struct s3c2410_uartcfg tct_hammer_uartcfgs[] = {
  70. [0] = {
  71. .hwport = 0,
  72. .flags = 0,
  73. .ucon = UCON,
  74. .ulcon = ULCON,
  75. .ufcon = UFCON,
  76. },
  77. [1] = {
  78. .hwport = 1,
  79. .flags = 0,
  80. .ucon = UCON,
  81. .ulcon = ULCON,
  82. .ufcon = UFCON,
  83. },
  84. [2] = {
  85. .hwport = 2,
  86. .flags = 0,
  87. .ucon = UCON,
  88. .ulcon = ULCON,
  89. .ufcon = UFCON,
  90. }
  91. };
  92. static struct platform_device *tct_hammer_devices[] __initdata = {
  93. &s3c_device_adc,
  94. &s3c_device_wdt,
  95. &s3c_device_i2c0,
  96. &s3c_device_ohci,
  97. &s3c_device_rtc,
  98. &s3c_device_usbgadget,
  99. &s3c_device_sdi,
  100. &tct_hammer_device_nor,
  101. };
  102. static void __init tct_hammer_map_io(void)
  103. {
  104. s3c24xx_init_io(tct_hammer_iodesc, ARRAY_SIZE(tct_hammer_iodesc));
  105. s3c24xx_init_uarts(tct_hammer_uartcfgs, ARRAY_SIZE(tct_hammer_uartcfgs));
  106. samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
  107. }
  108. static void __init tct_hammer_init_time(void)
  109. {
  110. s3c2410_init_clocks(12000000);
  111. samsung_timer_init();
  112. }
  113. static void __init tct_hammer_init(void)
  114. {
  115. s3c_i2c0_set_platdata(NULL);
  116. platform_add_devices(tct_hammer_devices, ARRAY_SIZE(tct_hammer_devices));
  117. }
  118. MACHINE_START(TCT_HAMMER, "TCT_HAMMER")
  119. .atag_offset = 0x100,
  120. .map_io = tct_hammer_map_io,
  121. .init_irq = s3c2410_init_irq,
  122. .init_machine = tct_hammer_init,
  123. .init_time = tct_hammer_init_time,
  124. MACHINE_END