2008-07-07 18:12:45 +01:00
/* Machine specific code for the Acer n30, Acer N35, Navman PiN 570,
* Yakumo AlphaX and Airis NC05 PDAs .
2005-04-16 15:20:36 -07:00
*
* Copyright ( c ) 2003 - 2005 Simtec Electronics
* Ben Dooks < ben @ simtec . co . uk >
*
2008-07-07 18:12:41 +01:00
* Copyright ( c ) 2005 - 2008 Christer Weinigel < christer @ weinigel . se >
2005-04-16 15:20:36 -07:00
*
* There is a wiki with more information about the n30 port at
* http : //handhelds.org/moin/moin.cgi/AcerN30Documentation .
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation .
2008-07-07 18:12:45 +01:00
*/
2005-04-16 15:20:36 -07:00
# include <linux/kernel.h>
# include <linux/types.h>
2008-07-07 18:12:41 +01:00
2008-07-07 18:12:43 +01:00
# include <linux/gpio_keys.h>
2008-07-07 18:12:41 +01:00
# include <linux/init.h>
2009-05-13 22:52:24 +01:00
# include <linux/gpio.h>
2008-07-07 18:12:43 +01:00
# include <linux/input.h>
2008-07-07 18:12:41 +01:00
# include <linux/interrupt.h>
2005-10-29 19:07:23 +01:00
# include <linux/platform_device.h>
2008-07-07 18:12:41 +01:00
# include <linux/serial_core.h>
# include <linux/timer.h>
2008-09-06 12:10:45 +01:00
# include <linux/io.h>
2010-05-06 15:22:28 +02:00
# include <linux/mmc/host.h>
2005-04-16 15:20:36 -07:00
2008-08-05 16:14:15 +01:00
# include <mach/hardware.h>
2005-04-16 15:20:36 -07:00
# include <asm/irq.h>
# include <asm/mach-types.h>
2008-08-05 16:14:15 +01:00
# include <mach/fb.h>
# include <mach/leds-gpio.h>
# include <mach/regs-gpio.h>
# include <mach/regs-lcd.h>
2008-07-07 18:12:41 +01:00
# include <asm/mach/arch.h>
# include <asm/mach/irq.h>
# include <asm/mach/map.h>
2008-10-30 10:14:33 +00:00
# include <plat/iic.h>
2008-10-07 22:26:09 +01:00
# include <plat/regs-serial.h>
2005-04-16 15:20:36 -07:00
2008-10-07 23:09:51 +01:00
# include <plat/clock.h>
2008-10-07 22:26:09 +01:00
# include <plat/cpu.h>
# include <plat/devs.h>
2010-05-06 15:22:28 +02:00
# include <plat/mci.h>
2008-10-07 22:26:09 +01:00
# include <plat/s3c2410.h>
2008-10-30 10:14:37 +00:00
# include <plat/udc.h>
2005-04-16 15:20:36 -07:00
2012-01-03 14:02:03 +01:00
# include "common.h"
2005-04-16 15:20:36 -07:00
static struct map_desc n30_iodesc [ ] __initdata = {
/* nothing here yet */
} ;
static struct s3c2410_uartcfg n30_uartcfgs [ ] = {
/* Normal serial port */
[ 0 ] = {
. hwport = 0 ,
. flags = 0 ,
. ucon = 0x2c5 ,
. ulcon = 0x03 ,
. ufcon = 0x51 ,
} ,
/* IR port */
[ 1 ] = {
. hwport = 1 ,
. flags = 0 ,
. uart_flags = UPF_CONS_FLOW ,
. ucon = 0x2c5 ,
. ulcon = 0x43 ,
. ufcon = 0x51 ,
} ,
2008-07-07 18:12:45 +01:00
/* On the N30 the bluetooth controller is connected here.
* On the N35 and variants the GPS receiver is connected here . */
2005-04-16 15:20:36 -07:00
[ 2 ] = {
. hwport = 2 ,
. flags = 0 ,
. ucon = 0x2c5 ,
. ulcon = 0x03 ,
. ufcon = 0x51 ,
} ,
} ;
2008-07-07 18:12:42 +01:00
static struct s3c2410_udc_mach_info n30_udc_cfg __initdata = {
2009-05-17 22:32:23 +01:00
. vbus_pin = S3C2410_GPG ( 1 ) ,
2008-07-07 18:12:42 +01:00
. vbus_pin_inverted = 0 ,
2011-03-07 08:42:00 +01:00
. pullup_pin = S3C2410_GPB ( 3 ) ,
2008-07-07 18:12:42 +01:00
} ;
2008-07-07 18:12:43 +01:00
static struct gpio_keys_button n30_buttons [ ] = {
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPF ( 0 ) ,
2008-07-07 18:12:43 +01:00
. code = KEY_POWER ,
. desc = " Power " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPG ( 9 ) ,
2008-07-07 18:12:43 +01:00
. code = KEY_UP ,
. desc = " Thumbwheel Up " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPG ( 8 ) ,
2008-07-07 18:12:43 +01:00
. code = KEY_DOWN ,
. desc = " Thumbwheel Down " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPG ( 7 ) ,
2008-07-07 18:12:43 +01:00
. code = KEY_ENTER ,
. desc = " Thumbwheel Press " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPF ( 7 ) ,
2008-07-07 18:12:43 +01:00
. code = KEY_HOMEPAGE ,
. desc = " Home " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPF ( 6 ) ,
2008-07-07 18:12:43 +01:00
. code = KEY_CALENDAR ,
. desc = " Calendar " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPF ( 5 ) ,
2008-07-07 18:12:43 +01:00
. code = KEY_ADDRESSBOOK ,
. desc = " Contacts " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPF ( 4 ) ,
2008-07-07 18:12:43 +01:00
. code = KEY_MAIL ,
. desc = " Mail " ,
. active_low = 0 ,
} ,
} ;
static struct gpio_keys_platform_data n30_button_data = {
. buttons = n30_buttons ,
. nbuttons = ARRAY_SIZE ( n30_buttons ) ,
} ;
static struct platform_device n30_button_device = {
. name = " gpio-keys " ,
. id = - 1 ,
. dev = {
. platform_data = & n30_button_data ,
}
} ;
2008-07-07 18:12:45 +01:00
static struct gpio_keys_button n35_buttons [ ] = {
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPF ( 0 ) ,
2008-07-07 18:12:45 +01:00
. code = KEY_POWER ,
2010-05-06 15:21:50 +02:00
. type = EV_PWR ,
2008-07-07 18:12:45 +01:00
. desc = " Power " ,
. active_low = 0 ,
2010-05-06 15:21:50 +02:00
. wakeup = 1 ,
2008-07-07 18:12:45 +01:00
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPG ( 9 ) ,
2008-07-07 18:12:45 +01:00
. code = KEY_UP ,
. desc = " Joystick Up " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPG ( 8 ) ,
2008-07-07 18:12:45 +01:00
. code = KEY_DOWN ,
. desc = " Joystick Down " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPG ( 6 ) ,
2008-07-07 18:12:45 +01:00
. code = KEY_DOWN ,
. desc = " Joystick Left " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPG ( 5 ) ,
2008-07-07 18:12:45 +01:00
. code = KEY_DOWN ,
. desc = " Joystick Right " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPG ( 7 ) ,
2008-07-07 18:12:45 +01:00
. code = KEY_ENTER ,
. desc = " Joystick Press " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPF ( 7 ) ,
2008-07-07 18:12:45 +01:00
. code = KEY_HOMEPAGE ,
. desc = " Home " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPF ( 6 ) ,
2008-07-07 18:12:45 +01:00
. code = KEY_CALENDAR ,
. desc = " Calendar " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPF ( 5 ) ,
2008-07-07 18:12:45 +01:00
. code = KEY_ADDRESSBOOK ,
. desc = " Contacts " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPF ( 4 ) ,
2008-07-07 18:12:45 +01:00
. code = KEY_MAIL ,
. desc = " Mail " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPF ( 3 ) ,
2008-07-07 18:12:45 +01:00
. code = SW_RADIO ,
. desc = " GPS Antenna " ,
. active_low = 0 ,
} ,
{
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPG ( 2 ) ,
2008-07-07 18:12:45 +01:00
. code = SW_HEADPHONE_INSERT ,
. desc = " Headphone " ,
. active_low = 0 ,
} ,
} ;
static struct gpio_keys_platform_data n35_button_data = {
. buttons = n35_buttons ,
. nbuttons = ARRAY_SIZE ( n35_buttons ) ,
} ;
static struct platform_device n35_button_device = {
. name = " gpio-keys " ,
. id = - 1 ,
. num_resources = 0 ,
. dev = {
. platform_data = & n35_button_data ,
}
} ;
2008-07-07 18:12:44 +01:00
/* This is the bluetooth LED on the device. */
static struct s3c24xx_led_platdata n30_blue_led_pdata = {
. name = " blue_led " ,
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPG ( 6 ) ,
2008-07-07 18:12:44 +01:00
. def_trigger = " " ,
} ;
2011-03-30 22:57:33 -03:00
/* This is the blue LED on the device. Originally used to indicate GPS activity
2010-05-06 15:21:16 +02:00
* by flashing . */
static struct s3c24xx_led_platdata n35_blue_led_pdata = {
. name = " blue_led " ,
. gpio = S3C2410_GPD ( 8 ) ,
. def_trigger = " " ,
} ;
2008-07-07 18:12:44 +01:00
/* This LED is driven by the battery microcontroller, and is blinking
* red , blinking green or solid green when the battery is low ,
* charging or full respectively . By driving GPD9 low , it ' s possible
* to force the LED to blink red , so call that warning LED . */
static struct s3c24xx_led_platdata n30_warning_led_pdata = {
. name = " warning_led " ,
. flags = S3C24XX_LEDF_ACTLOW ,
2009-05-17 22:32:23 +01:00
. gpio = S3C2410_GPD ( 9 ) ,
2008-07-07 18:12:44 +01:00
. def_trigger = " " ,
} ;
2010-05-06 15:21:16 +02:00
static struct s3c24xx_led_platdata n35_warning_led_pdata = {
. name = " warning_led " ,
. flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE ,
. gpio = S3C2410_GPD ( 9 ) ,
. def_trigger = " " ,
} ;
2008-07-07 18:12:44 +01:00
static struct platform_device n30_blue_led = {
. name = " s3c24xx_led " ,
. id = 1 ,
. dev = {
. platform_data = & n30_blue_led_pdata ,
} ,
} ;
2010-05-06 15:21:16 +02:00
static struct platform_device n35_blue_led = {
. name = " s3c24xx_led " ,
. id = 1 ,
. dev = {
. platform_data = & n35_blue_led_pdata ,
} ,
} ;
2008-07-07 18:12:44 +01:00
static struct platform_device n30_warning_led = {
. name = " s3c24xx_led " ,
. id = 2 ,
. dev = {
. platform_data = & n30_warning_led_pdata ,
} ,
} ;
2010-05-06 15:21:16 +02:00
static struct platform_device n35_warning_led = {
. name = " s3c24xx_led " ,
. id = 2 ,
. dev = {
. platform_data = & n35_warning_led_pdata ,
} ,
} ;
2008-07-07 18:12:46 +01:00
static struct s3c2410fb_display n30_display __initdata = {
2008-07-07 18:12:48 +01:00
. type = S3C2410_LCDCON1_TFT ,
. width = 240 ,
. height = 320 ,
. pixclock = 170000 ,
. xres = 240 ,
. yres = 320 ,
. bpp = 16 ,
. left_margin = 3 ,
. right_margin = 40 ,
. hsync_len = 40 ,
. upper_margin = 2 ,
. lower_margin = 3 ,
. vsync_len = 2 ,
2008-07-07 18:12:46 +01:00
. lcdcon5 = S3C2410_LCDCON5_INVVLINE | S3C2410_LCDCON5_INVVFRAME ,
} ;
static struct s3c2410fb_mach_info n30_fb_info __initdata = {
2008-07-07 18:12:48 +01:00
. displays = & n30_display ,
. num_displays = 1 ,
2008-07-07 18:12:46 +01:00
. default_display = 0 ,
2008-07-07 18:12:48 +01:00
. lpcsel = 0x06 ,
2008-07-07 18:12:46 +01:00
} ;
2010-05-06 15:23:24 +02:00
static void n30_sdi_set_power ( unsigned char power_mode , unsigned short vdd )
{
switch ( power_mode ) {
case MMC_POWER_ON :
case MMC_POWER_UP :
2010-05-07 09:59:11 +09:00
gpio_set_value ( S3C2410_GPG ( 4 ) , 1 ) ;
2010-05-06 15:23:24 +02:00
break ;
case MMC_POWER_OFF :
default :
2010-05-07 09:59:11 +09:00
gpio_set_value ( S3C2410_GPG ( 4 ) , 0 ) ;
2010-05-06 15:23:24 +02:00
break ;
}
}
2010-05-06 15:22:28 +02:00
static struct s3c24xx_mci_pdata n30_mci_cfg __initdata = {
. gpio_detect = S3C2410_GPF ( 1 ) ,
. gpio_wprotect = S3C2410_GPG ( 10 ) ,
. ocr_avail = MMC_VDD_32_33 ,
2010-05-06 15:23:24 +02:00
. set_power = n30_sdi_set_power ,
2010-05-06 15:22:28 +02:00
} ;
2005-04-16 15:20:36 -07:00
static struct platform_device * n30_devices [ ] __initdata = {
& s3c_device_lcd ,
& s3c_device_wdt ,
2008-10-31 16:14:40 +00:00
& s3c_device_i2c0 ,
2005-04-16 15:20:36 -07:00
& s3c_device_iis ,
2009-11-23 00:13:39 +00:00
& s3c_device_ohci ,
2010-05-06 15:20:36 +02:00
& s3c_device_rtc ,
2005-04-16 15:20:36 -07:00
& s3c_device_usbgadget ,
2010-05-06 15:22:28 +02:00
& s3c_device_sdi ,
2008-07-07 18:12:43 +01:00
& n30_button_device ,
2008-07-07 18:12:44 +01:00
& n30_blue_led ,
& n30_warning_led ,
2005-04-16 15:20:36 -07:00
} ;
2008-07-07 18:12:45 +01:00
static struct platform_device * n35_devices [ ] __initdata = {
& s3c_device_lcd ,
& s3c_device_wdt ,
2008-10-31 16:14:40 +00:00
& s3c_device_i2c0 ,
2008-07-07 18:12:45 +01:00
& s3c_device_iis ,
2010-05-06 15:20:36 +02:00
& s3c_device_rtc ,
2008-07-07 18:12:45 +01:00
& s3c_device_usbgadget ,
2010-05-06 15:22:28 +02:00
& s3c_device_sdi ,
2008-07-07 18:12:45 +01:00
& n35_button_device ,
2010-05-06 15:21:16 +02:00
& n35_blue_led ,
& n35_warning_led ,
2008-07-07 18:12:45 +01:00
} ;
2009-09-28 16:29:48 +01:00
static struct s3c2410_platform_i2c __initdata n30_i2ccfg = {
2005-04-16 15:20:36 -07:00
. flags = 0 ,
. slave_addr = 0x10 ,
2009-03-13 13:53:46 +00:00
. frequency = 10 * 1000 ,
2005-04-16 15:20:36 -07:00
} ;
2008-07-07 18:12:47 +01:00
/* Lots of hardcoded stuff, but it sets up the hardware in a useful
* state so that we can boot Linux directly from flash . */
static void __init n30_hwinit ( void )
{
/* GPA0-11 special functions -- unknown what they do
* GPA12 N30 special function - - unknown what it does
* N35 / PiN output - - unknown what it does
*
* A12 is nGCS1 on the N30 and an output on the N35 / PiN . I
* don ' t think it does anything useful on the N30 , so I ought
* to make it an output there too since it always driven to 0
* as far as I can tell . */
if ( machine_is_n30 ( ) )
__raw_writel ( 0x007fffff , S3C2410_GPACON ) ;
if ( machine_is_n35 ( ) )
__raw_writel ( 0x007fefff , S3C2410_GPACON ) ;
__raw_writel ( 0x00000000 , S3C2410_GPADAT ) ;
/* GPB0 TOUT0 backlight level
* GPB1 output 1 = backlight on
* GPB2 output IrDA enable 0 = transceiver enabled , 1 = disabled
* GPB3 output USB D + pull up 0 = disabled , 1 = enabled
* GPB4 N30 output - - unknown function
* N30 / PiN GPS control 0 = GPS enabled , 1 = GPS disabled
* GPB5 output - - unknown function
* GPB6 input - - unknown function
* GPB7 output - - unknown function
* GPB8 output - - probably LCD driver enable
* GPB9 output - - probably LCD VSYNC driver enable
* GPB10 output - - probably LCD HSYNC driver enable
*/
__raw_writel ( 0x00154556 , S3C2410_GPBCON ) ;
__raw_writel ( 0x00000750 , S3C2410_GPBDAT ) ;
__raw_writel ( 0x00000073 , S3C2410_GPBUP ) ;
/* GPC0 input RS232 DCD/DSR/RI
* GPC1 LCD
* GPC2 output RS232 DTR ?
* GPC3 input RS232 DCD / DSR / RI
* GPC4 LCD
* GPC5 output 0 = NAND write enabled , 1 = NAND write protect
* GPC6 input - - unknown function
* GPC7 input charger status 0 = charger connected
* this input can be triggered by power on the USB device
* port too , but will go back to disconnected soon after .
* GPC8 N30 / N35 output - - unknown function , always driven to 1
* PiN input - - unknown function , always read as 1
* Make it an input with a pull up for all models .
* GPC9 - 15 LCD
*/
__raw_writel ( 0xaaa80618 , S3C2410_GPCCON ) ;
__raw_writel ( 0x0000014c , S3C2410_GPCDAT ) ;
__raw_writel ( 0x0000fef2 , S3C2410_GPCUP ) ;
/* GPD0 input -- unknown function
* GPD1 - D7 LCD
* GPD8 N30 output - - unknown function
* N35 / PiN output 1 = GPS LED on
* GPD9 output 0 = power led blinks red , 1 = normal power led function
* GPD10 output - - unknown function
* GPD11 - 15 LCD drivers
*/
__raw_writel ( 0xaa95aaa4 , S3C2410_GPDCON ) ;
__raw_writel ( 0x00000601 , S3C2410_GPDDAT ) ;
__raw_writel ( 0x0000fbfe , S3C2410_GPDUP ) ;
/* GPE0-4 I2S audio bus
* GPE5 - 10 SD / MMC bus
* E11 - 13 outputs - - unknown function , probably power management
* E14 - 15 I2C bus connected to the battery controller
*/
__raw_writel ( 0xa56aaaaa , S3C2410_GPECON ) ;
__raw_writel ( 0x0000efc5 , S3C2410_GPEDAT ) ;
__raw_writel ( 0x0000f81f , S3C2410_GPEUP ) ;
/* GPF0 input 0=power button pressed
* GPF1 input SD / MMC switch 0 = card present
* GPF2 N30 1 = reset button pressed ( inverted compared to the rest )
* N35 / PiN 0 = reset button pressed
* GPF3 N30 / PiN input - - unknown function
* N35 input GPS antenna position , 0 = antenna closed , 1 = open
* GPF4 input 0 = button 4 pressed
* GPF5 input 0 = button 3 pressed
* GPF6 input 0 = button 2 pressed
* GPF7 input 0 = button 1 pressed
*/
__raw_writel ( 0x0000aaaa , S3C2410_GPFCON ) ;
__raw_writel ( 0x00000000 , S3C2410_GPFDAT ) ;
__raw_writel ( 0x000000ff , S3C2410_GPFUP ) ;
/* GPG0 input RS232 DCD/DSR/RI
* GPG1 input 1 = USB gadget port has power from a host
* GPG2 N30 input - - unknown function
* N35 / PiN input 0 = headphones plugged in , 1 = not plugged in
* GPG3 N30 output - - unknown function
* N35 / PiN input with unknown function
* GPG4 N30 output 0 = MMC enabled , 1 = MMC disabled
* GPG5 N30 output 0 = BlueTooth chip disabled , 1 = enabled
* N35 / PiN input joystick right
* GPG6 N30 output 0 = blue led on , 1 = off
* N35 / PiN input joystick left
* GPG7 input 0 = thumbwheel pressed
* GPG8 input 0 = thumbwheel down
* GPG9 input 0 = thumbwheel up
* GPG10 input SD / MMC write protect switch
* GPG11 N30 input - - unknown function
* N35 output 0 = GPS antenna powered , 1 = not powered
* PiN output - - unknown function
* GPG12 - 15 touch screen functions
*
* The pullups differ between the models , so enable all
* pullups that are enabled on any of the models .
*/
if ( machine_is_n30 ( ) )
__raw_writel ( 0xff0a956a , S3C2410_GPGCON ) ;
if ( machine_is_n35 ( ) )
__raw_writel ( 0xff4aa92a , S3C2410_GPGCON ) ;
__raw_writel ( 0x0000e800 , S3C2410_GPGDAT ) ;
__raw_writel ( 0x0000f86f , S3C2410_GPGUP ) ;
/* GPH0/1/2/3 RS232 serial port
* GPH4 / 5 IrDA serial port
* GPH6 / 7 N30 BlueTooth serial port
* N35 / PiN GPS receiver
* GPH8 input - - unknown function
* GPH9 CLKOUT0 HCLK - - unknown use
* GPH10 CLKOUT1 FCLK - - unknown use
*
* The pull ups for H6 / H7 are enabled on N30 but not on the
* N35 / PiN . I suppose is useful for a budget model of the N30
* with no bluetooh . It doesn ' t hurt to have the pull ups
* enabled on the N35 , so leave them enabled for all models .
*/
__raw_writel ( 0x0028aaaa , S3C2410_GPHCON ) ;
__raw_writel ( 0x000005ef , S3C2410_GPHDAT ) ;
__raw_writel ( 0x0000063f , S3C2410_GPHUP ) ;
}
2005-09-20 17:24:33 +01:00
static void __init n30_map_io ( void )
2005-04-16 15:20:36 -07:00
{
s3c24xx_init_io ( n30_iodesc , ARRAY_SIZE ( n30_iodesc ) ) ;
2008-07-07 18:12:47 +01:00
n30_hwinit ( ) ;
2005-04-16 15:20:36 -07:00
s3c24xx_init_clocks ( 0 ) ;
s3c24xx_init_uarts ( n30_uartcfgs , ARRAY_SIZE ( n30_uartcfgs ) ) ;
}
2005-09-05 20:47:53 +01:00
/* GPB3 is the line that controls the pull-up for the USB D+ line */
2005-04-16 15:20:36 -07:00
2005-09-20 17:24:33 +01:00
static void __init n30_init ( void )
2005-04-16 15:20:36 -07:00
{
2010-05-07 09:59:11 +09:00
WARN_ON ( gpio_request ( S3C2410_GPG ( 4 ) , " mmc power " ) ) ;
2008-07-07 18:12:46 +01:00
s3c24xx_fb_set_platdata ( & n30_fb_info ) ;
2008-07-07 18:12:42 +01:00
s3c24xx_udc_set_platdata ( & n30_udc_cfg ) ;
2010-05-06 15:22:28 +02:00
s3c24xx_mci_set_platdata ( & n30_mci_cfg ) ;
2009-09-28 16:29:48 +01:00
s3c_i2c0_set_platdata ( & n30_i2ccfg ) ;
2005-04-16 15:20:36 -07:00
2005-09-05 20:47:53 +01:00
/* Turn off suspend on both USB ports, and switch the
* selectable USB port to USB device mode . */
s3c2410_modify_misccr ( S3C2410_MISCCR_USBHOST |
S3C2410_MISCCR_USBSUSPND0 |
S3C2410_MISCCR_USBSUSPND1 , 0x0 ) ;
2007-04-20 11:19:16 +01:00
2008-07-07 18:12:45 +01:00
if ( machine_is_n30 ( ) ) {
/* Turn off suspend on both USB ports, and switch the
* selectable USB port to USB device mode . */
s3c2410_modify_misccr ( S3C2410_MISCCR_USBHOST |
S3C2410_MISCCR_USBSUSPND0 |
S3C2410_MISCCR_USBSUSPND1 , 0x0 ) ;
platform_add_devices ( n30_devices , ARRAY_SIZE ( n30_devices ) ) ;
}
if ( machine_is_n35 ( ) ) {
/* Turn off suspend and switch the selectable USB port
* to USB device mode . Turn on suspend for the host
* port since it is not connected on the N35 .
*
* Actually , the host port is available at some pads
* on the back of the device , so it would actually be
* possible to add a USB device inside the N35 if you
* are willing to do some hardware modifications . */
s3c2410_modify_misccr ( S3C2410_MISCCR_USBHOST |
S3C2410_MISCCR_USBSUSPND0 |
S3C2410_MISCCR_USBSUSPND1 ,
2010-05-06 15:19:19 +02:00
S3C2410_MISCCR_USBSUSPND0 ) ;
2008-07-07 18:12:45 +01:00
platform_add_devices ( n35_devices , ARRAY_SIZE ( n35_devices ) ) ;
}
2005-04-16 15:20:36 -07:00
}
MACHINE_START ( N30 , " Acer-N30 " )
2005-09-05 20:47:53 +01:00
/* Maintainer: Christer Weinigel <christer@weinigel.se>,
Ben Dooks < ben - linux @ fluff . org >
*/
2011-07-05 22:38:17 -04:00
. atag_offset = 0x100 ,
2005-04-16 15:20:36 -07:00
. timer = & s3c24xx_timer ,
. init_machine = n30_init ,
2010-05-07 10:01:28 +09:00
. init_irq = s3c24xx_init_irq ,
2005-04-16 15:20:36 -07:00
. map_io = n30_map_io ,
2012-01-03 14:02:03 +01:00
. restart = s3c2410_restart ,
2005-04-16 15:20:36 -07:00
MACHINE_END
2008-07-07 18:12:45 +01:00
MACHINE_START ( N35 , " Acer-N35 " )
/* Maintainer: Christer Weinigel <christer@weinigel.se>
*/
2011-07-05 22:38:17 -04:00
. atag_offset = 0x100 ,
2008-07-07 18:12:45 +01:00
. timer = & s3c24xx_timer ,
. init_machine = n30_init ,
2010-05-07 10:01:28 +09:00
. init_irq = s3c24xx_init_irq ,
2008-07-07 18:12:45 +01:00
. map_io = n30_map_io ,
2012-01-03 14:02:03 +01:00
. restart = s3c2410_restart ,
2008-07-07 18:12:45 +01:00
MACHINE_END