1 /* linux/arch/arm/mach-s3c2410/mach-amlm5900.c
3 * linux/arch/arm/mach-s3c2410/mach-amlm5900.c
5 * Copyright (c) 2006 American Microsystems Limited
6 * David Anders <danders@amltd.com>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 * derived from linux/arch/arm/mach-s3c2410/mach-bast.c, written by
25 * Ben Dooks <ben@simtec.co.uk>
27 ***********************************************************************/
29 #include <linux/kernel.h>
30 #include <linux/types.h>
31 #include <linux/interrupt.h>
32 #include <linux/list.h>
33 #include <linux/timer.h>
34 #include <linux/init.h>
35 #include <linux/device.h>
36 #include <linux/platform_device.h>
37 #include <linux/proc_fs.h>
38 #include <linux/serial_core.h>
41 #include <asm/mach/arch.h>
42 #include <asm/mach/map.h>
43 #include <asm/mach/irq.h>
44 #include <asm/mach/flash.h>
46 #include <mach/hardware.h>
48 #include <asm/mach-types.h>
51 #include <plat/regs-serial.h>
52 #include <mach/regs-lcd.h>
53 #include <mach/regs-gpio.h>
56 #include <plat/devs.h>
59 #ifdef CONFIG_MTD_PARTITIONS
61 #include <linux/mtd/mtd.h>
62 #include <linux/mtd/partitions.h>
63 #include <linux/mtd/map.h>
64 #include <linux/mtd/physmap.h>
66 static struct resource amlm5900_nor_resource = {
68 .end = 0x01000000 - 1,
69 .flags = IORESOURCE_MEM,
74 static struct mtd_partition amlm5900_mtd_partitions[] = {
79 .mask_flags = MTD_WRITEABLE, /* force read-only */
83 .offset = MTDPART_OFS_APPEND,
87 .offset = MTDPART_OFS_APPEND,
91 .offset = MTDPART_OFS_APPEND,
94 .size = MTDPART_SIZ_FULL,
95 .offset = MTDPART_OFS_APPEND,
99 static struct physmap_flash_data amlm5900_flash_data = {
101 .parts = amlm5900_mtd_partitions,
102 .nr_parts = ARRAY_SIZE(amlm5900_mtd_partitions),
105 static struct platform_device amlm5900_device_nor = {
106 .name = "physmap-flash",
109 .platform_data = &amlm5900_flash_data,
112 .resource = &amlm5900_nor_resource,
116 static struct map_desc amlm5900_iodesc[] __initdata = {
119 #define UCON S3C2410_UCON_DEFAULT
120 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
121 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
123 static struct s3c2410_uartcfg amlm5900_uartcfgs[] = {
148 static struct platform_device *amlm5900_devices[] __initdata = {
149 #ifdef CONFIG_FB_S3C2410
157 &s3c_device_usbgadget,
159 #ifdef CONFIG_MTD_PARTITIONS
160 &amlm5900_device_nor,
164 static void __init amlm5900_map_io(void)
166 s3c24xx_init_io(amlm5900_iodesc, ARRAY_SIZE(amlm5900_iodesc));
167 s3c24xx_init_clocks(0);
168 s3c24xx_init_uarts(amlm5900_uartcfgs, ARRAY_SIZE(amlm5900_uartcfgs));
171 #ifdef CONFIG_FB_S3C2410
172 static struct s3c2410fb_display __initdata amlm5900_lcd_info = {
176 .type = S3C2410_LCDCON1_STN4,
178 .pixclock = 680000, /* HCLK = 100MHz */
182 .left_margin = 1 << (4 + 3),
183 .right_margin = 8 << 3,
188 .lcdcon5 = 0x00000001,
191 static struct s3c2410fb_mach_info __initdata amlm5900_fb_info = {
193 .displays = &amlm5900_lcd_info,
195 .default_display = 0,
197 .gpccon = 0xaaaaaaaa,
198 .gpccon_mask = 0xffffffff,
200 .gpcup_mask = 0xffffffff,
202 .gpdcon = 0xaaaaaaaa,
203 .gpdcon_mask = 0xffffffff,
205 .gpdup_mask = 0xffffffff,
210 amlm5900_wake_interrupt(int irq, void *ignored)
215 static void amlm5900_init_pm(void)
219 ret = request_irq(IRQ_EINT9, &amlm5900_wake_interrupt,
220 IRQF_TRIGGER_RISING | IRQF_SHARED,
221 "amlm5900_wakeup", &amlm5900_wake_interrupt);
223 printk(KERN_ERR "AML-M5900: no wakeup irq, %d?\n", ret);
225 enable_irq_wake(IRQ_EINT9);
226 /* configure the suspend/resume status pin */
227 s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP);
228 s3c2410_gpio_pullup(S3C2410_GPF2, 0);
231 static void __init amlm5900_init(void)
234 #ifdef CONFIG_FB_S3C2410
235 s3c24xx_fb_set_platdata(&amlm5900_fb_info);
237 s3c_i2c0_set_platdata(NULL);
238 platform_add_devices(amlm5900_devices, ARRAY_SIZE(amlm5900_devices));
241 MACHINE_START(AML_M5900, "AML_M5900")
242 .phys_io = S3C2410_PA_UART,
243 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
244 .boot_params = S3C2410_SDRAM_PA + 0x100,
245 .map_io = amlm5900_map_io,
246 .init_irq = s3c24xx_init_irq,
247 .init_machine = amlm5900_init,
248 .timer = &s3c24xx_timer,