Commit latest Qisda version and Bookeen's modification

This commit is contained in:
mlt
2010-04-23 11:27:04 +00:00
committed by Godzil
parent 2c907884d1
commit f2fd2aec61
75 changed files with 182708 additions and 51781 deletions

View File

@@ -32,6 +32,7 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
#
# General setup
#
# CONFIG_RESCUEOS_BUILD is not set
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
# CONFIG_SWAP is not set
@@ -1001,8 +1002,11 @@ CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_VGA16 is not set
# CONFIG_LOGO_LINUX_CLUT224 is not set
# CONFIG_LOGO_LINUX_LANDSCAPED_CLUT224 is not set
# CONFIG_LOGO_LINUX_CUSTOMER_6_INCH_CLUT224 is not set
# CONFIG_LOGO_LINUX_SH060B00_6_INCH_CLUT224 is not set
CONFIG_LOGO_LINUX_CUSTOMER_9_INCH_CLUT224=y
#
# Sound
#

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -974,6 +974,8 @@ CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_VGA16 is not set
# CONFIG_LOGO_LINUX_CLUT224 is not set
# CONFIG_LOGO_LINUX_LANDSCAPED_CLUT224 is not set
# CONFIG_LOGO_LINUX_CUSTOMER_9_INCH_CLUT224 is not set
# CONFIG_LOGO_LINUX_SH060B00_6_INCH_CLUT224 is not set
CONFIG_LOGO_LINUX_CUSTOMER_6_INCH_CLUT224=y
#

View File

@@ -32,6 +32,7 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
#
# General setup
#
# CONFIG_RESCUEOS_BUILD is not set
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
# CONFIG_SWAP is not set
@@ -276,7 +277,7 @@ CONFIG_ALIGNMENT_TRAP=y
#
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_CMDLINE="root=/dev/mmcblk0p1 rootfstype=ext3 init=/linuxrc console=ttySAC0,115200"
CONFIG_CMDLINE="root=/dev/mmcblk0p1 rootfstype=ext3 ro init=/linuxrc console=ttySAC0,115200"
# CONFIG_XIP_KERNEL is not set
# CONFIG_KEXEC is not set
@@ -305,6 +306,9 @@ CONFIG_BINFMT_AOUT=y
CONFIG_PM=y
CONFIG_PM_LEGACY=y
CONFIG_PM_CPU_MODE=y
CONFIG_TOUCH_PM=y
CONFIG_PM_PLATFORM_POWER_SAVING=y
# CONFIG_PM_DEBUG is not set
CONFIG_PM_SYSFS_DEPRECATED=y
CONFIG_APM_EMULATION=y
@@ -1004,6 +1008,8 @@ CONFIG_LOGO=y
# CONFIG_LOGO_LINUX_VGA16 is not set
# CONFIG_LOGO_LINUX_CLUT224 is not set
# CONFIG_LOGO_LINUX_LANDSCAPED_CLUT224 is not set
# CONFIG_LOGO_LINUX_CUSTOMER_9_INCH_CLUT224 is not set
# CONFIG_LOGO_LINUX_SH060B00_6_INCH_CLUT224 is not set
CONFIG_LOGO_LINUX_CUSTOMER_6_INCH_CLUT224=y
#
@@ -1225,6 +1231,7 @@ CONFIG_USB_FILE_STORAGE=m
# CONFIG_USB_MIDI_GADGET is not set
CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
CONFIG_SD_SW_DEBOUNCE=y
CONFIG_MMC_UNSAFE_RESUME=y
#

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.21.5-cfs-v19
# Mon Nov 23 19:28:57 2009
# Thu Feb 4 10:46:10 2010
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -32,6 +32,7 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
#
# General setup
#
# CONFIG_RESCUEOS_BUILD is not set
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
# CONFIG_SWAP is not set
@@ -304,6 +305,7 @@ CONFIG_BINFMT_AOUT=y
#
CONFIG_PM=y
CONFIG_PM_LEGACY=y
# CONFIG_PM_PLATFORM_POWER_SAVING is not set
CONFIG_PM_CPU_MODE=y
# CONFIG_PM_DEBUG is not set
CONFIG_PM_SYSFS_DEPRECATED=y
@@ -411,6 +413,8 @@ CONFIG_WIRELESS_EXT=y
#
# Generic Driver Options
#
# CONFIG_QISDA_BQ060B00 is not set
# CONFIG_QISDA_SH060B00 is not set
# CONFIG_QISDA_QD060B00 is not set
CONFIG_QISDA_QD090B00=y
CONFIG_QISDA_QD090B00_EVT1=y
@@ -868,6 +872,7 @@ CONFIG_I2C_S3C2410=y
# CONFIG_SENSORS_PCF8591 is not set
# CONFIG_SENSORS_MAX6875 is not set
CONFIG_QISDA_IIC=y
# CONFIG_TOUCH_PM is not set
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -181,6 +181,10 @@ __setup("reboot=", reboot_setup);
void machine_halt(void)
{
if (pm_power_off)
pm_power_off();
while(1);
}

View File

@@ -32,10 +32,10 @@ config MACH_SMDK2416
help
Say Y here if you are using an SMDK2416
config MACH_CYBOOK2416
bool "CYBOOK 2416"
select MACH_SMDK2416
help
Say Y here is you are using a Cybook 2416
config MACH_CYBOOK_ORIZON
bool "Bookeen Cybook Orizon"
select CPU_S3C2416
select MACH_SMDK
help
Say Y here if you are using a Cybook Orizon
endmenu

View File

@@ -18,6 +18,6 @@ obj-$(CONFIG_S3C2416_PM) += pm.o
# Machine support
obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o
obj-$(CONFIG_MACH_SMDK2416) += qisda-utils.o
obj-$(CONFIGçMACH_CYBOOK2416) += cybook.o
obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o qisda-utils.o cybook.o
obj-$(CONFIG_MACH_CYBOOK_ORIZON) += mach-cybook_orizon.o cybook.o qisda-utils.o

View File

