diff options
Diffstat (limited to 'arch/arm/mach-s3c6410')
-rw-r--r-- | arch/arm/mach-s3c6410/Kconfig | 10 | ||||
-rw-r--r-- | arch/arm/mach-s3c6410/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-s3c6410/cpu.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-s3c6410/mach-hmt.c | 276 | ||||
-rw-r--r-- | arch/arm/mach-s3c6410/mach-ncp.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-s3c6410/mach-smdk6410.c | 26 |
6 files changed, 310 insertions, 9 deletions
diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig index e63aac7f4e5a..f9d0f09f9761 100644 --- a/arch/arm/mach-s3c6410/Kconfig +++ b/arch/arm/mach-s3c6410/Kconfig | |||
@@ -97,3 +97,13 @@ config MACH_NCP | |||
97 | select S3C64XX_SETUP_I2C1 | 97 | select S3C64XX_SETUP_I2C1 |
98 | help | 98 | help |
99 | Machine support for the Samsung NCP | 99 | Machine support for the Samsung NCP |
100 | |||
101 | config MACH_HMT | ||
102 | bool "Airgoo HMT" | ||
103 | select CPU_S3C6410 | ||
104 | select S3C_DEV_FB | ||
105 | select S3C_DEV_USB_HOST | ||
106 | select S3C64XX_SETUP_FB_24BPP | ||
107 | select HAVE_PWM | ||
108 | help | ||
109 | Machine support for the Airgoo HMT | ||
diff --git a/arch/arm/mach-s3c6410/Makefile b/arch/arm/mach-s3c6410/Makefile index 6f9deac88612..3e48c3dbf973 100644 --- a/arch/arm/mach-s3c6410/Makefile +++ b/arch/arm/mach-s3c6410/Makefile | |||
@@ -23,5 +23,4 @@ obj-$(CONFIG_S3C6410_SETUP_SDHCI) += setup-sdhci.o | |||
23 | obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o | 23 | obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o |
24 | obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o | 24 | obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o |
25 | obj-$(CONFIG_MACH_NCP) += mach-ncp.o | 25 | obj-$(CONFIG_MACH_NCP) += mach-ncp.o |
26 | 26 | obj-$(CONFIG_MACH_HMT) += mach-hmt.o | |
27 | |||
diff --git a/arch/arm/mach-s3c6410/cpu.c b/arch/arm/mach-s3c6410/cpu.c index ade904de8895..9b67c663d9d8 100644 --- a/arch/arm/mach-s3c6410/cpu.c +++ b/arch/arm/mach-s3c6410/cpu.c | |||
@@ -62,6 +62,8 @@ void __init s3c6410_map_io(void) | |||
62 | /* the i2c devices are directly compatible with s3c2440 */ | 62 | /* the i2c devices are directly compatible with s3c2440 */ |
63 | s3c_i2c0_setname("s3c2440-i2c"); | 63 | s3c_i2c0_setname("s3c2440-i2c"); |
64 | s3c_i2c1_setname("s3c2440-i2c"); | 64 | s3c_i2c1_setname("s3c2440-i2c"); |
65 | |||
66 | s3c_device_nand.name = "s3c6400-nand"; | ||
65 | } | 67 | } |
66 | 68 | ||
67 | void __init s3c6410_init_clocks(int xtal) | 69 | void __init s3c6410_init_clocks(int xtal) |
diff --git a/arch/arm/mach-s3c6410/mach-hmt.c b/arch/arm/mach-s3c6410/mach-hmt.c new file mode 100644 index 000000000000..c5741056193f --- /dev/null +++ b/arch/arm/mach-s3c6410/mach-hmt.c | |||
@@ -0,0 +1,276 @@ | |||
1 | /* mach-hmt.c - Platform code for Airgoo HMT | ||
2 | * | ||
3 | * Copyright 2009 Peter Korsgaard <jacmet@sunsite.dk> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | */ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/serial_core.h> | ||
14 | #include <linux/platform_device.h> | ||
15 | #include <linux/io.h> | ||
16 | #include <linux/i2c.h> | ||
17 | #include <linux/fb.h> | ||
18 | #include <linux/gpio.h> | ||
19 | #include <linux/delay.h> | ||
20 | #include <linux/leds.h> | ||
21 | #include <linux/pwm_backlight.h> | ||
22 | #include <linux/mtd/mtd.h> | ||
23 | #include <linux/mtd/partitions.h> | ||
24 | |||
25 | #include <asm/mach/arch.h> | ||
26 | #include <asm/mach/map.h> | ||
27 | #include <asm/mach/irq.h> | ||
28 | |||
29 | #include <mach/hardware.h> | ||
30 | #include <mach/regs-fb.h> | ||
31 | #include <mach/map.h> | ||
32 | |||
33 | #include <asm/irq.h> | ||
34 | #include <asm/mach-types.h> | ||
35 | |||
36 | #include <plat/regs-serial.h> | ||
37 | #include <plat/iic.h> | ||
38 | #include <plat/fb.h> | ||
39 | #include <plat/nand.h> | ||
40 | |||
41 | #include <plat/s3c6410.h> | ||
42 | #include <plat/clock.h> | ||
43 | #include <plat/devs.h> | ||
44 | #include <plat/cpu.h> | ||
45 | |||
46 | #define UCON S3C2410_UCON_DEFAULT | ||
47 | #define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE) | ||
48 | #define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) | ||
49 | |||
50 | static struct s3c2410_uartcfg hmt_uartcfgs[] __initdata = { | ||
51 | [0] = { | ||
52 | .hwport = 0, | ||
53 | .flags = 0, | ||
54 | .ucon = UCON, | ||
55 | .ulcon = ULCON, | ||
56 | .ufcon = UFCON, | ||
57 | }, | ||
58 | [1] = { | ||
59 | .hwport = 1, | ||
60 | .flags = 0, | ||
61 | .ucon = UCON, | ||
62 | .ulcon = ULCON, | ||
63 | .ufcon = UFCON, | ||
64 | }, | ||
65 | [2] = { | ||
66 | .hwport = 2, | ||
67 | .flags = 0, | ||
68 | .ucon = UCON, | ||
69 | .ulcon = ULCON, | ||
70 | .ufcon = UFCON, | ||
71 | }, | ||
72 | }; | ||
73 | |||
74 | static int hmt_bl_init(struct device *dev) | ||
75 | { | ||
76 | int ret; | ||
77 | |||
78 | ret = gpio_request(S3C64XX_GPB(4), "lcd backlight enable"); | ||
79 | if (!ret) | ||
80 | ret = gpio_direction_output(S3C64XX_GPB(4), 0); | ||
81 | |||
82 | return ret; | ||
83 | } | ||
84 | |||
85 | static int hmt_bl_notify(int brightness) | ||
86 | { | ||
87 | /* | ||
88 | * translate from CIELUV/CIELAB L*->brightness, E.G. from | ||
89 | * perceived luminance to light output. Assumes range 0..25600 | ||
90 | */ | ||
91 | if (brightness < 0x800) { | ||
92 | /* Y = Yn * L / 903.3 */ | ||
93 | brightness = (100*256 * brightness + 231245/2) / 231245; | ||
94 | } else { | ||
95 | /* Y = Yn * ((L + 16) / 116 )^3 */ | ||
96 | int t = (brightness*4 + 16*1024 + 58)/116; | ||
97 | brightness = 25 * ((t * t * t + 0x100000/2) / 0x100000); | ||
98 | } | ||
99 | |||
100 | gpio_set_value(S3C64XX_GPB(4), brightness); | ||
101 | |||
102 | return brightness; | ||
103 | } | ||
104 | |||
105 | static void hmt_bl_exit(struct device *dev) | ||
106 | { | ||
107 | gpio_free(S3C64XX_GPB(4)); | ||
108 | } | ||
109 | |||
110 | static struct platform_pwm_backlight_data hmt_backlight_data = { | ||
111 | .pwm_id = 1, | ||
112 | .max_brightness = 100 * 256, | ||
113 | .dft_brightness = 40 * 256, | ||
114 | .pwm_period_ns = 1000000000 / (100 * 256 * 20), | ||
115 | .init = hmt_bl_init, | ||
116 | .notify = hmt_bl_notify, | ||
117 | .exit = hmt_bl_exit, | ||
118 | |||
119 | }; | ||
120 | |||
121 | static struct platform_device hmt_backlight_device = { | ||
122 | .name = "pwm-backlight", | ||
123 | .dev = { | ||
124 | .parent = &s3c_device_timer[1].dev, | ||
125 | .platform_data = &hmt_backlight_data, | ||
126 | }, | ||
127 | }; | ||
128 | |||
129 | static struct s3c_fb_pd_win hmt_fb_win0 = { | ||
130 | .win_mode = { | ||
131 | .pixclock = 41094, | ||
132 | .left_margin = 8, | ||
133 | .right_margin = 13, | ||
134 | .upper_margin = 7, | ||
135 | .lower_margin = 5, | ||
136 | .hsync_len = 3, | ||
137 | .vsync_len = 1, | ||
138 | .xres = 800, | ||
139 | .yres = 480, | ||
140 | }, | ||
141 | .max_bpp = 32, | ||
142 | .default_bpp = 16, | ||
143 | }; | ||
144 | |||
145 | /* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */ | ||
146 | static struct s3c_fb_platdata hmt_lcd_pdata __initdata = { | ||
147 | .setup_gpio = s3c64xx_fb_gpio_setup_24bpp, | ||
148 | .win[0] = &hmt_fb_win0, | ||
149 | .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, | ||
150 | .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, | ||
151 | }; | ||
152 | |||
153 | static struct mtd_partition hmt_nand_part[] = { | ||
154 | [0] = { | ||
155 | .name = "uboot", | ||
156 | .size = SZ_512K, | ||
157 | .offset = 0, | ||
158 | }, | ||
159 | [1] = { | ||
160 | .name = "uboot-env1", | ||
161 | .size = SZ_256K, | ||
162 | .offset = SZ_512K, | ||
163 | }, | ||
164 | [2] = { | ||
165 | .name = "uboot-env2", | ||
166 | .size = SZ_256K, | ||
167 | .offset = SZ_512K + SZ_256K, | ||
168 | }, | ||
169 | [3] = { | ||
170 | .name = "kernel", | ||
171 | .size = SZ_2M, | ||
172 | .offset = SZ_1M, | ||
173 | }, | ||
174 | [4] = { | ||
175 | .name = "rootfs", | ||
176 | .size = MTDPART_SIZ_FULL, | ||
177 | .offset = SZ_1M + SZ_2M, | ||
178 | }, | ||
179 | }; | ||
180 | |||
181 | static struct s3c2410_nand_set hmt_nand_sets[] = { | ||
182 | [0] = { | ||
183 | .name = "nand", | ||
184 | .nr_chips = 1, | ||
185 | .nr_partitions = ARRAY_SIZE(hmt_nand_part), | ||
186 | .partitions = hmt_nand_part, | ||
187 | }, | ||
188 | }; | ||
189 | |||
190 | static struct s3c2410_platform_nand hmt_nand_info = { | ||
191 | .tacls = 25, | ||
192 | .twrph0 = 55, | ||
193 | .twrph1 = 40, | ||
194 | .nr_sets = ARRAY_SIZE(hmt_nand_sets), | ||
195 | .sets = hmt_nand_sets, | ||
196 | }; | ||
197 | |||
198 | static struct gpio_led hmt_leds[] = { | ||
199 | { /* left function keys */ | ||
200 | .name = "left:blue", | ||
201 | .gpio = S3C64XX_GPO(12), | ||
202 | .default_trigger = "default-on", | ||
203 | }, | ||
204 | { /* right function keys - red */ | ||
205 | .name = "right:red", | ||
206 | .gpio = S3C64XX_GPO(13), | ||
207 | }, | ||
208 | { /* right function keys - green */ | ||
209 | .name = "right:green", | ||
210 | .gpio = S3C64XX_GPO(14), | ||
211 | }, | ||
212 | { /* right function keys - blue */ | ||
213 | .name = "right:blue", | ||
214 | .gpio = S3C64XX_GPO(15), | ||
215 | .default_trigger = "default-on", | ||
216 | }, | ||
217 | }; | ||
218 | |||
219 | static struct gpio_led_platform_data hmt_led_data = { | ||
220 | .num_leds = ARRAY_SIZE(hmt_leds), | ||
221 | .leds = hmt_leds, | ||
222 | }; | ||
223 | |||
224 | static struct platform_device hmt_leds_device = { | ||
225 | .name = "leds-gpio", | ||
226 | .id = -1, | ||
227 | .dev.platform_data = &hmt_led_data, | ||
228 | }; | ||
229 | |||
230 | static struct map_desc hmt_iodesc[] = {}; | ||
231 | |||
232 | static struct platform_device *hmt_devices[] __initdata = { | ||
233 | &s3c_device_i2c0, | ||
234 | &s3c_device_nand, | ||
235 | &s3c_device_fb, | ||
236 | &s3c_device_usb, | ||
237 | &s3c_device_timer[1], | ||
238 | &hmt_backlight_device, | ||
239 | &hmt_leds_device, | ||
240 | }; | ||
241 | |||
242 | static void __init hmt_map_io(void) | ||
243 | { | ||
244 | s3c64xx_init_io(hmt_iodesc, ARRAY_SIZE(hmt_iodesc)); | ||
245 | s3c24xx_init_clocks(12000000); | ||
246 | s3c24xx_init_uarts(hmt_uartcfgs, ARRAY_SIZE(hmt_uartcfgs)); | ||
247 | } | ||
248 | |||
249 | static void __init hmt_machine_init(void) | ||
250 | { | ||
251 | s3c_i2c0_set_platdata(NULL); | ||
252 | s3c_fb_set_platdata(&hmt_lcd_pdata); | ||
253 | s3c_device_nand.dev.platform_data = &hmt_nand_info; | ||
254 | |||
255 | gpio_request(S3C64XX_GPC(7), "usb power"); | ||
256 | gpio_direction_output(S3C64XX_GPC(7), 0); | ||
257 | gpio_request(S3C64XX_GPM(0), "usb power"); | ||
258 | gpio_direction_output(S3C64XX_GPM(0), 1); | ||
259 | gpio_request(S3C64XX_GPK(7), "usb power"); | ||
260 | gpio_direction_output(S3C64XX_GPK(7), 1); | ||
261 | gpio_request(S3C64XX_GPF(13), "usb power"); | ||
262 | gpio_direction_output(S3C64XX_GPF(13), 1); | ||
263 | |||
264 | platform_add_devices(hmt_devices, ARRAY_SIZE(hmt_devices)); | ||
265 | } | ||
266 | |||
267 | MACHINE_START(HMT, "Airgoo-HMT") | ||
268 | /* Maintainer: Peter Korsgaard <jacmet@sunsite.dk> */ | ||
269 | .phys_io = S3C_PA_UART & 0xfff00000, | ||
270 | .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc, | ||
271 | .boot_params = S3C64XX_PA_SDRAM + 0x100, | ||
272 | .init_irq = s3c6410_init_irq, | ||
273 | .map_io = hmt_map_io, | ||
274 | .init_machine = hmt_machine_init, | ||
275 | .timer = &s3c24xx_timer, | ||
276 | MACHINE_END | ||
diff --git a/arch/arm/mach-s3c6410/mach-ncp.c b/arch/arm/mach-s3c6410/mach-ncp.c index 6030636f8548..55e9bbfaf68b 100644 --- a/arch/arm/mach-s3c6410/mach-ncp.c +++ b/arch/arm/mach-s3c6410/mach-ncp.c | |||
@@ -79,7 +79,7 @@ static struct platform_device *ncp_devices[] __initdata = { | |||
79 | &s3c_device_i2c0, | 79 | &s3c_device_i2c0, |
80 | }; | 80 | }; |
81 | 81 | ||
82 | struct map_desc ncp_iodesc[] = {}; | 82 | static struct map_desc ncp_iodesc[] __initdata = {}; |
83 | 83 | ||
84 | static void __init ncp_map_io(void) | 84 | static void __init ncp_map_io(void) |
85 | { | 85 | { |
diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c index bc9a7dea567f..ea51dbe76e3e 100644 --- a/arch/arm/mach-s3c6410/mach-smdk6410.c +++ b/arch/arm/mach-s3c6410/mach-smdk6410.c | |||
@@ -65,16 +65,30 @@ static struct s3c2410_uartcfg smdk6410_uartcfgs[] __initdata = { | |||
65 | [0] = { | 65 | [0] = { |
66 | .hwport = 0, | 66 | .hwport = 0, |
67 | .flags = 0, | 67 | .flags = 0, |
68 | .ucon = 0x3c5, | 68 | .ucon = UCON, |
69 | .ulcon = 0x03, | 69 | .ulcon = ULCON, |
70 | .ufcon = 0x51, | 70 | .ufcon = UFCON, |
71 | }, | 71 | }, |
72 | [1] = { | 72 | [1] = { |
73 | .hwport = 1, | 73 | .hwport = 1, |
74 | .flags = 0, | 74 | .flags = 0, |
75 | .ucon = 0x3c5, | 75 | .ucon = UCON, |
76 | .ulcon = 0x03, | 76 | .ulcon = ULCON, |
77 | .ufcon = 0x51, | 77 | .ufcon = UFCON, |
78 | }, | ||
79 | [2] = { | ||
80 | .hwport = 2, | ||
81 | .flags = 0, | ||
82 | .ucon = UCON, | ||
83 | .ulcon = ULCON, | ||
84 | .ufcon = UFCON, | ||
85 | }, | ||
86 | [3] = { | ||
87 | .hwport = 3, | ||
88 | .flags = 0, | ||
89 | .ucon = UCON, | ||
90 | .ulcon = ULCON, | ||
91 | .ufcon = UFCON, | ||
78 | }, | 92 | }, |
79 | }; | 93 | }; |
80 | 94 | ||