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 */
53 .virtual = (u32
)S3C24XX_VA_ISA_WORD
,
54 .pfn
= __phys_to_pfn(S3C2410_CS3
),
58 .virtual = (u32
)S3C24XX_VA_ISA_BYTE
,
59 .pfn
= __phys_to_pfn(S3C2410_CS3
),
65 static struct s3c2410_uartcfg rx3715_uartcfgs
[] = {
72 .clk_sel
= S3C2410_UCON_CLKSEL3
,
80 .clk_sel
= S3C2410_UCON_CLKSEL3
,
85 .uart_flags
= UPF_CONS_FLOW
,
89 .clk_sel
= S3C2410_UCON_CLKSEL3
,
93 /* framebuffer lcd controller information */
95 static struct s3c2410fb_display rx3715_lcdcfg __initdata
= {
96 .lcdcon5
= S3C2410_LCDCON5_INVVLINE
|
97 S3C2410_LCDCON5_FRM565
|
98 S3C2410_LCDCON5_HWSWP
,
100 .type
= S3C2410_LCDCON1_TFT
,
116 static struct s3c2410fb_mach_info rx3715_fb_info __initdata
= {
118 .displays
= &rx3715_lcdcfg
,
120 .default_display
= 0,
124 .gpccon
= 0xaa955699,
125 .gpccon_mask
= 0xffc003cc,
126 .gpccon_reg
= S3C2410_GPCCON
,
128 .gpcup_mask
= 0xffffffff,
129 .gpcup_reg
= S3C2410_GPCUP
,
131 .gpdcon
= 0xaa95aaa1,
132 .gpdcon_mask
= 0xffc0fff0,
133 .gpdcon_reg
= S3C2410_GPDCON
,
135 .gpdup_mask
= 0xffffffff,
136 .gpdup_reg
= S3C2410_GPDUP
,
139 static struct mtd_partition __initdata rx3715_nand_part
[] = {
141 .name
= "Whole Flash",
143 .size
= MTDPART_SIZ_FULL
,
144 .mask_flags
= MTD_WRITEABLE
,
148 static struct s3c2410_nand_set __initdata rx3715_nand_sets
[] = {
152 .nr_partitions
= ARRAY_SIZE(rx3715_nand_part
),
153 .partitions
= rx3715_nand_part
,
157 static struct s3c2410_platform_nand __initdata rx3715_nand_info
= {
161 .nr_sets
= ARRAY_SIZE(rx3715_nand_sets
),
162 .sets
= rx3715_nand_sets
,
163 .engine_type
= NAND_ECC_ENGINE_TYPE_SOFT
,
166 static struct platform_device
*rx3715_devices
[] __initdata
= {
175 static void __init
rx3715_map_io(void)
177 s3c24xx_init_io(rx3715_iodesc
, ARRAY_SIZE(rx3715_iodesc
));
178 s3c24xx_init_uarts(rx3715_uartcfgs
, ARRAY_SIZE(rx3715_uartcfgs
));
179 s3c24xx_set_timer_source(S3C24XX_PWM3
, S3C24XX_PWM4
);
182 static void __init
rx3715_init_time(void)
184 s3c2440_init_clocks(16934000);
185 s3c24xx_timer_init();
188 /* H1940 and RX3715 need to reserve this for suspend */
189 static void __init
rx3715_reserve(void)
191 memblock_reserve(0x30003000, 0x1000);
192 memblock_reserve(0x30081000, 0x1000);
195 static void __init
rx3715_init_machine(void)
197 #ifdef CONFIG_PM_H1940
198 memcpy(phys_to_virt(H1940_SUSPEND_RESUMEAT
), h1940_pm_return
, 1024);
202 s3c_nand_set_platdata(&rx3715_nand_info
);
203 s3c24xx_fb_set_platdata(&rx3715_fb_info
);
204 /* Configure the I2S pins (GPE0...GPE4) in correct mode */
205 s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2),
207 platform_add_devices(rx3715_devices
, ARRAY_SIZE(rx3715_devices
));
210 MACHINE_START(RX3715
, "IPAQ-RX3715")
211 /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
212 .atag_offset
= 0x100,
213 .map_io
= rx3715_map_io
,
214 .reserve
= rx3715_reserve
,
215 .init_irq
= s3c2440_init_irq
,
216 .init_machine
= rx3715_init_machine
,
217 .init_time
= rx3715_init_time
,