1 // SPDX-License-Identifier: GPL-2.0
3 // Copyright (c) 2003-2004 Simtec Electronics
4 // Ben Dooks <ben@simtec.co.uk>
6 // https://www.handhelds.org/projects/rx3715.html
8 #include <linux/kernel.h>
9 #include <linux/types.h>
10 #include <linux/interrupt.h>
11 #include <linux/list.h>
12 #include <linux/memblock.h>
13 #include <linux/timer.h>
14 #include <linux/init.h>
15 #include <linux/tty.h>
16 #include <linux/console.h>
17 #include <linux/device.h>
18 #include <linux/platform_device.h>
19 #include <linux/serial_core.h>
20 #include <linux/serial_s3c.h>
21 #include <linux/serial.h>
23 #include <linux/mtd/mtd.h>
24 #include <linux/mtd/rawnand.h>
25 #include <linux/mtd/nand-ecc-sw-hamming.h>
26 #include <linux/mtd/partitions.h>
28 #include <asm/mach/arch.h>
29 #include <asm/mach/irq.h>
30 #include <asm/mach/map.h>
32 #include <linux/platform_data/mtd-nand-s3c2410.h>
33 #include <linux/platform_data/fb-s3c2410.h>
36 #include <asm/mach-types.h>
38 #include "regs-gpio.h"
39 #include "gpio-samsung.h"
49 static struct map_desc rx3715_iodesc[] __initdata = {
50 /* dump ISA space somewhere unused */
52 .virtual = (u32)S3C24XX_VA_ISA_BYTE,
53 .pfn = __phys_to_pfn(S3C2410_CS3),
59 static struct s3c2410_uartcfg rx3715_uartcfgs[] = {
66 .clk_sel = S3C2410_UCON_CLKSEL3,
74 .clk_sel = S3C2410_UCON_CLKSEL3,
79 .uart_flags = UPF_CONS_FLOW,
83 .clk_sel = S3C2410_UCON_CLKSEL3,
87 /* framebuffer lcd controller information */
89 static struct s3c2410fb_display rx3715_lcdcfg __initdata = {
90 .lcdcon5 = S3C2410_LCDCON5_INVVLINE |
91 S3C2410_LCDCON5_FRM565 |
92 S3C2410_LCDCON5_HWSWP,
94 .type = S3C2410_LCDCON1_TFT,
110 static struct s3c2410fb_mach_info rx3715_fb_info __initdata = {
112 .displays = &rx3715_lcdcfg,
114 .default_display = 0,
118 .gpccon = 0xaa955699,
119 .gpccon_mask = 0xffc003cc,
120 .gpccon_reg = S3C2410_GPCCON,
122 .gpcup_mask = 0xffffffff,
123 .gpcup_reg = S3C2410_GPCUP,
125 .gpdcon = 0xaa95aaa1,
126 .gpdcon_mask = 0xffc0fff0,
127 .gpdcon_reg = S3C2410_GPDCON,
129 .gpdup_mask = 0xffffffff,
130 .gpdup_reg = S3C2410_GPDUP,
133 static struct mtd_partition __initdata rx3715_nand_part[] = {
135 .name = "Whole Flash",
137 .size = MTDPART_SIZ_FULL,
138 .mask_flags = MTD_WRITEABLE,
142 static struct s3c2410_nand_set __initdata rx3715_nand_sets[] = {
146 .nr_partitions = ARRAY_SIZE(rx3715_nand_part),
147 .partitions = rx3715_nand_part,
151 static struct s3c2410_platform_nand __initdata rx3715_nand_info = {
155 .nr_sets = ARRAY_SIZE(rx3715_nand_sets),
156 .sets = rx3715_nand_sets,
157 .engine_type = NAND_ECC_ENGINE_TYPE_SOFT,
160 static struct platform_device *rx3715_devices[] __initdata = {
169 static void __init rx3715_map_io(void)
171 s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc));
172 s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
173 s3c24xx_set_timer_source(S3C24XX_PWM3, S3C24XX_PWM4);
176 static void __init rx3715_init_time(void)
178 s3c2440_init_clocks(16934000);
179 s3c24xx_timer_init();
182 /* H1940 and RX3715 need to reserve this for suspend */
183 static void __init rx3715_reserve(void)
185 memblock_reserve(0x30003000, 0x1000);
186 memblock_reserve(0x30081000, 0x1000);
189 static void __init rx3715_init_machine(void)
191 #ifdef CONFIG_PM_H1940
192 memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT), h1940_pm_return, 1024);
196 s3c_nand_set_platdata(&rx3715_nand_info);
197 s3c24xx_fb_set_platdata(&rx3715_fb_info);
198 /* Configure the I2S pins (GPE0...GPE4) in correct mode */
199 s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2),
201 platform_add_devices(rx3715_devices, ARRAY_SIZE(rx3715_devices));
204 MACHINE_START(RX3715, "IPAQ-RX3715")
205 /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
206 .atag_offset = 0x100,
207 .nr_irqs = NR_IRQS_S3C2440,
208 .map_io = rx3715_map_io,
209 .reserve = rx3715_reserve,
210 .init_irq = s3c2440_init_irq,
211 .init_machine = rx3715_init_machine,
212 .init_time = rx3715_init_time,