diff options
author | Christer Weinigel <christer@weinigel.se> | 2008-07-07 13:12:47 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2008-07-07 13:13:04 -0400 |
commit | 9a2ddb7866c2887352e85c6443dfb5e679140aff (patch) | |
tree | b6030463a432ef7500c9f3c4e546153e72436d94 /arch/arm/mach-s3c2410 | |
parent | e43f238390168a13416d4f21803f76b1ff45fb95 (diff) |
[ARM] Acer n30: Hardware initialisation.
Initialise the hardware register settings on boot, to allow the
device to function correctly.
Signed-off-by: Christer Weinigel <christer@weinigel.se>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/mach-s3c2410')
-rw-r--r-- | arch/arm/mach-s3c2410/mach-n30.c | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c index 476b15c089a7..450d10823f83 100644 --- a/arch/arm/mach-s3c2410/mach-n30.c +++ b/arch/arm/mach-s3c2410/mach-n30.c | |||
@@ -345,9 +345,148 @@ static struct s3c2410_platform_i2c n30_i2ccfg = { | |||
345 | .max_freq = 10*1000, | 345 | .max_freq = 10*1000, |
346 | }; | 346 | }; |
347 | 347 | ||
348 | /* Lots of hardcoded stuff, but it sets up the hardware in a useful | ||
349 | * state so that we can boot Linux directly from flash. */ | ||
350 | static void __init n30_hwinit(void) | ||
351 | { | ||
352 | /* GPA0-11 special functions -- unknown what they do | ||
353 | * GPA12 N30 special function -- unknown what it does | ||
354 | * N35/PiN output -- unknown what it does | ||
355 | * | ||
356 | * A12 is nGCS1 on the N30 and an output on the N35/PiN. I | ||
357 | * don't think it does anything useful on the N30, so I ought | ||
358 | * to make it an output there too since it always driven to 0 | ||
359 | * as far as I can tell. */ | ||
360 | if (machine_is_n30()) | ||
361 | __raw_writel(0x007fffff, S3C2410_GPACON); | ||
362 | if (machine_is_n35()) | ||
363 | __raw_writel(0x007fefff, S3C2410_GPACON); | ||
364 | __raw_writel(0x00000000, S3C2410_GPADAT); | ||
365 | |||
366 | /* GPB0 TOUT0 backlight level | ||
367 | * GPB1 output 1=backlight on | ||
368 | * GPB2 output IrDA enable 0=transceiver enabled, 1=disabled | ||
369 | * GPB3 output USB D+ pull up 0=disabled, 1=enabled | ||
370 | * GPB4 N30 output -- unknown function | ||
371 | * N30/PiN GPS control 0=GPS enabled, 1=GPS disabled | ||
372 | * GPB5 output -- unknown function | ||
373 | * GPB6 input -- unknown function | ||
374 | * GPB7 output -- unknown function | ||
375 | * GPB8 output -- probably LCD driver enable | ||
376 | * GPB9 output -- probably LCD VSYNC driver enable | ||
377 | * GPB10 output -- probably LCD HSYNC driver enable | ||
378 | */ | ||
379 | __raw_writel(0x00154556, S3C2410_GPBCON); | ||
380 | __raw_writel(0x00000750, S3C2410_GPBDAT); | ||
381 | __raw_writel(0x00000073, S3C2410_GPBUP); | ||
382 | |||
383 | /* GPC0 input RS232 DCD/DSR/RI | ||
384 | * GPC1 LCD | ||
385 | * GPC2 output RS232 DTR? | ||
386 | * GPC3 input RS232 DCD/DSR/RI | ||
387 | * GPC4 LCD | ||
388 | * GPC5 output 0=NAND write enabled, 1=NAND write protect | ||
389 | * GPC6 input -- unknown function | ||
390 | * GPC7 input charger status 0=charger connected | ||
391 | * this input can be triggered by power on the USB device | ||
392 | * port too, but will go back to disconnected soon after. | ||
393 | * GPC8 N30/N35 output -- unknown function, always driven to 1 | ||
394 | * PiN input -- unknown function, always read as 1 | ||
395 | * Make it an input with a pull up for all models. | ||
396 | * GPC9-15 LCD | ||
397 | */ | ||
398 | __raw_writel(0xaaa80618, S3C2410_GPCCON); | ||
399 | __raw_writel(0x0000014c, S3C2410_GPCDAT); | ||
400 | __raw_writel(0x0000fef2, S3C2410_GPCUP); | ||
401 | |||
402 | /* GPD0 input -- unknown function | ||
403 | * GPD1-D7 LCD | ||
404 | * GPD8 N30 output -- unknown function | ||
405 | * N35/PiN output 1=GPS LED on | ||
406 | * GPD9 output 0=power led blinks red, 1=normal power led function | ||
407 | * GPD10 output -- unknown function | ||
408 | * GPD11-15 LCD drivers | ||
409 | */ | ||
410 | __raw_writel(0xaa95aaa4, S3C2410_GPDCON); | ||
411 | __raw_writel(0x00000601, S3C2410_GPDDAT); | ||
412 | __raw_writel(0x0000fbfe, S3C2410_GPDUP); | ||
413 | |||
414 | /* GPE0-4 I2S audio bus | ||
415 | * GPE5-10 SD/MMC bus | ||
416 | * E11-13 outputs -- unknown function, probably power management | ||
417 | * E14-15 I2C bus connected to the battery controller | ||
418 | */ | ||
419 | __raw_writel(0xa56aaaaa, S3C2410_GPECON); | ||
420 | __raw_writel(0x0000efc5, S3C2410_GPEDAT); | ||
421 | __raw_writel(0x0000f81f, S3C2410_GPEUP); | ||
422 | |||
423 | /* GPF0 input 0=power button pressed | ||
424 | * GPF1 input SD/MMC switch 0=card present | ||
425 | * GPF2 N30 1=reset button pressed (inverted compared to the rest) | ||
426 | * N35/PiN 0=reset button pressed | ||
427 | * GPF3 N30/PiN input -- unknown function | ||
428 | * N35 input GPS antenna position, 0=antenna closed, 1=open | ||
429 | * GPF4 input 0=button 4 pressed | ||
430 | * GPF5 input 0=button 3 pressed | ||
431 | * GPF6 input 0=button 2 pressed | ||
432 | * GPF7 input 0=button 1 pressed | ||
433 | */ | ||
434 | __raw_writel(0x0000aaaa, S3C2410_GPFCON); | ||
435 | __raw_writel(0x00000000, S3C2410_GPFDAT); | ||
436 | __raw_writel(0x000000ff, S3C2410_GPFUP); | ||
437 | |||
438 | /* GPG0 input RS232 DCD/DSR/RI | ||
439 | * GPG1 input 1=USB gadget port has power from a host | ||
440 | * GPG2 N30 input -- unknown function | ||
441 | * N35/PiN input 0=headphones plugged in, 1=not plugged in | ||
442 | * GPG3 N30 output -- unknown function | ||
443 | * N35/PiN input with unknown function | ||
444 | * GPG4 N30 output 0=MMC enabled, 1=MMC disabled | ||
445 | * GPG5 N30 output 0=BlueTooth chip disabled, 1=enabled | ||
446 | * N35/PiN input joystick right | ||
447 | * GPG6 N30 output 0=blue led on, 1=off | ||
448 | * N35/PiN input joystick left | ||
449 | * GPG7 input 0=thumbwheel pressed | ||
450 | * GPG8 input 0=thumbwheel down | ||
451 | * GPG9 input 0=thumbwheel up | ||
452 | * GPG10 input SD/MMC write protect switch | ||
453 | * GPG11 N30 input -- unknown function | ||
454 | * N35 output 0=GPS antenna powered, 1=not powered | ||
455 | * PiN output -- unknown function | ||
456 | * GPG12-15 touch screen functions | ||
457 | * | ||
458 | * The pullups differ between the models, so enable all | ||
459 | * pullups that are enabled on any of the models. | ||
460 | */ | ||
461 | if (machine_is_n30()) | ||
462 | __raw_writel(0xff0a956a, S3C2410_GPGCON); | ||
463 | if (machine_is_n35()) | ||
464 | __raw_writel(0xff4aa92a, S3C2410_GPGCON); | ||
465 | __raw_writel(0x0000e800, S3C2410_GPGDAT); | ||
466 | __raw_writel(0x0000f86f, S3C2410_GPGUP); | ||
467 | |||
468 | /* GPH0/1/2/3 RS232 serial port | ||
469 | * GPH4/5 IrDA serial port | ||
470 | * GPH6/7 N30 BlueTooth serial port | ||
471 | * N35/PiN GPS receiver | ||
472 | * GPH8 input -- unknown function | ||
473 | * GPH9 CLKOUT0 HCLK -- unknown use | ||
474 | * GPH10 CLKOUT1 FCLK -- unknown use | ||
475 | * | ||
476 | * The pull ups for H6/H7 are enabled on N30 but not on the | ||
477 | * N35/PiN. I suppose is useful for a budget model of the N30 | ||
478 | * with no bluetooh. It doesn't hurt to have the pull ups | ||
479 | * enabled on the N35, so leave them enabled for all models. | ||
480 | */ | ||
481 | __raw_writel(0x0028aaaa, S3C2410_GPHCON); | ||
482 | __raw_writel(0x000005ef, S3C2410_GPHDAT); | ||
483 | __raw_writel(0x0000063f, S3C2410_GPHUP); | ||
484 | } | ||
485 | |||
348 | static void __init n30_map_io(void) | 486 | static void __init n30_map_io(void) |
349 | { | 487 | { |
350 | s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc)); | 488 | s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc)); |
489 | n30_hwinit(); | ||
351 | s3c24xx_init_clocks(0); | 490 | s3c24xx_init_clocks(0); |
352 | s3c24xx_init_uarts(n30_uartcfgs, ARRAY_SIZE(n30_uartcfgs)); | 491 | s3c24xx_init_uarts(n30_uartcfgs, ARRAY_SIZE(n30_uartcfgs)); |
353 | } | 492 | } |