Commit | Line | Data |
---|---|---|
87c4122f | 1 | /* |
431107ea | 2 | * linux/arch/arm/mach-s3c64xx/mach-ncp.c |
87c4122f KP |
3 | * |
4 | * Copyright (C) 2008-2009 Samsung Electronics | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License version 2 as | |
8 | * published by the Free Software Foundation. | |
9 | * | |
10 | */ | |
11 | ||
12 | #include <linux/kernel.h> | |
13 | #include <linux/types.h> | |
14 | #include <linux/interrupt.h> | |
15 | #include <linux/list.h> | |
16 | #include <linux/timer.h> | |
17 | #include <linux/init.h> | |
18 | #include <linux/serial_core.h> | |
334a1c70 | 19 | #include <linux/serial_s3c.h> |
87c4122f KP |
20 | #include <linux/platform_device.h> |
21 | #include <linux/io.h> | |
22 | #include <linux/i2c.h> | |
23 | #include <linux/fb.h> | |
24 | #include <linux/gpio.h> | |
25 | #include <linux/delay.h> | |
26 | ||
27 | #include <video/platform_lcd.h> | |
5a213a55 | 28 | #include <video/samsung_fimd.h> |
87c4122f KP |
29 | |
30 | #include <asm/mach/arch.h> | |
31 | #include <asm/mach/map.h> | |
32 | #include <asm/mach/irq.h> | |
33 | ||
ba279044 | 34 | #include <mach/irqs.h> |
87c4122f | 35 | #include <mach/hardware.h> |
87c4122f KP |
36 | #include <mach/map.h> |
37 | ||
38 | #include <asm/irq.h> | |
39 | #include <asm/mach-types.h> | |
40 | ||
436d42c6 | 41 | #include <linux/platform_data/i2c-s3c2410.h> |
87c4122f KP |
42 | #include <plat/fb.h> |
43 | ||
87c4122f KP |
44 | #include <plat/devs.h> |
45 | #include <plat/cpu.h> | |
04a49b71 | 46 | #include <plat/samsung-time.h> |
87c4122f | 47 | |
b024043b KK |
48 | #include "common.h" |
49 | ||
87c4122f KP |
50 | #define UCON S3C2410_UCON_DEFAULT |
51 | #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | |
52 | #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE | |
53 | ||
54 | static struct s3c2410_uartcfg ncp_uartcfgs[] __initdata = { | |
55 | /* REVISIT: NCP uses only serial 1, 2 */ | |
56 | [0] = { | |
57 | .hwport = 0, | |
58 | .flags = 0, | |
59 | .ucon = UCON, | |
60 | .ulcon = ULCON, | |
61 | .ufcon = UFCON, | |
62 | }, | |
63 | [1] = { | |
64 | .hwport = 1, | |
65 | .flags = 0, | |
66 | .ucon = UCON, | |
67 | .ulcon = ULCON, | |
68 | .ufcon = UFCON, | |
69 | }, | |
70 | [2] = { | |
71 | .hwport = 2, | |
72 | .flags = 0, | |
73 | .ucon = UCON, | |
74 | .ulcon = ULCON, | |
75 | .ufcon = UFCON, | |
76 | }, | |
77 | }; | |
78 | ||
79 | static struct platform_device *ncp_devices[] __initdata = { | |
80 | &s3c_device_hsmmc1, | |
81 | &s3c_device_i2c0, | |
82 | }; | |
83 | ||
4d4e2bc2 | 84 | static struct map_desc ncp_iodesc[] __initdata = {}; |
87c4122f KP |
85 | |
86 | static void __init ncp_map_io(void) | |
87 | { | |
88 | s3c64xx_init_io(ncp_iodesc, ARRAY_SIZE(ncp_iodesc)); | |
b69f460d | 89 | s3c64xx_set_xtal_freq(12000000); |
87c4122f | 90 | s3c24xx_init_uarts(ncp_uartcfgs, ARRAY_SIZE(ncp_uartcfgs)); |
04a49b71 | 91 | samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4); |
87c4122f KP |
92 | } |
93 | ||
94 | static void __init ncp_machine_init(void) | |
95 | { | |
96 | s3c_i2c0_set_platdata(NULL); | |
97 | ||
98 | platform_add_devices(ncp_devices, ARRAY_SIZE(ncp_devices)); | |
99 | } | |
100 | ||
101 | MACHINE_START(NCP, "NCP") | |
102 | /* Maintainer: Samsung Electronics */ | |
170a5908 | 103 | .atag_offset = 0x100, |
ba279044 | 104 | .nr_irqs = S3C64XX_NR_IRQS, |
87c4122f KP |
105 | .init_irq = s3c6410_init_irq, |
106 | .map_io = ncp_map_io, | |
107 | .init_machine = ncp_machine_init, | |
04a49b71 | 108 | .init_time = samsung_timer_init, |
ff84ded2 | 109 | .restart = s3c64xx_restart, |
87c4122f | 110 | MACHINE_END |