1 // SPDX-License-Identifier: GPL-2.0+
3 // Copyright (c) 2007 TinCanTools
4 // David Anders <danders@amltd.com>
7 // derived from linux/arch/arm/mach-s3c2410/mach-bast.c, written by
8 // Ben Dooks <ben@simtec.co.uk>
10 #include <linux/kernel.h>
11 #include <linux/types.h>
12 #include <linux/interrupt.h>
13 #include <linux/list.h>
14 #include <linux/timer.h>
15 #include <linux/init.h>
16 #include <linux/device.h>
17 #include <linux/platform_device.h>
18 #include <linux/serial_core.h>
19 #include <linux/serial_s3c.h>
22 #include <asm/mach/arch.h>
23 #include <asm/mach/map.h>
24 #include <asm/mach/irq.h>
25 #include <asm/mach/flash.h>
27 #include <mach/hardware.h>
29 #include <asm/mach-types.h>
31 #include <linux/platform_data/i2c-s3c2410.h>
32 #include <plat/devs.h>
35 #include <linux/mtd/mtd.h>
36 #include <linux/mtd/partitions.h>
37 #include <linux/mtd/map.h>
38 #include <linux/mtd/physmap.h>
39 #include <plat/samsung-time.h>
43 static struct resource tct_hammer_nor_resource =
44 DEFINE_RES_MEM(0x00000000, SZ_16M);
46 static struct mtd_partition tct_hammer_mtd_partitions[] = {
51 .mask_flags = MTD_WRITEABLE, /* force read-only */
54 .size = MTDPART_SIZ_FULL,
55 .offset = MTDPART_OFS_APPEND,
59 static struct physmap_flash_data tct_hammer_flash_data = {
61 .parts = tct_hammer_mtd_partitions,
62 .nr_parts = ARRAY_SIZE(tct_hammer_mtd_partitions),
65 static struct platform_device tct_hammer_device_nor = {
66 .name = "physmap-flash",
69 .platform_data = &tct_hammer_flash_data,
72 .resource = &tct_hammer_nor_resource,
75 static struct map_desc tct_hammer_iodesc[] __initdata = {
78 #define UCON S3C2410_UCON_DEFAULT
79 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
80 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
82 static struct s3c2410_uartcfg tct_hammer_uartcfgs[] = {
107 static struct platform_device *tct_hammer_devices[] __initdata = {
113 &s3c_device_usbgadget,
115 &tct_hammer_device_nor,
118 static void __init tct_hammer_map_io(void)
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);
125 static void __init tct_hammer_init_time(void)
127 s3c2410_init_clocks(12000000);
128 samsung_timer_init();
131 static void __init tct_hammer_init(void)
133 s3c_i2c0_set_platdata(NULL);
134 platform_add_devices(tct_hammer_devices, ARRAY_SIZE(tct_hammer_devices));
137 MACHINE_START(TCT_HAMMER, "TCT_HAMMER")
138 .atag_offset = 0x100,
139 .map_io = tct_hammer_map_io,
140 .init_irq = s3c2410_init_irq,
141 .init_machine = tct_hammer_init,
142 .init_time = tct_hammer_init_time,