[ar71xx] create firmware image for the Ubiquiti LS-SR71 board
[openwrt.git] / target / linux / s3c24xx / patches-2.6.24 / 1011-gta01-core.patch.patch
1 From 4b0762543b611b44e96ace4feb80e2b4775ea000 Mon Sep 17 00:00:00 2001
2 From: mokopatches <mokopatches@openmoko.org>
3 Date: Fri, 4 Apr 2008 11:31:03 +0100
4 Subject: [PATCH] gta01-core.patch
5  This patch adds support for the FIC Neo1973 GTA01 machine type to the ARM port
6  of the Linux kernel.
7
8 Signed-off-by: Harald Welte <laforge@openmoko.org>
9 ---
10  MAINTAINERS                          |    8 +
11  arch/arm/mach-s3c2410/Kconfig        |    8 +
12  arch/arm/mach-s3c2410/Makefile       |    1 +
13  arch/arm/mach-s3c2410/mach-gta01.c   |  658 ++++++++++++++++++++++++++++++++++
14  arch/arm/plat-s3c24xx/Kconfig        |    5 +
15  include/asm-arm/arch-s3c2410/gta01.h |   70 ++++
16  6 files changed, 750 insertions(+), 0 deletions(-)
17  create mode 100644 arch/arm/mach-s3c2410/mach-gta01.c
18  create mode 100644 include/asm-arm/arch-s3c2410/gta01.h
19
20 diff --git a/MAINTAINERS b/MAINTAINERS
21 index 2340cfb..4538694 100644
22 --- a/MAINTAINERS
23 +++ b/MAINTAINERS
24 @@ -1536,6 +1536,14 @@ P:       Akinobu Mita
25  M:     akinobu.mita@gmail.com
26  S:     Supported
27  
28 +FIC/OPENMOKO NEO1973 GSM PHONE
29 +P:     Harald Welte
30 +M:     laforge@openmoko.org
31 +L:     openmoko-kernel@lists.openmoko.org
32 +W:     http://wiki.openmoko.org/wiki/Kernel
33 +W:     http://wiki.openmoko.org/wiki/Neo1973
34 +S:     Maintained
35 +
36  FRAMEBUFFER LAYER
37  P:     Antonino Daplas
38  M:     adaplas@gmail.com
39 diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
40 index e2079cf..a2acd65 100644
41 --- a/arch/arm/mach-s3c2410/Kconfig
42 +++ b/arch/arm/mach-s3c2410/Kconfig
43 @@ -110,5 +110,13 @@ config MACH_QT2410
44         help
45            Say Y here if you are using the Armzone QT2410
46  
47 +config MACH_NEO1973_GTA01
48 +       bool "FIC Neo1973 GSM Phone (GTA01 Hardware)"
49 +       select CPU_S3C2410
50 +       select MACH_NEO1973
51 +       select SENSORS_PCF50606
52 +       help
53 +          Say Y here if you are using the FIC Neo1973 GSM Phone
54 +
55  endmenu
56  
57 diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile
58 index 3e7a855..8952a8d 100644
59 --- a/arch/arm/mach-s3c2410/Makefile
60 +++ b/arch/arm/mach-s3c2410/Makefile
61 @@ -29,3 +29,4 @@ obj-$(CONFIG_MACH_AML_M5900)  += mach-amlm5900.o
62  obj-$(CONFIG_BAST_PC104_IRQ)   += bast-irq.o
63  obj-$(CONFIG_MACH_VR1000)      += mach-vr1000.o usb-simtec.o
64  obj-$(CONFIG_MACH_QT2410)      += mach-qt2410.o
65 +obj-$(CONFIG_MACH_NEO1973_GTA01)+= mach-gta01.o
66 diff --git a/arch/arm/mach-s3c2410/mach-gta01.c b/arch/arm/mach-s3c2410/mach-gta01.c
67 new file mode 100644
68 index 0000000..e690ed7
69 --- /dev/null
70 +++ b/arch/arm/mach-s3c2410/mach-gta01.c
71 @@ -0,0 +1,658 @@
72 +/*
73 + * linux/arch/arm/mach-s3c2410/mach-gta01.c
74 + *
75 + * S3C2410 Machine Support for the FIC Neo1973 GTA01
76 + *
77 + * Copyright (C) 2006-2007 by OpenMoko, Inc.
78 + * Author: Harald Welte <laforge@openmoko.org>
79 + * All rights reserved.
80 + *
81 + * This program is free software; you can redistribute it and/or
82 + * modify it under the terms of the GNU General Public License as
83 + * published by the Free Software Foundation; either version 2 of
84 + * the License, or (at your option) any later version.
85 + *
86 + * This program is distributed in the hope that it will be useful,
87 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
88 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
89 + * GNU General Public License for more details.
90 + *
91 + * You should have received a copy of the GNU General Public License
92 + * along with this program; if not, write to the Free Software
93 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
94 + * MA 02111-1307 USA
95 + *
96 + */
97 +
98 +#include <linux/kernel.h>
99 +#include <linux/types.h>
100 +#include <linux/interrupt.h>
101 +#include <linux/list.h>
102 +#include <linux/timer.h>
103 +#include <linux/init.h>
104 +#include <linux/workqueue.h>
105 +#include <linux/platform_device.h>
106 +#include <linux/serial_core.h>
107 +#include <linux/spi/spi.h>
108 +#include <linux/spi/spi_bitbang.h>
109 +#include <linux/mmc/mmc.h>
110 +#include <linux/mmc/host.h>
111 +
112 +#include <linux/mtd/mtd.h>
113 +#include <linux/mtd/nand.h>
114 +#include <linux/mtd/nand_ecc.h>
115 +#include <linux/mtd/partitions.h>
116 +
117 +#include <linux/mmc/host.h>
118 +
119 +#include <linux/pcf50606.h>
120 +
121 +#include <asm/mach/arch.h>
122 +#include <asm/mach/map.h>
123 +#include <asm/mach/irq.h>
124 +
125 +#include <asm/hardware.h>
126 +#include <asm/io.h>
127 +#include <asm/irq.h>
128 +#include <asm/mach-types.h>
129 +
130 +#include <asm/arch/regs-gpio.h>
131 +#include <asm/arch/fb.h>
132 +#include <asm/arch/spi.h>
133 +#include <asm/arch/spi-gpio.h>
134 +#include <asm/arch/usb-control.h>
135 +
136 +#include <asm/arch/gta01.h>
137 +
138 +#include <asm/plat-s3c/regs-serial.h>
139 +#include <asm/plat-s3c/nand.h>
140 +#include <asm/plat-s3c24xx/devs.h>
141 +#include <asm/plat-s3c24xx/cpu.h>
142 +#include <asm/plat-s3c24xx/pm.h>
143 +#include <asm/plat-s3c24xx/udc.h>
144 +
145 +static struct map_desc gta01_iodesc[] __initdata = {
146 +       {
147 +               .virtual        = 0xe0000000,
148 +               .pfn            = __phys_to_pfn(S3C2410_CS3+0x01000000),
149 +               .length         = SZ_1M,
150 +               .type           = MT_DEVICE
151 +       },
152 +};
153 +
154 +#define UCON S3C2410_UCON_DEFAULT
155 +#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
156 +#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
157 +
158 +static struct s3c2410_uartcfg gta01_uartcfgs[] = {
159 +       [0] = {
160 +               .hwport      = 0,
161 +               .flags       = 0,
162 +               .ucon        = UCON,
163 +               .ulcon       = ULCON,
164 +               .ufcon       = UFCON,
165 +       },
166 +       [1] = {
167 +               .hwport      = 1,
168 +               .flags       = 0,
169 +               .ucon        = UCON,
170 +               .ulcon       = ULCON,
171 +               .ufcon       = UFCON,
172 +       },
173 +};
174 +
175 +/* PMU driver info */
176 +
177 +static int pmu_callback(struct device *dev, unsigned int feature,
178 +                       enum pmu_event event)
179 +{
180 +       switch (feature) {
181 +       case PCF50606_FEAT_ACD:
182 +               switch (event) {
183 +               case PMU_EVT_INSERT:
184 +                       pcf50606_charge_fast(pcf50606_global, 1);
185 +                       break;
186 +               case PMU_EVT_REMOVE:
187 +                       pcf50606_charge_fast(pcf50606_global, 0);
188 +                       break;
189 +               default:
190 +                       break;
191 +               }
192 +               break;
193 +       default:
194 +               break;
195 +       }
196 +
197 +       return 0;
198 +}
199 +
200 +static struct pcf50606_platform_data gta01_pcf_pdata = {
201 +       .used_features  = PCF50606_FEAT_EXTON |
202 +                         PCF50606_FEAT_MBC |
203 +                         PCF50606_FEAT_BBC |
204 +                         PCF50606_FEAT_RTC |
205 +                         PCF50606_FEAT_WDT |
206 +                         PCF50606_FEAT_CHGCUR |
207 +                         PCF50606_FEAT_BATVOLT |
208 +                         PCF50606_FEAT_BATTEMP,
209 +       .onkey_seconds_required = 3,
210 +       .cb             = &pmu_callback,
211 +       .r_fix_batt     = 10000,
212 +       .r_fix_batt_par = 10000,
213 +       .r_sense_milli  = 220,
214 +       .rails  = {
215 +               [PCF50606_REGULATOR_D1REG] = {
216 +                       .name           = "bt_3v15",
217 +                       .voltage        = {
218 +                               .init   = 3150,
219 +                               .max    = 3150,
220 +                       },
221 +               },
222 +               [PCF50606_REGULATOR_D2REG] = {
223 +                       .name           = "gl_2v5",
224 +                       .voltage        = {
225 +                               .init   = 2500,
226 +                               .max    = 2500,
227 +                       },
228 +               },
229 +               [PCF50606_REGULATOR_D3REG] = {
230 +                       .name           = "stby_1v8",
231 +                       .flags          = PMU_VRAIL_F_SUSPEND_ON,
232 +                       .voltage        = {
233 +                               .init   = 1800,
234 +                               .max    = 2100,
235 +                       },
236 +               },
237 +               [PCF50606_REGULATOR_DCD] = {
238 +                       .name           = "gl_1v5",
239 +                       .voltage        = {
240 +                               .init   = 1500,
241 +                               .max    = 1500,
242 +                       },
243 +               },
244 +               [PCF50606_REGULATOR_DCDE] = {
245 +                       .name           = "io_3v3",
246 +                       .flags          = PMU_VRAIL_F_SUSPEND_ON,
247 +                       .voltage        = {
248 +                               .init   = 3300,
249 +                               .max    = 3330,
250 +                       },
251 +               },
252 +               [PCF50606_REGULATOR_DCUD] = {
253 +                       .name           = "core_1v8",
254 +                       .flags          = PMU_VRAIL_F_SUSPEND_ON,
255 +                       .voltage        = {
256 +                               .init   = 2100,
257 +                               .max    = 2100,
258 +                       },
259 +               },
260 +               [PCF50606_REGULATOR_IOREG] = {
261 +                       .name           = "codec_3v3",
262 +                       .voltage        = {
263 +                               .init   = 3300,
264 +                               .max    = 3300,
265 +                       },
266 +               },
267 +               [PCF50606_REGULATOR_LPREG] = {
268 +                       .name           = "lcm_3v3",
269 +                       .voltage        = {
270 +                               .init   = 3300,
271 +                               .max    = 3300,
272 +                       },
273 +               }
274 +       },
275 +};
276 +
277 +static void cfg_pmu_vrail(struct pmu_voltage_rail *vrail, char *name,
278 +                         unsigned int flags, unsigned int init,
279 +                         unsigned int max)
280 +{
281 +       vrail->name = name;
282 +       vrail->flags = flags;
283 +       vrail->voltage.init = init;
284 +       vrail->voltage.max = max;
285 +}
286 +
287 +static void mangle_pmu_pdata_by_system_rev(void)
288 +{
289 +       switch (system_rev) {
290 +       case GTA01Bv4_SYSTEM_REV:
291 +               gta01_pcf_pdata.used_features |= PCF50606_FEAT_ACD;
292 +               break;
293 +       case GTA01Bv3_SYSTEM_REV:
294 +       case GTA01Bv2_SYSTEM_REV:
295 +               gta01_pcf_pdata.rails[PCF50606_REGULATOR_D3REG]
296 +                                       .name = "user1";
297 +               gta01_pcf_pdata.rails[PCF50606_REGULATOR_D3REG]
298 +                                       .flags &= ~PMU_VRAIL_F_SUSPEND_ON;
299 +               gta01_pcf_pdata.rails[PCF50606_REGULATOR_D3REG]
300 +                                       .flags = PMU_VRAIL_F_UNUSED;
301 +               break;
302 +       case GTA01v4_SYSTEM_REV:
303 +               cfg_pmu_vrail(&gta01_pcf_pdata.rails[PCF50606_REGULATOR_DCUD],
304 +                             "core_1v8", PMU_VRAIL_F_SUSPEND_ON, 1800, 1800);
305 +               cfg_pmu_vrail(&gta01_pcf_pdata.rails[PCF50606_REGULATOR_D1REG],
306 +                             "vrf_3v", 0, 3000, 3000);
307 +               cfg_pmu_vrail(&gta01_pcf_pdata.rails[PCF50606_REGULATOR_D3REG],
308 +                             "vtcxo_2v8", 0, 2800, 2800);
309 +               cfg_pmu_vrail(&gta01_pcf_pdata.rails[PCF50606_REGULATOR_DCD],
310 +                             "gl_3v5", 0, 3500, 3500);
311 +               break;
312 +       case GTA01v3_SYSTEM_REV:
313 +               cfg_pmu_vrail(&gta01_pcf_pdata.rails[PCF50606_REGULATOR_D1REG],
314 +                             "vrf_3v", 0, 3000, 3000);
315 +               cfg_pmu_vrail(&gta01_pcf_pdata.rails[PCF50606_REGULATOR_D2REG],
316 +                             "sd_3v3", 0, 3300, 3300);
317 +               cfg_pmu_vrail(&gta01_pcf_pdata.rails[PCF50606_REGULATOR_D3REG],
318 +                             "codec_3v3", 0, 3300, 3300);
319 +               cfg_pmu_vrail(&gta01_pcf_pdata.rails[PCF50606_REGULATOR_DCD],
320 +                             "gpsio_3v3", 0, 3300, 3300);
321 +               cfg_pmu_vrail(&gta01_pcf_pdata.rails[PCF50606_REGULATOR_DCUD],
322 +                             "core_1v8", PMU_VRAIL_F_SUSPEND_ON, 1800, 1800);
323 +               cfg_pmu_vrail(&gta01_pcf_pdata.rails[PCF50606_REGULATOR_IOREG],
324 +                             "vtcxo_2v8", 0, 2800, 2800);
325 +               break;
326 +       }
327 +}
328 +
329 +static struct resource gta01_pmu_resources[] = {
330 +       [0] = {
331 +               .flags  = IORESOURCE_IRQ,
332 +               .start  = GTA01_IRQ_PCF50606,
333 +               .end    = GTA01_IRQ_PCF50606,
334 +       },
335 +};
336 +
337 +struct platform_device gta01_pmu_dev = {
338 +       .name           = "pcf50606",
339 +       .num_resources  = ARRAY_SIZE(gta01_pmu_resources),
340 +       .resource       = gta01_pmu_resources,
341 +       .dev            = {
342 +               .platform_data = &gta01_pcf_pdata,
343 +       },
344 +};
345 +
346 +/* LCD driver info */
347 +
348 +/* Configuration for 480x640 toppoly TD028TTEC1.
349 + * Do not mark this as __initdata or it will break! */
350 +static struct s3c2410fb_display gta01_displays[] =  {
351 +       {
352 +               .type           = S3C2410_LCDCON1_TFT,
353 +               .width          = 43,
354 +               .height         = 58,
355 +               .xres           = 480,
356 +               .yres           = 640,
357 +               .bpp            = 16,
358 +
359 +               .pixclock       = 40000,        /* HCLK/4 */
360 +               .left_margin    = 104,
361 +               .right_margin   = 8,
362 +               .hsync_len      = 8,
363 +               .upper_margin   = 2,
364 +               .lower_margin   = 16,
365 +               .vsync_len      = 2,
366 +               .lcdcon5        = S3C2410_LCDCON5_FRM565 |
367 +                                 S3C2410_LCDCON5_INVVCLK |
368 +                                 S3C2410_LCDCON5_INVVLINE |
369 +                                 S3C2410_LCDCON5_INVVFRAME |
370 +                                 S3C2410_LCDCON5_PWREN |
371 +                                 S3C2410_LCDCON5_HWSWP,
372 +       },
373 +       {
374 +               .type           = S3C2410_LCDCON1_TFT,
375 +               .width          = 43,
376 +               .height         = 58,
377 +               .xres           = 480,
378 +               .yres           = 640,
379 +               .bpp            = 32,
380 +
381 +               .pixclock       = 40000,        /* HCLK/4 */
382 +               .left_margin    = 104,
383 +               .right_margin   = 8,
384 +               .hsync_len      = 8,
385 +               .upper_margin   = 2,
386 +               .lower_margin   = 16,
387 +               .vsync_len      = 2,
388 +               .lcdcon5        = S3C2410_LCDCON5_FRM565 |
389 +                                 S3C2410_LCDCON5_INVVCLK |
390 +                                 S3C2410_LCDCON5_INVVLINE |
391 +                                 S3C2410_LCDCON5_INVVFRAME |
392 +                                 S3C2410_LCDCON5_PWREN |
393 +                                 S3C2410_LCDCON5_HWSWP,
394 +       },
395 +       {
396 +               .type           = S3C2410_LCDCON1_TFT,
397 +               .width          = 43,
398 +               .height         = 58,
399 +               .xres           = 240,
400 +               .yres           = 320,
401 +               .bpp            = 16,
402 +
403 +               .pixclock       = 40000,        /* HCLK/4 */
404 +               .left_margin    = 104,
405 +               .right_margin   = 8,
406 +               .hsync_len      = 8,
407 +               .upper_margin   = 2,
408 +               .lower_margin   = 16,
409 +               .vsync_len      = 2,
410 +               .lcdcon5        = S3C2410_LCDCON5_FRM565 |
411 +                                 S3C2410_LCDCON5_INVVCLK |
412 +                                 S3C2410_LCDCON5_INVVLINE |
413 +                                 S3C2410_LCDCON5_INVVFRAME |
414 +                                 S3C2410_LCDCON5_PWREN |
415 +                                 S3C2410_LCDCON5_HWSWP,
416 +       },
417 +};
418 +
419 +static struct s3c2410fb_mach_info gta01_lcd_cfg __initdata = {
420 +       .displays       = gta01_displays,
421 +       .num_displays   = ARRAY_SIZE(gta01_displays),
422 +       .default_display = 0,
423 +
424 +       .lpcsel         = ((0xCE6) & ~7) | 1<<4,
425 +};
426 +
427 +static struct platform_device *gta01_devices[] __initdata = {
428 +       &s3c_device_usb,
429 +       &s3c_device_lcd,
430 +       &s3c_device_wdt,
431 +       &s3c_device_i2c,
432 +       &s3c_device_iis,
433 +       &s3c_device_sdi,
434 +       &s3c_device_usbgadget,
435 +       &s3c_device_nand,
436 +};
437 +
438 +static struct s3c2410_nand_set gta01_nand_sets[] = {
439 +       [0] = {
440 +               .name           = "neo1973-nand",
441 +               .nr_chips       = 1,
442 +               .flags          = S3C2410_NAND_BBT,
443 +       },
444 +};
445 +
446 +static struct s3c2410_platform_nand gta01_nand_info = {
447 +       .tacls          = 20,
448 +       .twrph0         = 60,
449 +       .twrph1         = 20,
450 +       .nr_sets        = ARRAY_SIZE(gta01_nand_sets),
451 +       .sets           = gta01_nand_sets,
452 +};
453 +
454 +static void gta01_udc_command(enum s3c2410_udc_cmd_e cmd)
455 +{
456 +       printk(KERN_DEBUG "%s(%d)\n", __func__, cmd);
457 +
458 +       switch (cmd) {
459 +       case S3C2410_UDC_P_ENABLE:
460 +               s3c2410_gpio_setpin(GTA01_GPIO_USB_PULLUP, 1);
461 +               break;
462 +       case S3C2410_UDC_P_DISABLE:
463 +               s3c2410_gpio_setpin(GTA01_GPIO_USB_PULLUP, 0);
464 +               break;
465 +       default:
466 +               break;
467 +       }
468 +}
469 +
470 +/* use a work queue, since I2C API inherently schedules
471 + * and we get called in hardirq context from UDC driver */
472 +
473 +struct vbus_draw {
474 +       struct work_struct work;
475 +       int ma;
476 +};
477 +static struct vbus_draw gta01_udc_vbus_drawer;
478 +
479 +static void __gta01_udc_vbus_draw(struct work_struct *work)
480 +{
481 +       /* this is a fix to work around boot-time ordering problems if the
482 +        * s3c2410_udc is initialized before the pcf50606 driver has defined
483 +        * pcf50606_global */
484 +       if (!pcf50606_global)
485 +               return;
486 +
487 +       if (gta01_udc_vbus_drawer.ma >= 500) {
488 +               /* enable fast charge */
489 +               printk(KERN_DEBUG "udc: enabling fast charge\n");
490 +               pcf50606_charge_fast(pcf50606_global, 1);
491 +       } else {
492 +               /* disable fast charge */
493 +               printk(KERN_DEBUG "udc: disabling fast charge\n");
494 +               pcf50606_charge_fast(pcf50606_global, 0);
495 +       }
496 +}
497 +
498 +static void gta01_udc_vbus_draw(unsigned int ma)
499 +{
500 +       gta01_udc_vbus_drawer.ma = ma;
501 +       schedule_work(&gta01_udc_vbus_drawer.work);
502 +}
503 +
504 +static struct s3c2410_udc_mach_info gta01_udc_cfg = {
505 +       .vbus_draw      = gta01_udc_vbus_draw,
506 +};
507 +
508 +/* SPI */
509 +
510 +static struct spi_board_info gta01_spi_board_info[] = {
511 +       {
512 +               .modalias       = "jbt6k74",
513 +               /* platform_data */
514 +               /* controller_data */
515 +               /* irq */
516 +               .max_speed_hz   = 10 * 1000 * 1000,
517 +               .bus_num        = 1,
518 +               /* chip_select */
519 +       },
520 +};
521 +
522 +static void spi_gpio_cs(struct s3c2410_spigpio_info *spi, int cs)
523 +{
524 +       switch (cs) {
525 +       case BITBANG_CS_ACTIVE:
526 +               s3c2410_gpio_setpin(S3C2410_GPG3, 0);
527 +               break;
528 +       case BITBANG_CS_INACTIVE:
529 +               s3c2410_gpio_setpin(S3C2410_GPG3, 1);
530 +               break;
531 +       }
532 +}
533 +
534 +static struct s3c2410_spigpio_info spi_gpio_cfg = {
535 +       .pin_clk        = S3C2410_GPG7,
536 +       .pin_mosi       = S3C2410_GPG6,
537 +       .pin_miso       = S3C2410_GPG5,
538 +       .board_size     = ARRAY_SIZE(gta01_spi_board_info),
539 +       .board_info     = gta01_spi_board_info,
540 +       .chip_select    = &spi_gpio_cs,
541 +};
542 +
543 +static struct resource s3c_spi_lcm_resource[] = {
544 +       [0] = {
545 +               .start = S3C2410_GPG3,
546 +               .end   = S3C2410_GPG3,
547 +       },
548 +       [1] = {
549 +               .start = S3C2410_GPG5,
550 +               .end   = S3C2410_GPG5,
551 +       },
552 +       [2] = {
553 +               .start = S3C2410_GPG6,
554 +               .end   = S3C2410_GPG6,
555 +       },
556 +       [3] = {
557 +               .start = S3C2410_GPG7,
558 +               .end   = S3C2410_GPG7,
559 +       },
560 +};
561 +
562 +struct platform_device s3c_device_spi_lcm = {
563 +       .name             = "s3c24xx-spi-gpio",
564 +       .id               = 1,
565 +       .num_resources    = ARRAY_SIZE(s3c_spi_lcm_resource),
566 +       .resource         = s3c_spi_lcm_resource,
567 +       .dev = {
568 +               .platform_data = &spi_gpio_cfg,
569 +       },
570 +};
571 +
572 +static struct gta01bl_machinfo backlight_machinfo = {
573 +       .default_intensity      = 1,
574 +       .max_intensity          = 1,
575 +       .limit_mask             = 1,
576 +};
577 +
578 +static struct resource gta01_bl_resources[] = {
579 +       [0] = {
580 +               .start  = GTA01_GPIO_BACKLIGHT,
581 +               .end    = GTA01_GPIO_BACKLIGHT,
582 +       },
583 +};
584 +
585 +struct platform_device gta01_bl_dev = {
586 +       .name           = "gta01-bl",
587 +       .num_resources  = ARRAY_SIZE(gta01_bl_resources),
588 +       .resource       = gta01_bl_resources,
589 +       .dev            = {
590 +               .platform_data = &backlight_machinfo,
591 +       },
592 +};
593 +
594 +static struct resource gta01_led_resources[] = {
595 +       [0] = {
596 +               .start  = GTA01_GPIO_VIBRATOR_ON,
597 +               .end    = GTA01_GPIO_VIBRATOR_ON,
598 +       },
599 +};
600 +
601 +struct platform_device gta01_led_dev = {
602 +       .name           = "neo1973-vibrator",
603 +       .num_resources  = ARRAY_SIZE(gta01_led_resources),
604 +       .resource       = gta01_led_resources,
605 +};
606 +
607 +static struct resource gta01_button_resources[] = {
608 +       [0] = {
609 +               .start = GTA01_GPIO_AUX_KEY,
610 +               .end   = GTA01_GPIO_AUX_KEY,
611 +       },
612 +       [1] = {
613 +               .start = GTA01_GPIO_HOLD_KEY,
614 +               .end   = GTA01_GPIO_HOLD_KEY,
615 +       },
616 +       [2] = {
617 +               .start = GTA01_GPIO_JACK_INSERT,
618 +               .end   = GTA01_GPIO_JACK_INSERT,
619 +       },
620 +};
621 +
622 +struct platform_device gta01_button_dev = {
623 +       .name           = "neo1973-button",
624 +       .num_resources  = ARRAY_SIZE(gta01_button_resources),
625 +       .resource       = gta01_button_resources,
626 +};
627 +
628 +static struct platform_device gta01_pm_gsm_dev = {
629 +       .name           = "neo1973-pm-gsm",
630 +};
631 +
632 +/* USB */
633 +static struct s3c2410_hcd_info gta01_usb_info = {
634 +       .port[0]        = {
635 +               .flags  = S3C_HCDFLG_USED,
636 +       },
637 +       .port[1]        = {
638 +               .flags  = 0,
639 +       },
640 +};
641 +
642 +static void __init gta01_map_io(void)
643 +{
644 +       s3c24xx_init_io(gta01_iodesc, ARRAY_SIZE(gta01_iodesc));
645 +       s3c24xx_init_clocks(12*1000*1000);
646 +       s3c24xx_init_uarts(gta01_uartcfgs, ARRAY_SIZE(gta01_uartcfgs));
647 +}
648 +
649 +static irqreturn_t gta01_modem_irq(int irq, void *param)
650 +{
651 +       printk(KERN_DEBUG "modem wakeup interrupt\n");
652 +       return IRQ_HANDLED;
653 +}
654 +
655 +static void __init gta01_machine_init(void)
656 +{
657 +       int rc;
658 +
659 +       if (system_rev == GTA01v4_SYSTEM_REV ||
660 +           system_rev == GTA01Bv2_SYSTEM_REV ||
661 +           system_rev == GTA01Bv3_SYSTEM_REV ||
662 +           system_rev == GTA01Bv4_SYSTEM_REV) {
663 +               gta01_udc_cfg.udc_command = gta01_udc_command;
664 +       }
665 +
666 +       s3c_device_usb.dev.platform_data = &gta01_usb_info;
667 +       s3c_device_nand.dev.platform_data = &gta01_nand_info;
668 +
669 +       s3c24xx_fb_set_platdata(&gta01_lcd_cfg);
670 +
671 +       INIT_WORK(&gta01_udc_vbus_drawer.work, __gta01_udc_vbus_draw);
672 +       s3c24xx_udc_set_platdata(&gta01_udc_cfg);
673 +
674 +       /* Set LCD_RESET / XRES to high */
675 +       s3c2410_gpio_cfgpin(S3C2410_GPC6, S3C2410_GPIO_OUTPUT);
676 +       s3c2410_gpio_setpin(S3C2410_GPC6, 1);
677 +
678 +       /* SPI chip select is gpio output */
679 +       s3c2410_gpio_cfgpin(S3C2410_GPG3, S3C2410_GPIO_OUTPUT);
680 +       s3c2410_gpio_setpin(S3C2410_GPG3, 1);
681 +       platform_device_register(&s3c_device_spi_lcm);
682 +
683 +       platform_device_register(&gta01_bl_dev);
684 +       platform_device_register(&gta01_button_dev);
685 +       platform_device_register(&gta01_pm_gsm_dev);
686 +
687 +       switch (system_rev) {
688 +       case GTA01v3_SYSTEM_REV:
689 +       case GTA01v4_SYSTEM_REV:
690 +               /* just use the default (GTA01_IRQ_PCF50606) */
691 +               break;
692 +       case GTA01Bv2_SYSTEM_REV:
693 +       case GTA01Bv3_SYSTEM_REV:
694 +               /* just use the default (GTA01_IRQ_PCF50606) */
695 +               gta01_led_resources[0].start =
696 +                       gta01_led_resources[0].end = GTA01Bv2_GPIO_VIBRATOR_ON;
697 +               break;
698 +       case GTA01Bv4_SYSTEM_REV:
699 +               gta01_pmu_resources[0].start =
700 +                       gta01_pmu_resources[0].end = GTA01Bv4_IRQ_PCF50606;
701 +               gta01_led_resources[0].start =
702 +                       gta01_led_resources[0].end = GTA01Bv4_GPIO_VIBRATOR_ON;
703 +               break;
704 +       }
705 +       mangle_pmu_pdata_by_system_rev();
706 +       platform_device_register(&gta01_pmu_dev);
707 +       platform_device_register(&gta01_led_dev);
708 +
709 +       platform_add_devices(gta01_devices, ARRAY_SIZE(gta01_devices));
710 +
711 +       s3c2410_pm_init();
712 +
713 +       set_irq_type(GTA01_IRQ_MODEM, IRQT_RISING);
714 +       rc = request_irq(GTA01_IRQ_MODEM, gta01_modem_irq, IRQF_DISABLED,
715 +                        "modem", NULL);
716 +       if (!rc)
717 +               printk(KERN_ERR  "GTA01: can't request GSM modem wakeup IRQ\n");
718 +       enable_irq_wake(GTA01_IRQ_MODEM);
719 +}
720 +
721 +MACHINE_START(NEO1973_GTA01, "GTA01")
722 +       .phys_io        = S3C2410_PA_UART,
723 +       .io_pg_offst    = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
724 +       .boot_params    = S3C2410_SDRAM_PA + 0x100,
725 +       .map_io         = gta01_map_io,
726 +       .init_irq       = s3c24xx_init_irq,
727 +       .init_machine   = gta01_machine_init,
728 +       .timer          = &s3c24xx_timer,
729 +MACHINE_END
730 diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
731 index b66fb3c..7ee4b82 100644
732 --- a/arch/arm/plat-s3c24xx/Kconfig
733 +++ b/arch/arm/plat-s3c24xx/Kconfig
734 @@ -46,4 +46,9 @@ config MACH_SMDK
735         help
736           Common machine code for SMDK2410 and SMDK2440
737  
738 +config MACH_NEO1973
739 +       bool
740 +       help
741 +         Common machine code for Neo1973 hardware
742 +
743  endif
744 diff --git a/include/asm-arm/arch-s3c2410/gta01.h b/include/asm-arm/arch-s3c2410/gta01.h
745 new file mode 100644
746 index 0000000..1cc2099
747 --- /dev/null
748 +++ b/include/asm-arm/arch-s3c2410/gta01.h
749 @@ -0,0 +1,70 @@
750 +#ifndef _GTA01_H
751 +#define _GTA01_H
752 +
753 +#include <asm/arch/regs-gpio.h>
754 +#include <asm/arch/irqs.h>
755 +
756 +/* Different hardware revisions, passed in ATAG_REVISION by u-boot */
757 +#define GTA01v3_SYSTEM_REV     0x00000130
758 +#define GTA01v4_SYSTEM_REV     0x00000140
759 +#define GTA01Bv2_SYSTEM_REV    0x00000220
760 +#define GTA01Bv3_SYSTEM_REV    0x00000230
761 +#define GTA01Bv4_SYSTEM_REV    0x00000240
762 +
763 +/* Backlight */
764 +struct gta01bl_machinfo {
765 +       unsigned int default_intensity;
766 +       unsigned int max_intensity;
767 +       unsigned int limit_mask;
768 +};
769 +
770 +/* Definitions common to all revisions */
771 +#define GTA01_GPIO_BACKLIGHT   S3C2410_GPB0
772 +#define GTA01_GPIO_GPS_PWRON   S3C2410_GPB1
773 +#define GTA01_GPIO_MODEM_RST   S3C2410_GPB6
774 +#define GTA01_GPIO_MODEM_ON    S3C2410_GPB7
775 +#define GTA01_GPIO_LCD_RESET   S3C2410_GPC6
776 +#define GTA01_GPIO_PMU_IRQ     S3C2410_GPG8
777 +#define GTA01_GPIO_JACK_INSERT S3C2410_GPF4
778 +#define GTA01_GPIO_nSD_DETECT  S3C2410_GPF5
779 +#define GTA01_GPIO_AUX_KEY     S3C2410_GPF6
780 +#define GTA01_GPIO_HOLD_KEY    S3C2410_GPF7
781 +#define GTA01_GPIO_VIBRATOR_ON S3C2410_GPG11
782 +
783 +#define GTA01_IRQ_MODEM                IRQ_EINT1
784 +#define GTA01_IRQ_JACK_INSERT  IRQ_EINT4
785 +#define GTA01_IRQ_nSD_DETECT   IRQ_EINT5
786 +#define GTA01_IRQ_AUX_KEY      IRQ_EINT6
787 +#define GTA01_IRQ_PCF50606      IRQ_EINT16
788 +
789 +/* GTA01v3 */
790 +#define GTA01v3_GPIO_nGSM_EN   S3C2410_GPG9
791 +
792 +/* GTA01v4 */
793 +#define GTA01_GPIO_MODEM_DNLOAD        S3C2410_GPG0
794 +
795 +/* GTA01Bv2 */
796 +#define GTA01Bv2_GPIO_nGSM_EN  S3C2410_GPF2
797 +#define GTA01Bv2_GPIO_VIBRATOR_ON S3C2410_GPB10
798 +
799 +/* GTA01Bv3 */
800 +#define GTA01_GPIO_GPS_EN_3V3  S3C2410_GPG9
801 +
802 +#define GTA01_GPIO_SDMMC_ON    S3C2410_GPB2
803 +#define GTA01_GPIO_BT_EN       S3C2410_GPB5
804 +#define GTA01_GPIO_AB_DETECT   S3C2410_GPB8
805 +#define GTA01_GPIO_USB_PULLUP  S3C2410_GPB9
806 +#define GTA01_GPIO_USB_ATTACH  S3C2410_GPB10
807 +
808 +#define GTA01_GPIO_GPS_EN_2V8  S3C2410_GPG9
809 +#define GTA01_GPIO_GPS_EN_3V   S3C2410_GPG10
810 +#define GTA01_GPIO_GPS_RESET   S3C2410_GPC0
811 +
812 +/* GTA01Bv4 */
813 +#define GTA01Bv4_GPIO_nNAND_WP S3C2410_GPA16
814 +#define GTA01Bv4_GPIO_VIBRATOR_ON S3C2410_GPB3
815 +#define GTA01Bv4_GPIO_PMU_IRQ  S3C2410_GPG1
816 +
817 +#define GTA01Bv4_IRQ_PCF50606  IRQ_EINT9
818 +
819 +#endif /* _GTA01_H */
820 -- 
821 1.5.6.5
822