@@ -17,6 +17,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
//#include <linux/miscdevice.h>
//#include <linux/poll.h>
//#include <linux/sched.h>
//#include <linux/wait.h>
//#include <linux/delay.h>
//#include <linux/interrupt.h>
//#include <linux/pm.h>
#include <cybook.h>
struct proc_dir_entry *platform_type_Proc_File;
#define procfs_name "device"
@@ -26,6 +40,8 @@ int procfile_read(char *buffer,
{
int ret;
if (offset > 0) {
/* we have finished to read, return 0 */
ret = 0;
@@ -40,9 +56,9 @@ int procfile_read(char *buffer,
}
// ---------------------------------------------------------------------------
// ===========================================================================
static int __init cybooInit(void)
static int __init cybookInit(void)
{
printk("CIC [Cybook Initialisation Code]\n");
/* cybook proc file */
platform_type_Proc_File = create_proc_entry(procfs_name, 0644, NULL);

View File

@@ -0,0 +1,297 @@
/* linux/arch/arm/mach-s3c2416/mach-cybook_orizon.c
*
* Slightly based on mach-s3c2416.c
*
* 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.
*
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/timer.h>
#include <linux/init.h>
#include <linux/serial_core.h>
#include <linux/platform_device.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>
#include <asm/setup.h>
#include <asm/hardware.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/mach-types.h>
#include <asm/arch/regs-serial.h>
#include <asm/arch/regs-gpio.h>
#include <asm/arch/regs-gpioj.h>
#include <asm/arch/regs-lcd.h>
#include <asm/arch/regs-mem.h>
#include <asm/arch/idle.h>
#include <asm/arch/fb.h>
#include <asm/plat-s3c24xx/s3c2410.h>
#include <asm/plat-s3c24xx/s3c2440.h>
#include <asm/plat-s3c24xx/clock.h>
#include <asm/plat-s3c24xx/devs.h>
#include <asm/plat-s3c24xx/cpu.h>
#include <asm/plat-s3c24xx/common-smdk.h>
#include <asm/arch/nand.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <asm/arch/hsmmc.h>
#include <cybook.h>
unsigned int platform_type = CYBOOK_GEN4;
unsigned long platform_capability = PLAT_CAP_GTILT | PLAT_CAP_SOUNDNO
| PLAT_CAP_VTCON | PLAT_CAP_ORIZONFORM;
static struct map_desc bkorizon_iodesc[] __initdata = {
};
#define UCON S3C2410_UCON_DEFAULT | S3C2440_UCON_FCLK
#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
static struct s3c24xx_uart_clksrc bkorizon_serial_clocks[] = {
[0] = {
.name = "pclk",
.divisor = 1,
.min_baud = 0,
.max_baud = 0,
},
[1] = {
.name = "esysclk",
.divisor = 1,
.min_baud = 0,
.max_baud = 0,
}
};
static struct s3c2410_uartcfg bkorizon_uartcfgs[] __initdata = {
[0] = {
.hwport = 0,
.flags = 0,
.ucon = 0x3c5,
.ulcon = 0x03,
.ufcon = 0x51,
},
[1] = { /* VRFY: Used by BT? */
.hwport = 1,
.flags = 0,
/* Use PCLK */
.ucon = 0x3c5,
.ulcon = 0x03,
.ufcon = 0x51,
.clocks = bkorizon_serial_clocks,
.clocks_size = ARRAY_SIZE(bkorizon_serial_clocks),
},
/* IR port */
[2] = {
.hwport = 2,
.flags = 0,
.ucon = 0x3c5,
.ulcon = 0x03,
.ufcon = 0x51,
.clocks = bkorizon_serial_clocks,
.clocks_size = ARRAY_SIZE(bkorizon_serial_clocks),
}
};
/*** TODO: Verify this list and remove anything unneeded */
static struct platform_device *bkorizon_devices[] __initdata = {
&s3c_device_spi0,
&s3c_device_spi1,
&s3c_device_wdt,
&s3c_device_i2c,
&s3c_device_lcd,
&s3c_device_rtc,
&s3c_device_adc,
&s3c_device_iis,
&s3c_device_usbgadget,
&s3c_device_usb,
&s3c_device_hsmmc0,
&s3c_device_hsmmc1,
&s3c_device_ts_iic,
};
static struct s3c24xx_board bkorizon_board __initdata = {
.devices = bkorizon_devices,
.devices_count = ARRAY_SIZE(bkorizon_devices)
};
static void bkorizon_power_off(void)
{
printk(KERN_ERR "Will Shutdown...\n");
s3c2410_gpio_cfgpin(S3C2410_GPD14, S3C2410_GPD14_OUTP);
s3c2410_gpio_setpin(S3C2410_GPD14, 0);
}
static void __init bkorizon_map_io(void)
{
s3c24xx_init_io(bkorizon_iodesc, ARRAY_SIZE(bkorizon_iodesc));
s3c24xx_init_clocks(12000000);
s3c24xx_init_uarts(bkorizon_uartcfgs, ARRAY_SIZE(bkorizon_uartcfgs));
s3c24xx_set_board(&bkorizon_board);
}
static void __init bkorizon_machine_init(void)
{
smdk_machine_init();
pm_power_off = bkorizon_power_off;
}
static void __init bkorizon_fixup (struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
/*
* Bank start addresses are not present in the information
* passed in from the boot loader. We could potentially
* detect them, but instead we hard-code them.
*/
mi->bank[0].start = 0x30000000;
mi->bank[0].size = 128*1024*1024;
mi->bank[0].node = 0;
mi->nr_banks = 1;
}
MACHINE_START(CYBOOK_ORIZON, "Cybook Orizon")
/* Maintainer: Manoel Trapier <mtrapier@bookeen.com> */
.phys_io = S3C2410_PA_UART,
.io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
.boot_params = S3C2410_SDRAM_PA + 0x100,
.init_irq = s3c24xx_init_irq,
.map_io = bkorizon_map_io,
.fixup = bkorizon_fixup,
.init_machine = bkorizon_machine_init,
.timer = &s3c24xx_timer,
MACHINE_END
/*
* HS-MMC GPIO Set function for S3C2416 SMDK board
*/
void hsmmc_set_gpio (uint channel, uint width)
{
switch (channel) {
/* can supports 1 and 4 bit bus */
case 0:
/* GPIO E : Command, Clock */
s3c2410_gpio_cfgpin(S3C2410_GPE5, S3C2450_GPE5_SD0_CLK);
s3c2410_gpio_cfgpin(S3C2410_GPE6, S3C2450_GPE6_SD0_CMD);
if (width == 1) {
/* GPIO E : MMC DATA0[0] */
s3c2410_gpio_cfgpin(S3C2410_GPE7, S3C2450_GPE7_SD0_DAT0);
}
else if (width == 4) {
/* GPIO E : MMC DATA0[0:3] */
s3c2410_gpio_cfgpin(S3C2410_GPE7, S3C2450_GPE7_SD0_DAT0);
s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2450_GPE8_SD0_DAT1);
s3c2410_gpio_cfgpin(S3C2410_GPE9, S3C2450_GPE9_SD0_DAT2);
s3c2410_gpio_cfgpin(S3C2410_GPE10, S3C2450_GPE10_SD0_DAT3);
}
break;
/* can supports 1 and 4 bit bus */
case 1:
/* GPIO L : Command, Clock */
s3c2410_gpio_cfgpin(S3C2443_GPL8, S3C2450_GPL8_SD1CMD);
s3c2410_gpio_cfgpin(S3C2443_GPL9, S3C2450_GPL9_SD1CLK);
if (width == 1) {
/* GPIO L : MMC DATA1[0] */
s3c2410_gpio_cfgpin(S3C2443_GPL0, S3C2450_GPL0_SD1DAT0);
}
else if (width == 4) {
/* GPIO L : MMC DATA1[0:3] */
s3c2410_gpio_cfgpin(S3C2443_GPL0, S3C2450_GPL0_SD1DAT0);
s3c2410_gpio_cfgpin(S3C2443_GPL1, S3C2450_GPL1_SD1DAT1);
s3c2410_gpio_cfgpin(S3C2443_GPL2, S3C2450_GPL2_SD1DAT2);
s3c2410_gpio_cfgpin(S3C2443_GPL3, S3C2450_GPL3_SD1DAT3);
}
break;
default:
break;
}
}
EXPORT_SYMBOL_GPL(hsmmc_set_gpio);
#define HOST_CAPS (MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE | \
MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED)
/* Channel 0 : added HS-MMC channel */
struct s3c_hsmmc_cfg s3c_hsmmc0_platform = {
.hwport = 0,
.enabled = 1,
.host_caps = 0xF ,
.bus_width = 4,
.highspeed = 0,
/* ctrl for mmc */
.fd_ctrl[MMC_MODE_MMC] = {
.ctrl2 = 0xC0000100, /* ctrl2 for mmc */
.ctrl3[SPEED_NORMAL] = 0, /* ctrl3 for low speed */
.ctrl3[SPEED_HIGH] = 0, /* ctrl3 for high speed */
.ctrl4 = 0x3,
},
/* ctrl for sd */
.fd_ctrl[MMC_MODE_SD] = {
.ctrl2 = 0xC0000100, /* ctrl2 for sd */
.ctrl3[SPEED_NORMAL] = 0, /* ctrl3 for low speed */
.ctrl3[SPEED_HIGH] = 0, /* ctrl3 for high speed */
.ctrl4 = 0x3,
},
.clk_name[0] = "hsmmc", /* 1st clock source */
.clk_name[1] = "esysclk", /* 2nd clock source hsmmc-epll by Ben Dooks */
.clk_name[2] = "hsmmc-ext", /* 3rd clock source */
};
/* Channel 1 : default HS-MMC channel */
struct s3c_hsmmc_cfg s3c_hsmmc1_platform = {
.hwport = 1,
.enabled = 1,
.host_caps = 0xF ,
.bus_width = 8,
.highspeed = 0,
/* ctrl for mmc */
.fd_ctrl[MMC_MODE_MMC] = {
.ctrl2 = 0xC0000100, /* ctrl2 for mmc */
.ctrl3[SPEED_NORMAL] = 0, /* ctrl3 for low speed */
.ctrl3[SPEED_HIGH] = 0, /* ctrl3 for high speed */
.ctrl4 = 0x3,
},
/* ctrl for sd */
.fd_ctrl[MMC_MODE_SD] = {
.ctrl2 = 0xC0000100, /* ctrl2 for sd */
.ctrl3[SPEED_NORMAL] = 0, /* ctrl3 for low speed */
.ctrl3[SPEED_HIGH] = 0, /* ctrl3 for high speed */
.ctrl4 = 0x3,
},
.clk_name[0] = "hsmmc", /* 1st clock source */
.clk_name[1] = "esysclk", /* 2nd clock source hsmmc-epll by Ben Dooks */
.clk_name[2] = "hsmmc-ext", /* 3rd clock source */
};

View File

