1 // SPDX-License-Identifier: GPL-2.0
3 // (C) 2006 Thomas Gleixner <tglx@linutronix.de>
5 // Derived from mach-smdk2413.c - (C) 2006 Simtec Electronics
7 #include <linux/kernel.h>
8 #include <linux/types.h>
9 #include <linux/interrupt.h>
10 #include <linux/list.h>
11 #include <linux/timer.h>
12 #include <linux/init.h>
13 #include <linux/serial_core.h>
14 #include <linux/serial_s3c.h>
15 #include <linux/platform_device.h>
17 #include <linux/mtd/mtd.h>
18 #include <linux/mtd/rawnand.h>
19 #include <linux/mtd/nand-ecc-sw-hamming.h>
20 #include <linux/mtd/partitions.h>
21 #include <linux/memblock.h>
23 #include <asm/mach/arch.h>
24 #include <asm/mach/map.h>
25 #include <asm/mach/irq.h>
27 #include <asm/setup.h>
29 #include <asm/mach-types.h>
31 #include "regs-gpio.h"
32 #include "gpio-samsung.h"
35 #include <linux/platform_data/fb-s3c2410.h>
37 #include <linux/platform_data/i2c-s3c2410.h>
38 #include <linux/platform_data/mtd-nand-s3c2410.h>
45 static struct map_desc vstms_iodesc
[] __initdata
= {
48 static struct s3c2410_uartcfg vstms_uartcfgs
[] __initdata
= {
72 static struct mtd_partition __initdata vstms_nand_part
[] = {
79 .name
= "UBoot Config",
95 static struct s3c2410_nand_set __initdata vstms_nand_sets
[] = {
99 .nr_partitions
= ARRAY_SIZE(vstms_nand_part
),
100 .partitions
= vstms_nand_part
,
104 /* choose a set of timings which should suit most 512Mbit
108 static struct s3c2410_platform_nand __initdata vstms_nand_info
= {
112 .nr_sets
= ARRAY_SIZE(vstms_nand_sets
),
113 .sets
= vstms_nand_sets
,
114 .engine_type
= NAND_ECC_ENGINE_TYPE_SOFT
,
117 static struct platform_device
*vstms_devices
[] __initdata
= {
127 static void __init
vstms_fixup(struct tag
*tags
, char **cmdline
)
129 if (tags
!= phys_to_virt(S3C2410_SDRAM_PA
+ 0x100)) {
130 memblock_add(0x30000000, SZ_64M
);
134 static void __init
vstms_map_io(void)
136 s3c24xx_init_io(vstms_iodesc
, ARRAY_SIZE(vstms_iodesc
));
137 s3c24xx_init_uarts(vstms_uartcfgs
, ARRAY_SIZE(vstms_uartcfgs
));
138 s3c24xx_set_timer_source(S3C24XX_PWM3
, S3C24XX_PWM4
);
141 static void __init
vstms_init_time(void)
143 s3c2412_init_clocks(12000000);
144 s3c24xx_timer_init();
147 static void __init
vstms_init(void)
149 s3c_i2c0_set_platdata(NULL
);
150 s3c_nand_set_platdata(&vstms_nand_info
);
151 /* Configure the I2S pins (GPE0...GPE4) in correct mode */
152 s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2),
154 platform_add_devices(vstms_devices
, ARRAY_SIZE(vstms_devices
));
157 MACHINE_START(VSTMS
, "VSTMS")
158 .atag_offset
= 0x100,
160 .fixup
= vstms_fixup
,
161 .init_irq
= s3c2412_init_irq
,
162 .init_machine
= vstms_init
,
163 .map_io
= vstms_map_io
,
164 .init_time
= vstms_init_time
,