@@ -96,8 +96,10 @@ static struct s3c2410_uartcfg smdk2416_uartcfgs[] __initdata = {
//.ucon = 0xfc5,
.ulcon = 0x03,
.ufcon = 0x51,
#ifndef CONFIG_QISDA_BK060B00
.clocks = smdk2416_serial_clocks,
.clocks_size = ARRAY_SIZE(smdk2416_serial_clocks),
#endif
},
/* IR port */
[2] = {
@@ -195,12 +197,58 @@ static void smdk2416_cs89x0_set(void)
}
/* Qisda Mark Tsai, 2010/01/13 { */
static void smdk2416_power_off(void)
{
printk("[smdk2416_power_off]T-CON Off\n");
if(is_Epaper_Write_Ready())
{
//AUO T-CON Standby
msleep(100);
Epaper_Enter_Standby_Mode(1);
msleep(100);
//AUO T-CON Sleep
Epaper_Enter_Sleep_Mode(1);
msleep(5);
//Shutdown T-CON Power
Epaper_Power(0);
//Shutdown i80 of s3c
EPaper_CloseLcdPort();
//msleep(1000);
//u32PowerState = EN_EPD_DEVICE_POWER_STATE_D3;
}
printk("[smdk2416_power_off]Power Off\n");
writeb(0x0, 0xc8a30029);
msleep(100);
#ifdef CONFIG_QISDA_BK060B00
s3c2410_gpio_cfgpin(S3C2410_GPD14, S3C2410_GPG14_OUTP);
s3c2410_gpio_setpin(S3C2410_GPG14, 0);
#else
s3c2410_gpio_cfgpin(S3C2410_GPG0, S3C2410_GPG0_OUTP);
s3c2410_gpio_setpin(S3C2410_GPG0, 0);
#endif
}
/* Qisda Mark Tsai, 2010/01/13 } */
static void __init smdk2416_machine_init(void)
{
/* SROM init for NFS */
smdk2416_cs89x0_set();
smdk_machine_init();
/* Qisda Mark Tsai, 2010/01/13 { */
pm_power_off = smdk2416_power_off;
/* Qisda Mark Tsai, 2010/01/13 } */
}
static void __init smdk2416_fixup (struct machine_desc *desc, struct tag *tags,

View File

@@ -1,4 +1,4 @@
/* linux/arch/arm/mach-s3c2450/pm.c
/* linux/arch/arm/mach-s3c2416/pm.c
*
* Copyright (c) 2006 Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
@@ -35,23 +35,31 @@
#include <asm/plat-s3c24xx/cpu.h>
#include <asm/plat-s3c24xx/pm.h>
#include <asm/plat-s3c24xx/s3c2450.h>
#include <asm/plat-s3c24xx/s3c2416.h>
#include <asm/gpio.h>
#ifdef CONFIG_PM_CPU_MODE
extern unsigned char pm_cpu_mode;
#endif
static void s3c2450_cpu_suspend(void)
static void s3c2416_cpu_suspend(void)
{
//unsigned long tmp;
unsigned long tmp;
#if 0
/* This is the USB driver work not PM */
/* USB Physical power */
__raw_writel(__raw_readl(S3C2443_PHYPWR) | 0xf, S3C2443_PHYPWR);
/* USB Suspend mode */
__raw_writel(__raw_readl(S3C2410_MISCCR)|(1<<12)|(1<<13), S3C2410_MISCCR);
#endif
__raw_writel(0xffffffff, S3C2410_INTMSK);
#if 0
/* What the heck??? We configure (even badly) MASK & PENDING ints, and we
* set them after to a more bad value ???? */
__raw_writel(0xffffffff, S3C2410_INTMSK);
__raw_writel(__raw_readl(S3C2410_SRCPND), S3C2410_SRCPND);
__raw_writel(__raw_readl(S3C2410_INTPND), S3C2410_INTPND);
@@ -59,41 +67,86 @@ static void s3c2450_cpu_suspend(void)
__raw_writel(0xffffffff, S3C2410_EINTMASK);
__raw_writel(0xffffffff, S3C2410_SRCPND);
__raw_writel(0xffffffff, S3C2410_INTPND);
__raw_writel((0xffffffff & ~((1<<0) | (1<<3) | (1<<30))) , S3C2410_INTMSK);
#endif
/* TODO: Need verification */
__raw_writel(0xff80, S3C2443_RSTCON);
__raw_writel(0xffff, S3C2443_OSCSET);
/* ack any outstanding external interrupts before we go to sleep */
__raw_writel((0xffffffff & ~((1<<0) | (1<<3) | (1<<30))) , S3C2410_INTMSK);
/* Allow wakeup even if BATT_FLT is asserted */
__raw_writel( (1<<15), S3C2443_PWRCFG);
#if 0
/* Test */
/* shutdown as many device as possible */
/* Disable USB power */
/* Disable SD Power */
tmp = __raw_readl(S3C2410_GPHCON);
tmp &= ~((3<<28)|(3<<8));
tmp |= (1<<28)|(1<<8);
__raw_writel(tmp, S3C2410_GPHCON);
tmp = __raw_readl(S3C2410_GPHUP);
tmp &= ~((3<<28)|(3<<8));
__raw_writel(tmp, S3C2410_GPHUP);
tmp = __raw_readl(S3C2410_GPHDAT);
tmp &= ~((1<<14)|(1<<4));
__raw_writel(tmp, S3C2410_GPHDAT);
/* Disable TCON power */
tmp = __raw_readl(S3C2410_GPBCON);
tmp &= ~((3<<6));
tmp |= (1<<6);
__raw_writel(tmp, S3C2410_GPBCON);
tmp = __raw_readl(S3C2410_GPBUP);
tmp &= ~((3<<6));
__raw_writel(tmp, S3C2410_GPBUP);
tmp = __raw_readl(S3C2410_GPBDAT);
tmp &= ~(1<<3);
__raw_writel(tmp, S3C2410_GPBDAT);
/* Disable Touch power */
/* Disable wifi/bt power */
tmp = __raw_readl(S3C2410_GPDCON);
tmp &= ~((3<<20)|(3<22));
tmp |= (1<<20)|(1<<22);
__raw_writel(tmp, S3C2410_GPDCON);
tmp = __raw_readl(S3C2410_GPDUP);
tmp &= ~((3<<20)|(3<<22));
__raw_writel(tmp, S3C2410_GPDUP);
tmp = __raw_readl(S3C2410_GPDDAT);
tmp &= ~((1<<11)|(1<<10));
__raw_writel(tmp, S3C2410_GPDDAT);
#endif
__raw_writel(__raw_readl(S3C2410_EINTPEND), S3C2410_EINTPEND);
__raw_writel(__raw_readl(S3C2410_INTPND), S3C2410_INTPND);
__raw_writel(__raw_readl(S3C2410_SRCPND), S3C2410_SRCPND);
__raw_writel( (1<<15), S3C2443_PWRCFG);
#ifdef CONFIG_PM_CPU_MODE
/* set our standby method to sleep */
switch(pm_cpu_mode){
case PM_CPU_DEVICE_MODE_SUSPEND:
__raw_writel(0x2BED, S3C2443_PWRMODE);
switch(pm_cpu_mode)
{
case PM_CPU_DEVICE_MODE_SUSPEND:
__raw_writel(0x2BED, S3C2443_PWRMODE);
break;
case PM_CPU_MODE_STOP:
__raw_writel(((__raw_readl(S3C2443_PWRMODE) & ~(1<<16))| (1<<16)), S3C2443_PWRMODE);
case PM_CPU_MODE_STOP:
__raw_writel(((__raw_readl(S3C2443_PWRMODE) & ~(1<<16))| (1<<16)), S3C2443_PWRMODE);
break;
case PM_CPU_MODE_DEEP_STOP:
case PM_CPU_MODE_DEEP_STOP:
__raw_writel(((__raw_readl(S3C2443_PWRCFG) & ~(1<<16))| (1<<16)), S3C2443_PWRCFG);
__raw_writel(((__raw_readl(S3C2443_PWRMODE) & ~(1<<16))| (1<<16)), S3C2443_PWRMODE);
break;
case PM_CPU_MODE_IDLE:
__raw_writel(((__raw_readl(S3C2443_PWRCFG) & ~(1<<17))| (1<<17)), S3C2443_PWRCFG);
asm("mcr p15, 0, r0, c7, c0, 4"); /* wait for interrupt */
__raw_writel(((__raw_readl(S3C2443_PWRCFG) & ~(1<<17))| (1<<17)), S3C2443_PWRCFG);
asm("mcr p15, 0, r0, c7, c0, 4"); /* wait for interrupt "STANDBYWFI" */
break;
case PM_CPU_MODE_SLEEP:
__raw_writel(0x2BED, S3C2443_PWRMODE);
__raw_writel(0x2BED, S3C2443_PWRMODE);
break;
default:
__raw_writel(0x2BED, S3C2443_PWRMODE);
__raw_writel(0x2BED, S3C2443_PWRMODE);
break;
}
#else
@@ -101,90 +154,52 @@ static void s3c2450_cpu_suspend(void)
#endif
}
static void s3c2450_pm_prepare(void)
static void s3c2416_pm_prepare(void)
{
int ret;
/* set flag to wake up */
__raw_writel(0x2BED, S3C2443_INFORM0);
/* memory auto-detect configuration for u-boot side wake-up */
ret = __raw_readl(S3C2410_BWSCON) & S3C2410_MEMCFG_MASK;
if(ret == S3C2410_MEMCFG_MDDR)
__raw_writel(0xDD, S3C2443_INFORM2); /* mDDR */
else if(ret == S3C2410_MEMCFG_MSDR)
__raw_writel(0xDA, S3C2443_INFORM2); /* mSDRAM */
else if(ret == S3C2410_MEMCFG_DDR2)
panic("DDR2 is not supported at u-boot");
else
panic("memory setup is not correct?");
/* Set Power_Mode to low */
//s3c2410_gpio_cfgpin(S3C2410_GPD12, S3C2410_GPD12_OUTP); /* <- D12 should already be configured */
/* TODO: have a "charger/battery driver" (maybe inside the USB driver?) */
s3c2410_gpio_setpin(S3C2410_GPD12, 0);
}
static int s3c2450_pm_add(struct sys_device *sysdev)
static int s3c2416_pm_add(struct sys_device *sysdev)
{
pm_cpu_prep = s3c2450_pm_prepare;
pm_cpu_sleep = s3c2450_cpu_suspend;
pm_cpu_prep = s3c2416_pm_prepare;
pm_cpu_sleep = s3c2416_cpu_suspend;
return 0;
}
static struct sleep_save s3c2450_sleep[] = {
// SAVE_ITEM(S3C2450_DSC0),
// SAVE_ITEM(S3C2450_DSC1),
// SAVE_ITEM(S3C2413_GPJDAT),
// SAVE_ITEM(S2C2413_GPJCON),
// SAVE_ITEM(S3C2413_GPJUP),
/* save the PWRCFG to get back to original sleep method */
// SAVE_ITEM(S3C2443_PWRMODE),
/* save the sleep configuration anyway, just in case these
* get damaged during wakeup */
// SAVE_ITEM(S3C2450_GPBSLPCON),
// SAVE_ITEM(S3C2450_GPCSLPCON),
// SAVE_ITEM(S3C2450_GPDSLPCON),
// SAVE_ITEM(S3C2450_GPESLPCON),
// SAVE_ITEM(S3C2450_GPFSLPCON),
// SAVE_ITEM(S3C2450_GPGSLPCON),
// SAVE_ITEM(S3C2450_GPHSLPCON),
// SAVE_ITEM(S3C2413_GPJSLPCON),
};
static int s3c2450_pm_suspend(struct sys_device *dev, pm_message_t state)
static int s3c2416_pm_suspend(struct sys_device *dev, pm_message_t state)
{
s3c2410_pm_do_save(s3c2450_sleep, ARRAY_SIZE(s3c2450_sleep));
return 0;
}
static int s3c2450_pm_resume(struct sys_device *dev)
static int s3c2416_pm_resume(struct sys_device *dev)
{
// unsigned long tmp;
// tmp = __raw_readl(S3C2443_RSTCON);
// tmp |= (1<<16);
// __raw_writel(tmp, S3C2443_RSTCON);
// __raw_writel(0, S3C2443_PWRMODE);
__raw_writel(0x0, S3C2443_INFORM0);
__raw_writel(0x0, S3C2443_INFORM2);
s3c2410_pm_do_restore(s3c2450_sleep, ARRAY_SIZE(s3c2450_sleep));
/* set PowerMode as high */
// s3c2410_gpio_cfgpin(S3C2410_GPD12, S3C2410_GPD12_OUTP); /* <- D12 should already be configured */
s3c2410_gpio_setpin(S3C2410_GPD12, 1);
return 0;
}
static struct sysdev_driver s3c2450_pm_driver = {
.add = s3c2450_pm_add,
.suspend = s3c2450_pm_suspend,
.resume = s3c2450_pm_resume,
static struct sysdev_driver s3c2416_pm_driver = {
.add = s3c2416_pm_add,
.suspend = s3c2416_pm_suspend,
.resume = s3c2416_pm_resume,
};
static __init int s3c2450_pm_init(void)
static __init int s3c2416_pm_init(void)
{
return sysdev_driver_register(&s3c2416_sysclass, &s3c2450_pm_driver);
return sysdev_driver_register(&s3c2416_sysclass, &s3c2416_pm_driver);
}
arch_initcall(s3c2450_pm_init);
arch_initcall(s3c2416_pm_init);

View File

@@ -43,65 +43,56 @@
#include <asm/plat-s3c24xx/devs.h>
#include <asm/plat-s3c24xx/pm.h>
/*Qisda , wenny cheng , 20091224 , board id info {*/
int board_id = 0;
/*Qisda , wenny cheng , 20091224 , board id info }*/
/* LED devices */
static struct s3c24xx_led_platdata smdk_pdata_led4 = {
.gpio = S3C2410_GPF4,
static struct s3c24xx_led_platdata smdk_pdata_led0 = {
.gpio = S3C2410_GPH12,
.flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
.name = "led4",
.def_trigger = "timer",
.name = "led0",
.def_trigger = "power",
};
static struct s3c24xx_led_platdata smdk_pdata_led5 = {
.gpio = S3C2410_GPF5,
/*static struct s3c24xx_led_platdata smdk_pdata_led1 = {
.gpio = S3C_GPK8,
.flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
.name = "led5",
.def_trigger = "nand-disk",
.name = "led1",
.def_trigger = "bluetooth",
};
static struct s3c24xx_led_platdata smdk_pdata_led6 = {
.gpio = S3C2410_GPF6,
static struct s3c24xx_led_platdata smdk_pdata_led2 = {
.gpio = S3C_GPK9,
.flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
.name = "led6",
};
.def_trigger = "wifi",
};*/
static struct s3c24xx_led_platdata smdk_pdata_led7 = {
.gpio = S3C2410_GPF7,
.flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
.name = "led7",
};
static struct platform_device smdk_led4 = {
static struct platform_device smdk_led0 = {
.name = "s3c24xx_led",
.id = 0,
.dev = {
.platform_data = &smdk_pdata_led4,
.platform_data = &smdk_pdata_led0,
},
};
static struct platform_device smdk_led5 = {
/*static struct platform_device smdk_led1 = {
.name = "s3c24xx_led",
.id = 1,
.dev = {
.platform_data = &smdk_pdata_led5,
.platform_data = &smdk_pdata_led1,
},
};
static struct platform_device smdk_led6 = {
static struct platform_device smdk_led2 = {
.name = "s3c24xx_led",
.id = 2,
.dev = {
.platform_data = &smdk_pdata_led6,
.platform_data = &smdk_pdata_led2,
},
};
static struct platform_device smdk_led7 = {
.name = "s3c24xx_led",
.id = 3,
.dev = {
.platform_data = &smdk_pdata_led7,
},
};
};*/
/* NAND parititon from 2.4.18-swl5 */
@@ -230,15 +221,51 @@ static struct s3c2410_platform_nand smdk_nand_info = {
static struct platform_device __initdata *smdk_devs[] = {
&s3c_device_nand,
&s3c_device_onenand,
&smdk_led4,
&smdk_led5,
&smdk_led6,
&smdk_led7,
&smdk_led0,
/* &smdk_led1,
&smdk_led2,*/
};
void __init smdk_machine_init(void)
{
/* Configure the LEDs (even if we have no LED support)*/
/*Qisda , wenny cheng , 20091224 , board id info {*/
//writel((readl(S3C2416_GPKCON) & ~(3<<18)), S3C2416_GPKCON);
//writel((readl(S3C2416_GPKUDP) & ~(3<<18)), S3C2416_GPKUDP);
//writel((readl(S3C2416_GPKCON) & ~(3<<16)), S3C2416_GPKCON);
//writel((readl(S3C2416_GPKUDP) & ~(3<<16)), S3C2416_GPKUDP);
//writel((readl(S3C2410_GPHCON) & ~(3<<24)), S3C2410_GPHCON);
//writel((readl(S3C2410_GPHUP) & ~(3<<24)), S3C2410_GPHUP);
#ifdef CONFIG_QISDA_BQ060B00_DVT
if((readl(S3C2416_GPKDAT) & (1<<1))){
board_id = BQ060B00_A02;
}
else{
board_id = BQ060B00_A01_And_Before;
}
#elif defined(CONFIG_QISDA_QD090B00)
if((readl(S3C2416_GPKDAT) & (1<<3))){
board_id = QD090B00_S03;
}
else{
board_id = QD090B00_S02;
}
#else
if((readl(S3C2416_GPKDAT) & (1<<1))){
board_id = QD060B00_A02;
}
else{
board_id = QD060B00_A01_And_Before;
}
#endif
//printk("\nsmdk_machine_init: %d\n", as090b00_board_id);
/*Qisda , wenny cheng , 20091224 , board id info }*/
//Qisda, Leo SJ Yang, 2009/08/14, re{
// remove gpio configuration that doesn't need in EVT2
#ifdef CONFIG_QISDA_E600_EVT0
@@ -269,6 +296,9 @@ void __init smdk_machine_init(void)
#ifdef CONFIG_QISDA_E600_EVT0
writel((readl(S3C2416_GPKCON) & ~(1<<5) | (1<<4)), S3C2416_GPKCON);
writel((readl(S3C2416_GPKDAT) | (1<<2)), S3C2416_GPKDAT);
#elif CONFIG_QISDA_BK060B00
s3c2410_gpio_cfgpin(S3C2410_GPD10, S3C2410_GPD10_OUTP);
s3c2410_gpio_setpin(S3C2410_GPD10, 1);
#else
s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
s3c2410_gpio_setpin(S3C2410_GPF5, 1);

View File

@@ -41,6 +41,13 @@
#include <asm/io.h>
#include <asm/arch/regs-serial.h>
/*Qisda , wenny cheng , 20091224 , board id info {*/
#include <../include/asm-arm/plat-s3c24xx/common-smdk.h>
/*Qisda , wenny cheng , 20091224 , board id info }*/
/*Qisda Qube, suspend mode gpio config 20091117*/
#include <asm/arch/regs-mem.h>
/*Qisda Qube, suspend mode gpio config 20091117*/
#if defined (CONFIG_CPU_S3C6400)
#include <asm/arch/regs-s3c6400-clock.h>
@@ -54,6 +61,41 @@
#include <asm/arch/regs-clock.h>
#endif
/*Qisda Qube, suspend mode gpio config 20091117*/
#define S3C2410_GPIO_BANKM (32*16)
#define S3C2410_GPMCON S3C2410_GPIOREG(0x100)
#define S3C2410_GPMDAT S3C2410_GPIOREG(0x104)
#define S3C2410_GPMUP S3C2410_GPIOREG(0x108)
#define S3C2410_GPMSEL S3C2410_GPIOREG(0x10C)
#define S3C2410_GPM0 S3C2410_GPIONO(S3C2410_GPIO_BANKM, 0)
#define S3C2410_GPM0_INP (0x00 << 0)
#define S3C2410_GPM1 S3C2410_GPIONO(S3C2410_GPIO_BANKM, 1)
#define S3C2410_GPM1_INP (0x00 << 2)
#define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
#define S3C_CLKREG(x) ((x) + S3C24XX_VA_SYSCON)
#define S3C2410_LOCKTIME S3C2410_CLKREG(0x00)
#define S3C24XX_LOCKTIME0 S3C_CLKREG(0x00)
#define S3C24XX_LOCKTIME1 S3C_CLKREG(0x04)
#define S3C2410_MPLLCON S3C2410_CLKREG(0x04)
#define S3C2410_UPLLCON S3C2410_CLKREG(0x08)
#define S3C2410_CLKCON S3C2410_CLKREG(0x0C)
#define S3C2410_CLKSLOW S3C2410_CLKREG(0x10)
#define S3C2410_CLKDIVN S3C2410_CLKREG(0x14)
void pm_gpio_setting_enhancement (void);
#if 0
void test_message(void);
#endif
/*Qisda Qube, suspend mode gpio config 20091117*/
#include <asm/arch/regs-gpio.h>
#include <asm/arch/regs-gpioj.h>
#include <asm/arch/regs-dsc.h>
@@ -79,6 +121,11 @@ extern unsigned char pm_cpu_mode;
#endif
/* } Qisda, ShiYong Lin, 2009/08/18, Wake up source */
/* 2010/1/21, weichen, for handling events during suspend */
#if defined (CONFIG_PM_PLATFORM_POWER_SAVING)
extern unsigned int g_wakeup_event_occurs;
#endif
/* for external use */
unsigned long s3c_pm_flags;
@@ -104,6 +151,19 @@ static struct sleep_save core_save[] = {
SAVE_ITEM(S3C2443_PCLKCON),
SAVE_ITEM(S3C2443_SCLKCON),
/*Qisda Qube, suspend mode kernel panic 20091117*/
//s3c2416 dram config 0,4,8,c,10
SAVE_ITEM(S3C2410_BWSCON),
SAVE_ITEM(S3C2410_BANKCON0),
SAVE_ITEM(S3C2410_BANKCON1),
SAVE_ITEM(S3C2410_BANKCON2),
SAVE_ITEM(S3C2410_BANKCON3),
SAVE_ITEM(S3C2410_BANKCON4),
/*Qisda Qube, suspend mode gpio config 20091117*/
/*Qisda Qube, suspend mode kernel panic 20091117*/
#else
SAVE_ITEM(S3C2410_LOCKTIME),
SAVE_ITEM(S3C2410_CLKCON),
@@ -715,7 +775,6 @@ static void s3c2410_pm_show_resume_irqs(int start, unsigned long which,
}
#if !defined (CONFIG_CPU_S3C6400) && !defined (CONFIG_CPU_S3C6410)
#if !defined(CONFIG_CPU_S3C2450) && !defined(CONFIG_CPU_S3C2416)
/* s3c2410_pm_check_resume_pin
*
* check to see if the pin is configured correctly for sleep mode, and
@@ -746,581 +805,15 @@ static void s3c2410_pm_check_resume_pin(unsigned int pin, unsigned int irqoffs)
}
}
#endif
/* s3c2410_pm_configure_extint
*
* configure all external interrupt pins
*/
/* Qisda, ShiYong Lin, 2009/09/08, Wake up source {*/
void set_system_off_wkup_srce(void)
{
printk("Set_system_off_wkup_srce\n");
#ifdef CONFIG_QISDA_AS090B00_EVT1
// Power button, GPF0
s3c2410_gpio_cfgpin(S3C2410_GPF0, S3C2410_GPF0_EINT0);
s3c2410_gpio_pullup(S3C2410_GPF0, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<3)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<0))|(2<<0)), S3C2410_EXTINT0);
// The insertion of SD card, GPF1
s3c2410_gpio_cfgpin(S3C2410_GPF1, S3C2410_GPF1_INP);
s3c2410_gpio_pullup(S3C2410_GPF1, 2);
// TP_INT, GPF2
s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_INP);
s3c2410_gpio_pullup(S3C2410_GPF2, 2);
// SPI_INT, GPF3
s3c2410_gpio_cfgpin(S3C2410_GPF3, S3C2410_GPF3_INP);
s3c2410_gpio_pullup(S3C2410_GPF3, 2);
// The insertion of earphone, GPF4
s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_INP);
s3c2410_gpio_pullup(S3C2410_GPF4, 2);
// Touch_EN, GPF5
s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
s3c2410_gpio_setpin(S3C2410_GPF5, 0);
// FUNCTION key, GPF6
s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_INP);
s3c2410_gpio_pullup(S3C2410_GPF6, 2);
// Pagedown key, GPF7
s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_INP);
s3c2410_gpio_pullup(S3C2410_GPF7, 2);
#if 0
// P_KEEP, GPG0, needn't open
s3c2410_gpio_cfgpin(S3C2410_GPG0, S3C2410_GPG0_EINT8);
s3c2410_gpio_pullup(S3C2410_GPG0, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<3)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<0))|(2<<0)), S3C2410_EXTINT1);
#endif
// VBUS_IN_STA, GPG1, need to open when EVT2
s3c2410_gpio_cfgpin(S3C2410_GPG1, S3C2410_GPG1_EINT9);
s3c2410_gpio_pullup(S3C2410_GPG1, 0);
writel((readl(S3C2410_EXTINT1) & ~(1<<7)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<4))|(6<<4)), S3C2410_EXTINT1);
s3c2410_gpio_cfgpin(S3C2410_GPG2, S3C2410_GPG2_OUTP);
s3c2410_gpio_setpin(S3C2410_GPG2, 0);
#if 0
// Audio_resetn pin, GPG3, needn't open
s3c2410_gpio_cfgpin(S3C2410_GPG3, S3C2410_GPG3_EINT11);
s3c2410_gpio_pullup(S3C2410_GPG3, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<15)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<12))|(2<<12)), S3C2410_EXTINT1);
#endif
#if 0
// WLAN_MAC_wake, GPG4
s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_INP);
s3c2410_gpio_pullup(S3C2410_GPG4, 2);
#endif
// Power_Fail, GPG5, need to open when EVT2
// active low
s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPG5_EINT13);
s3c2410_gpio_pullup(S3C2410_GPG5, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<23)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<20))|(2<<20)), S3C2410_EXTINT1);
// Library, GPG6
s3c2410_gpio_cfgpin(S3C2410_GPG6, S3C2410_GPG6_INP);
s3c2410_gpio_pullup(S3C2410_GPG6, 2);
// Page up key, GPG7
s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPG7_INP);
s3c2410_gpio_pullup(S3C2410_GPG7, 2);
/* Qisda, ShiYong Lin, 2009/09/25, Power consumption {*/
s3c2410_gpio_cfgpin(S3C2410_GPL13, S3C2410_GPL13_OUTP);
s3c2410_gpio_setpin(S3C2410_GPL13, 0);
/* } Qisda, ShiYong Lin, 2009/09/25, Power consumption */
#elif defined (CONFIG_QISDA_AS090B00_EVT1_1) || defined (CONFIG_QISDA_QD090B00_EVT1) || defined(CONFIG_QISDA_QD060N00_DVT1_1)
// Power button, GPF0
printk("Set_system_off_wkup_srce, CONFIG_QISDA_AS090B00_EVT1_1\n");
s3c2410_gpio_cfgpin(S3C2410_GPF0, S3C2410_GPF0_EINT0);
s3c2410_gpio_pullup(S3C2410_GPF0, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<3)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<0))|(2<<0)), S3C2410_EXTINT0);
// The insertion of SD card, GPF1
s3c2410_gpio_cfgpin(S3C2410_GPF1, S3C2410_GPF1_INP);
s3c2410_gpio_pullup(S3C2410_GPF1, 2);
// TP_INT, GPF2
s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_INP);
s3c2410_gpio_pullup(S3C2410_GPF2, 2);
// SPI_INT, GPF3
s3c2410_gpio_cfgpin(S3C2410_GPF3, S3C2410_GPF3_INP);
s3c2410_gpio_pullup(S3C2410_GPF3, 2);
// The insertion of earphone, GPF4
s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_INP);
s3c2410_gpio_pullup(S3C2410_GPF4, 2);
// Touch_EN, GPF5
s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
s3c2410_gpio_setpin(S3C2410_GPF5, 0);
// CHG_STA key, GPF6
s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_INP);
s3c2410_gpio_pullup(S3C2410_GPF6, 0);
// Pagedown key, GPF7
s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_INP);
s3c2410_gpio_pullup(S3C2410_GPF7, 2);
#if 0
// P_KEEP, GPG0, needn't open
s3c2410_gpio_cfgpin(S3C2410_GPG0, S3C2410_GPG0_EINT8);
s3c2410_gpio_pullup(S3C2410_GPG0, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<3)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<0))|(2<<0)), S3C2410_EXTINT1);
#endif
// VBUS_IN_STA, GPG1
s3c2410_gpio_cfgpin(S3C2410_GPG1, S3C2410_GPG1_EINT9);
s3c2410_gpio_pullup(S3C2410_GPG1, 0);
writel((readl(S3C2410_EXTINT1) & ~(1<<7)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<4))|(6<<4)), S3C2410_EXTINT1);
// SD power, GPG2
s3c2410_gpio_cfgpin(S3C2410_GPG2, S3C2410_GPG2_OUTP);
s3c2410_gpio_setpin(S3C2410_GPG2, 0);
// 3G ON-OFF, GPG3
s3c2410_gpio_cfgpin(S3C2410_GPG3, S3C2410_GPG3_OUTP);
s3c2410_gpio_setpin(S3C2410_GPG3, 0);
// WLAN_MAC_wake, GPG4
s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_INP);
s3c2410_gpio_pullup(S3C2410_GPG4, 2);
// Power_Fail, GPG5, need to open when EVT2
// active low
s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPG5_EINT13);
s3c2410_gpio_pullup(S3C2410_GPG5, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<23)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<20))|(2<<20)), S3C2410_EXTINT1);
// Function, GPG6
s3c2410_gpio_cfgpin(S3C2410_GPG6, S3C2410_GPG6_INP);
s3c2410_gpio_pullup(S3C2410_GPG6, 2);
// PageUp key, GPG7
s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPG7_INP);
s3c2410_gpio_pullup(S3C2410_GPG7, 2);
/* Qisda, ShiYong Lin, 2009/09/25, Power consumption {*/
s3c2410_gpio_cfgpin(S3C2410_GPL13, S3C2410_GPL13_OUTP);
s3c2410_gpio_setpin(S3C2410_GPL13, 0);
/* } Qisda, ShiYong Lin, 2009/09/25, Power consumption */
#else
// Power button, GPF0
s3c2410_gpio_cfgpin(S3C2410_GPF0, S3C2410_GPF0_EINT0);
s3c2410_gpio_pullup(S3C2410_GPF0, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<3)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<0))|(2<<0)), S3C2410_EXTINT0);
// The insertion of SD card, GPF1
s3c2410_gpio_cfgpin(S3C2410_GPF1, S3C2410_GPF1_INP);
s3c2410_gpio_pullup(S3C2410_GPF1, 2);
// The touch panel, GPF2
s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_INP);
s3c2410_gpio_pullup(S3C2410_GPF2, 2);
// Menu key, GPF3
s3c2410_gpio_cfgpin(S3C2410_GPF3, S3C2410_GPF3_INP);
s3c2410_gpio_pullup(S3C2410_GPF3, 2);
// The insertion of earphone, GPF4
s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_INP);
s3c2410_gpio_pullup(S3C2410_GPF4, 2);
// Touch_EN, GPF5
s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
s3c2410_gpio_setpin(S3C2410_GPF5, 0);
// Search key, GPF6
s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_INP);
s3c2410_gpio_pullup(S3C2410_GPF6, 2);
// Pagedown key, GPF7
s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_INP);
s3c2410_gpio_pullup(S3C2410_GPF7, 2);
#if 0
// P_KEEP, GPG0, needn't open
s3c2410_gpio_cfgpin(S3C2410_GPG0, S3C2410_GPG0_EINT8);
s3c2410_gpio_pullup(S3C2410_GPG0, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<3)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<0))|(2<<0)), S3C2410_EXTINT1);
#endif
// CHG_STA, GPG1, need to open when EVT2
s3c2410_gpio_cfgpin(S3C2410_GPG1, S3C2410_GPG1_EINT9);
s3c2410_gpio_pullup(S3C2410_GPG1, 0);
writel((readl(S3C2410_EXTINT1) & ~(1<<7)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<4))|(6<<4)), S3C2410_EXTINT1);
#if 0
// T_SENSOR1, GPG2, need to open when EVT2
s3c2410_gpio_cfgpin(S3C2410_GPG2, S3C2410_GPG2_EINT10);
s3c2410_gpio_pullup(S3C2410_GPG2, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<11)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<8))|(2<<8)), S3C2410_EXTINT1);
#else
s3c2410_gpio_cfgpin(S3C2410_GPG2, S3C2410_GPG2_EINT10);
s3c2410_gpio_pullup(S3C2410_GPG2, 0);
#endif
#if 0
// PI2C_EN pin, GPG3, needn't open
s3c2410_gpio_cfgpin(S3C2410_GPG3, S3C2410_GPG3_EINT11);
s3c2410_gpio_pullup(S3C2410_GPG3, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<15)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<12))|(2<<12)), S3C2410_EXTINT1);
#endif
// Return key, GPG4
s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_INP);
s3c2410_gpio_pullup(S3C2410_GPG4, 2);
// Power_Fail, GPG5, need to open when EVT2
// active low
s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPG5_EINT13);
s3c2410_gpio_pullup(S3C2410_GPG5, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<23)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<20))|(2<<20)), S3C2410_EXTINT1);
#if 0
// EN2, GPG6
s3c2410_gpio_cfgpin(S3C2410_GPG6, S3C2410_GPG6_EINT14);
s3c2410_gpio_pullup(S3C2410_GPG6, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<27)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT1) & ~(7<<24))|(2<<24)), S3C2410_EXTINT0);
#endif
// Page up key, GPG7
s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPG7_INP);
s3c2410_gpio_pullup(S3C2410_GPG7, 2);
#endif
}
void set_system_sleep_wkup_srce(void)
{
printk("Set_system_sleep_wkup_srce\n");
#ifdef CONFIG_QISDA_AS090B00_EVT1
// Power button, GPF0
s3c2410_gpio_cfgpin(S3C2410_GPF0, S3C2410_GPF0_EINT0);
s3c2410_gpio_pullup(S3C2410_GPF0, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<3)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<0))|(2<<0)), S3C2410_EXTINT0);
// The insertion of SD card, GPF1
s3c2410_gpio_cfgpin(S3C2410_GPF1, S3C2410_GPF1_EINT1);
s3c2410_gpio_pullup(S3C2410_GPF1, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<7)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<4))|(6<<4)), S3C2410_EXTINT0);
// TP_INT, GPF2
s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_EINT2);
s3c2410_gpio_pullup(S3C2410_GPF2, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<11)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<8))|(2<<8)), S3C2410_EXTINT0);
#if 0
// SPI_INT, GPF3
s3c2410_gpio_cfgpin(S3C2410_GPF3, S3C2410_GPF3_EINT3);
s3c2410_gpio_pullup(S3C2410_GPF3, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<15)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<12))|(2<<12)), S3C2410_EXTINT0);
#endif
// The insertion of earphone, GPF4
s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_EINT4);
s3c2410_gpio_pullup(S3C2410_GPF4, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<19)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<16))|(6<<16)), S3C2410_EXTINT0);
// Touch_EN, GPF5
s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
s3c2410_gpio_setpin(S3C2410_GPF5, 0);
// Function key, GPF6
s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_EINT6);
s3c2410_gpio_pullup(S3C2410_GPF6, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<27)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<24))|(6<<24)), S3C2410_EXTINT0);
// Pagedown key, GPF7
s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_EINT7);
s3c2410_gpio_pullup(S3C2410_GPF7, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<31)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<28))|(6<<28)), S3C2410_EXTINT0);
#if 0
// P_KEEP, GPG0, needn't open
s3c2410_gpio_cfgpin(S3C2410_GPG0, S3C2410_GPG0_EINT8);
s3c2410_gpio_pullup(S3C2410_GPG0, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<3)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<0))|(2<<0)), S3C2410_EXTINT1);
#endif
// VBUS_IN_STA, GPG1
s3c2410_gpio_cfgpin(S3C2410_GPG1, S3C2410_GPG1_EINT9);
s3c2410_gpio_pullup(S3C2410_GPG1, 0);
writel((readl(S3C2410_EXTINT1) & ~(1<<7)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<4))|(6<<4)), S3C2410_EXTINT1);
// PWREN_SD, GPG2
s3c2410_gpio_cfgpin(S3C2410_GPG2, S3C2410_GPG2_OUTP);
s3c2410_gpio_setpin(S3C2410_GPG2, 0);
#if 0
// Audio_resetn pin, GPG3, needn't open
s3c2410_gpio_cfgpin(S3C2410_GPG3, S3C2410_GPG3_EINT11);
s3c2410_gpio_pullup(S3C2410_GPG3, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<15)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<12))|(2<<12)), S3C2410_EXTINT1);
#endif
#if 0
// WLAN_MAC_Wake key, GPG4
s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_EINT12);
s3c2410_gpio_pullup(S3C2410_GPG4, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<19)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<16))|(2<<16)), S3C2410_EXTINT1);
#endif
// Power_Fail, GPG5
// active low
s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPG5_EINT13);
s3c2410_gpio_pullup(S3C2410_GPG5, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<23)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<20))|(2<<20)), S3C2410_EXTINT1);
// Library, GPG6
s3c2410_gpio_cfgpin(S3C2410_GPG6, S3C2410_GPG6_EINT14);
s3c2410_gpio_pullup(S3C2410_GPG6, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<27)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT1) & ~(7<<24))|(6<<24)), S3C2410_EXTINT0);
// Page up key, GPG7
s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPG7_EINT15);
s3c2410_gpio_pullup(S3C2410_GPG7, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<31)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<28))|(6<<28)), S3C2410_EXTINT1);
/* Qisda, ShiYong Lin, 2009/09/25, Power consumption {*/
s3c2410_gpio_cfgpin(S3C2410_GPL13, S3C2410_GPL13_OUTP);
s3c2410_gpio_setpin(S3C2410_GPL13, 0);
/* } Qisda, ShiYong Lin, 2009/09/25, Power consumption */
#elif defined (CONFIG_QISDA_AS090B00_EVT1_1) || defined (CONFIG_QISDA_QD090B00_EVT1) || defined(CONFIG_QISDA_QD060N00_DVT1_1)
// Power button, GPF0
s3c2410_gpio_cfgpin(S3C2410_GPF0, S3C2410_GPF0_EINT0);
s3c2410_gpio_pullup(S3C2410_GPF0, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<3)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<0))|(2<<0)), S3C2410_EXTINT0);
// The insertion of SD card, GPF1
s3c2410_gpio_cfgpin(S3C2410_GPF1, S3C2410_GPF1_INP);
s3c2410_gpio_pullup(S3C2410_GPF1, 2);
// TP_INT, GPF2
s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_EINT2);
s3c2410_gpio_pullup(S3C2410_GPF2, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<11)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<8))|(2<<8)), S3C2410_EXTINT0);
// SPI_INT, GPF3
s3c2410_gpio_cfgpin(S3C2410_GPF3, S3C2410_GPF3_INP);
s3c2410_gpio_pullup(S3C2410_GPF3, 2);
// The insertion of earphone, GPF4
s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_INP);
s3c2410_gpio_pullup(S3C2410_GPF4, 2);
// Touch_EN, GPF5
// s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
// s3c2410_gpio_setpin(S3C2410_GPF5, 0);
// CHG_STA key, GPF6
s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_INP);
s3c2410_gpio_pullup(S3C2410_GPF6, 0);
// Pagedown key, GPF7
s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_EINT7);
s3c2410_gpio_pullup(S3C2410_GPF7, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<31)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<28))|(6<<28)), S3C2410_EXTINT0);
#if 0
// P_KEEP, GPG0, needn't open
s3c2410_gpio_cfgpin(S3C2410_GPG0, S3C2410_GPG0_EINT8);
s3c2410_gpio_pullup(S3C2410_GPG0, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<3)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<0))|(2<<0)), S3C2410_EXTINT1);
#endif
// VBUS_IN_STA, GPG1
s3c2410_gpio_cfgpin(S3C2410_GPG1, S3C2410_GPG1_EINT9);
s3c2410_gpio_pullup(S3C2410_GPG1, 0);
writel((readl(S3C2410_EXTINT1) & ~(1<<7)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<4))|(6<<4)), S3C2410_EXTINT1);
s3c2410_gpio_cfgpin(S3C2410_GPG2, S3C2410_GPG2_OUTP);
s3c2410_gpio_setpin(S3C2410_GPG2, 0);
// 3G_ON_OFF pin, GPG3
s3c2410_gpio_cfgpin(S3C2410_GPG3, S3C2410_GPG3_OUTP);
s3c2410_gpio_setpin(S3C2410_GPG3, 0);
#if 0
// WLAN_MAC_Wake key, GPG4
s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_EINT12);
s3c2410_gpio_pullup(S3C2410_GPG4, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<19)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<16))|(2<<16)), S3C2410_EXTINT1);
#endif
// Power_Fail, GPG5
// active low
s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPG5_EINT13);
s3c2410_gpio_pullup(S3C2410_GPG5, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<23)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<20))|(2<<20)), S3C2410_EXTINT1);
// Function, GPG6
s3c2410_gpio_cfgpin(S3C2410_GPG6, S3C2410_GPG6_EINT14);
s3c2410_gpio_pullup(S3C2410_GPG6, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<27)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT1) & ~(7<<24))|(6<<24)), S3C2410_EXTINT0);
// Pageup key, GPG7
s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPG7_EINT15);
s3c2410_gpio_pullup(S3C2410_GPG7, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<31)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<28))|(6<<28)), S3C2410_EXTINT1);
/* Qisda, ShiYong Lin, 2009/09/25, Power consumption {*/
s3c2410_gpio_cfgpin(S3C2410_GPL13, S3C2410_GPL13_OUTP);
s3c2410_gpio_setpin(S3C2410_GPL13, 0);
/* } Qisda, ShiYong Lin, 2009/09/25, Power consumption */
#else
//other project
// Power button, GPF0
s3c2410_gpio_cfgpin(S3C2410_GPF0, S3C2410_GPF0_EINT0);
s3c2410_gpio_pullup(S3C2410_GPF0, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<3)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<0))|(2<<0)), S3C2410_EXTINT0);
// The insertion of SD card, GPF1
s3c2410_gpio_cfgpin(S3C2410_GPF1, S3C2410_GPF1_INP);
s3c2410_gpio_pullup(S3C2410_GPF1, 0);
// The touch panel, GPF2
s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_INP);
s3c2410_gpio_pullup(S3C2410_GPF2, 0);
// Menu key, GPF3
s3c2410_gpio_cfgpin(S3C2410_GPF3, S3C2410_GPF3_EINT3);
s3c2410_gpio_pullup(S3C2410_GPF3, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<15)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<12))|(6<<12)), S3C2410_EXTINT0);
// The insertion of earphone, GPF4
s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_EINT4);
s3c2410_gpio_pullup(S3C2410_GPF4, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<19)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<16))|(6<<16)), S3C2410_EXTINT0);
// Touch_EN, GPF5
s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
s3c2410_gpio_setpin(S3C2410_GPF5, 0);
// Search key, GPF6
s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_EINT6);
s3c2410_gpio_pullup(S3C2410_GPF6, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<27)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<24))|(6<<24)), S3C2410_EXTINT0);
// Pagedown key, GPF7
s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_EINT7);
s3c2410_gpio_pullup(S3C2410_GPF7, 2);
writel((readl(S3C2410_EXTINT0) & ~(1<<31)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT0) & ~(7<<28))|(6<<28)), S3C2410_EXTINT0);
#if 0
// P_KEEP, GPG0, needn't open
s3c2410_gpio_cfgpin(S3C2410_GPG0, S3C2410_GPG0_EINT8);
s3c2410_gpio_pullup(S3C2410_GPG0, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<3)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<0))|(2<<0)), S3C2410_EXTINT1);
#endif
// CHG_STA, GPG1
s3c2410_gpio_cfgpin(S3C2410_GPG1, S3C2410_GPG1_EINT9);
s3c2410_gpio_pullup(S3C2410_GPG1, 0);
writel((readl(S3C2410_EXTINT1) & ~(1<<7)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<4))|(6<<4)), S3C2410_EXTINT1);
s3c2410_gpio_cfgpin(S3C2410_GPG2, S3C2410_GPG2_INP);
s3c2410_gpio_pullup(S3C2410_GPG2, 0);
#if 0
// PI2C_EN pin, GPG3, needn't open
s3c2410_gpio_cfgpin(S3C2410_GPG3, S3C2410_GPG3_EINT11);
s3c2410_gpio_pullup(S3C2410_GPG3, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<15)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<12))|(2<<12)), S3C2410_EXTINT1);
#endif
// Return key, GPG4
s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_EINT12);
s3c2410_gpio_pullup(S3C2410_GPG4, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<19)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<16))|(6<<16)), S3C2410_EXTINT1);
// Power_Fail, GPG5
// active low
s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPG5_EINT13);
s3c2410_gpio_pullup(S3C2410_GPG5, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<23)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<20))|(2<<20)), S3C2410_EXTINT1);
#if 0
// EN2, GPG6
s3c2410_gpio_cfgpin(S3C2410_GPG6, S3C2410_GPG6_EINT14);
s3c2410_gpio_pullup(S3C2410_GPG6, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<27)), S3C2410_EXTINT0);
writel(((readl(S3C2410_EXTINT1) & ~(7<<24))|(2<<24)), S3C2410_EXTINT0);
#endif
// Page up key, GPG7
s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPG7_EINT15);
s3c2410_gpio_pullup(S3C2410_GPG7, 2);
writel((readl(S3C2410_EXTINT1) & ~(1<<31)), S3C2410_EXTINT1);
writel(((readl(S3C2410_EXTINT1) & ~(7<<28))|(6<<28)), S3C2410_EXTINT1);
#endif
}
/* } Qisda, ShiYong Lin, 2009/09/08, Wake up source */
static void s3c2410_pm_configure_extint(void)
{
#if !defined(CONFIG_CPU_S3C2450) && !defined(CONFIG_CPU_S3C2416)
int pin;
/* for each of the external interrupts (EINT0..EINT15) we
@@ -1335,57 +828,8 @@ static void s3c2410_pm_configure_extint(void)
for (pin = S3C2410_GPG0; pin <= S3C2410_GPG7; pin++) {
s3c2410_pm_check_resume_pin(pin, (pin - S3C2410_GPG0)+8);
}
#else
/* Qisda, ShiYong Lin, 2009/08/18, Wake up source {*/
#if 0
s3c2410_gpio_cfgpin(S3C2410_GPF0, S3C2410_GPF0_EINT0);
s3c2410_gpio_cfgpin(S3C2410_GPF3, S3C2410_GPF3_EINT3);
s3c2410_gpio_pullup(S3C2410_GPF0, 0);
s3c2410_gpio_pullup(S3C2410_GPF3, 0);
/* EINT0 filter enable */
writel((readl(S3C2410_EXTINT0) & ~(1<<3)), S3C2410_EXTINT0);
/* EINT3 filter enable */
writel((readl(S3C2410_EXTINT0) & ~(1<<15)), S3C2410_EXTINT0);
/* EINT0 falling edge triggered */
writel(((readl(S3C2410_EXTINT0) & ~(7<<0))|(2<<0)), S3C2410_EXTINT0);
/* EINT3 falling edge triggered */
writel(((readl(S3C2410_EXTINT0) & ~(7<<12))|(2<<12)), S3C2410_EXTINT0);
#else
if( wkup_srce == SYSTEM_OFF_STATE)
{
// System power off ( fake to power off)
// Wake up source
// 1. The long press of the power button
// 2. The insertion of the charger and USB (CHG_STA)
// 3. Power fail
set_system_off_wkup_srce();
}
else if (wkup_srce == SYSTEM_SLEEP_STATE)
{
// System sleep
// Wake up source
// 1. The short or long press of the power button
// 2. The insertion of the charger and USB (CHG_STA)
// 3. Menu, Search, Page_down,Page up, and return
// 4. Touch
// 5. The insertion of the Earphone
set_system_sleep_wkup_srce();
}
else
{
set_system_off_wkup_srce();
}
#endif
/* } Qisda, ShiYong Lin, 2009/08/18, Wake up source */
#endif
}
#else
#else /* !defined (CONFIG_CPU_S3C6400) && !defined (CONFIG_CPU_S3C6410) */
#if 0
extern int s3c_irqext_type(unsigned int irq, unsigned int type);
extern void s3c_irqext_unmaskack(unsigned int irqno);
@@ -1444,7 +888,6 @@ static int s3c2410_pm_enter(suspend_state_t state)
unsigned long regs_save[16];
/* ensure the debug is initialised (if enabled) */
s3c2410_pm_debug_init();
DBG("s3c2410_pm_enter(%d)\n", state);
@@ -1461,7 +904,6 @@ static int s3c2410_pm_enter(suspend_state_t state)
}
#endif
#if !defined(CONFIG_CPU_S3C2450) && !defined(CONFIG_CPU_S3C2416)
/* check if we have anything to wake-up with... bad things seem
* to happen if you suspend with no wakeup (system will often
* require a full power-cycle)
@@ -1473,7 +915,7 @@ static int s3c2410_pm_enter(suspend_state_t state)
printk(KERN_ERR PFX "Aborting sleep\n");
return -EINVAL;
}
#endif
/* prepare check area if configured */
s3c2410_pm_check_prepare();
@@ -1489,6 +931,7 @@ static int s3c2410_pm_enter(suspend_state_t state)
s3c2410_pm_do_save(gpio_save, ARRAY_SIZE(gpio_save));
s3c2410_pm_do_save(core_save, ARRAY_SIZE(core_save));
s3c2410_pm_do_save(uart_save, ARRAY_SIZE(uart_save));
#if defined(CONFIG_CPU_S3C2450) || defined(CONFIG_CPU_S3C2416)
s3c2410_pm_do_save(irq_save, ARRAY_SIZE(irq_save));
s3c2410_pm_do_save(smc_save, ARRAY_SIZE(smc_save));
@@ -1500,27 +943,6 @@ static int s3c2410_pm_enter(suspend_state_t state)
/* set the irq configuration for wake */
s3c2410_pm_configure_extint();
/* Qisda, ShiYong Lin, 2009/11/02, Set En1 and En2 based on charging source {*/
if(charging_source!=1){
//usb or nothing
//EN2
s3c2410_gpio_cfgpin(S3C2410_GPB0, S3C2410_GPB0_OUTP);
s3c2410_gpio_setpin(S3C2410_GPB0, 0);
//EN1
s3c2410_gpio_cfgpin(S3C2410_GPB4, S3C2410_GPB4_OUTP);
s3c2410_gpio_setpin(S3C2410_GPB4, 1);
}
else{
//charger
//EN2
s3c2410_gpio_cfgpin(S3C2410_GPB0, S3C2410_GPB0_OUTP);
s3c2410_gpio_setpin(S3C2410_GPB0, 1);
//EN1
s3c2410_gpio_cfgpin(S3C2410_GPB4, S3C2410_GPB4_OUTP);
s3c2410_gpio_setpin(S3C2410_GPB4, 0);
}
/* } Qisda, ShiYong Lin, 2009/11/02, Set En1 and En2 based on charging source */
DBG("sleep: irq wakeup masks: %08lx,%08lx\n",
s3c_irqwake_intmask, s3c_irqwake_eintmask);
@@ -1551,21 +973,14 @@ static int s3c2410_pm_enter(suspend_state_t state)
/* s3c2410_cpu_save will also act as our return point from when
* we resume as it saves its own register state, so use the return
* code to differentiate return from save and return from sleep */
/* Qisda, ShiYong Lin, 2009/10/27, set P_mode as high {*/
s3c2410_gpio_cfgpin(S3C2410_GPD12, S3C2410_GPD12_OUTP);
s3c2410_gpio_setpin(S3C2410_GPD12, 0);
/* } Qisda, ShiYong Lin, 2009/10/27, Set P_mode as high */
if(s3c2410_cpu_save(regs_save) == 0) {
flush_cache_all();
pm_cpu_sleep();
}
/* Qisda, ShiYong Lin, 2009/10/27, set P_mode as high {*/
s3c2410_gpio_cfgpin(S3C2410_GPD12, S3C2410_GPD12_OUTP);
s3c2410_gpio_setpin(S3C2410_GPD12, 1);
/* } Qisda, ShiYong Lin, 2009/10/27, Set P_mode as high */
/* restore the cpu state */
/************************ CPU is now sleeping ... *****************************/
/* restore the cpu state */
cpu_init();
@@ -1579,7 +994,7 @@ static int s3c2410_pm_enter(suspend_state_t state)
s3c2410_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
s3c2410_pm_do_restore(smc_save, ARRAY_SIZE(smc_save));
__raw_writel(0xD, S3C2443_PWRMODE);
__raw_writel(0x0, S3C2443_PWRMODE);
#endif

File diff suppressed because it is too large Load Diff