From e8899ba1e130caf644a34ca6f1004c917b277850 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 11 Mar 2009 07:32:14 +0000 Subject: [PATCH] qi-3d7k-suspend-gpio-tune.patch Signed-off-by: Andy Green --- qiboot/src/cpu/s3c6410/om_3d7k.c | 703 ++++++++++++++----------------- 1 file changed, 315 insertions(+), 388 deletions(-) diff --git a/qiboot/src/cpu/s3c6410/om_3d7k.c b/qiboot/src/cpu/s3c6410/om_3d7k.c index fc97705..f6babed 100644 --- a/qiboot/src/cpu/s3c6410/om_3d7k.c +++ b/qiboot/src/cpu/s3c6410/om_3d7k.c @@ -22,16 +22,18 @@ const struct pcf50633_init om_3d7k_pcf50633_init[] = { { PCF50633_REG_DOWN1OUT, 0x17 }, /* 1.2V (0x17 * .025V + 0.625V) */ - /* all of these are down in 3d7k suspend */ + /* all of these are down in 3d7k suspend except MEMLDO */ { PCF50633_REG_DOWN1ENA, 0x02 }, /* enabled if GPIO1 = HIGH */ - { PCF50633_REG_HCLDOENA, 0x02 }, /* Camera 2.8V power off */ - { PCF50633_REG_LDO1ENA, 0x02 }, /* Gsensor power off */ - { PCF50633_REG_LDO2ENA, 0x02 }, /* Camera 1.5V power off */ - { PCF50633_REG_LDO3ENA, 0x03 }, /* Codec power ON */ - { PCF50633_REG_LDO4ENA, 0x03 }, /* SD power ON */ - { PCF50633_REG_LDO5ENA, 0x02 }, /* BT power off */ - { PCF50633_REG_LDO6ENA, 0x02 }, /* LCM power off */ + { PCF50633_REG_DOWN2ENA, 0x02 }, /* enabled if GPIO1 = HIGH */ + { PCF50633_REG_HCLDOENA, 0x00 }, /* Camera 2.8V power off */ + { PCF50633_REG_MEMLDOENA, 0x01 }, /* Memory LDO always ON */ + { PCF50633_REG_LDO1ENA, 0x00 }, /* Gsensor power off */ + { PCF50633_REG_LDO2ENA, 0x00 }, /* Camera 1.5V power off */ + { PCF50633_REG_LDO3ENA, 0x02 }, /* Codec power ON */ + { PCF50633_REG_LDO4ENA, 0x02 }, /* SD power ON */ + { PCF50633_REG_LDO5ENA, 0x00 }, /* BT power off */ + { PCF50633_REG_LDO6ENA, 0x00 }, /* LCM power off */ { PCF50633_REG_INT1M, 0x00 }, { PCF50633_REG_INT2M, 0x00 }, @@ -92,6 +94,15 @@ static const struct board_variant board_variants[] = { } }; +#define S0 0 +#define S1 1 +#define SIN 2 +#define SHOLD 3 + +#define SNP 0 +#define SPD 1 +#define SPU 2 + void port_init_om_3d7k(void) { int n; @@ -216,24 +227,24 @@ void port_init_om_3d7k(void) __REG(GPADAT) = 0; /* just for determinism */ __REG(GPACONSLP) = - (2 << 0) | /* GPA0 - input */ - (2 << 2) | /* GPA1 - input */ - (2 << 4) | /* GPA2 - input */ - (2 << 6) | /* GPA3 - input */ - (2 << 8) | /* GPA4 - input */ - (2 << 10) | /* GPA5 - input */ - (2 << 12) | /* GPA6 - input */ - (2 << 14) /* GPA7 - input */ + (SIN << 0) | /* GPA0 bluetooth down in suspend*/ + (S0 << 2) | /* GPA1 */ + (SIN << 4) | /* GPA2 */ + (S0 << 6) | /* GPA3 */ + (SIN << 8) | /* GPA4 gsm */ + (SHOLD << 10) | /* GPA5 */ + (SIN << 12) | /* GPA6 */ + (SHOLD << 14) /* GPA7 */ ; __REG(GPAPUDSLP) = - (1 << 0) | /* GPA0 - pulldown */ - (1 << 2) | /* GPA1 - pulldown */ - (1 << 4) | /* GPA2 - pulldown */ - (1 << 6) | /* GPA3 - pulldown */ - (1 << 8) | /* GPA4 - pulldown */ - (1 << 10) | /* GPA5 - pulldown */ - (1 << 12) | /* GPA6 - pulldown */ - (1 << 14) /* GPA7 - pulldown */ + (SPD << 0) | /* GPA0 */ + (SNP << 2) | /* GPA1 */ + (SPD << 4) | /* GPA2 */ + (SNP << 6) | /* GPA3 */ + (SPU << 8) | /* GPA4 */ + (SNP << 10) | /* GPA5 */ + (SPU << 12) | /* GPA6 */ + (SNP << 14) /* GPA7 */ ; /* ---------------------------- Port B ---------------------------- */ @@ -249,71 +260,69 @@ void port_init_om_3d7k(void) ; __REG(GPBPUD) = /* all pullup and pulldown disabled */ - 0 + (SPU << (2 * 2)) /* pullup console rx */ ; __REG(GPBDAT) = 0; /* just for determinism */ __REG(GPBCONSLP) = - (2 << 0) | /* GPB0 - input */ - (2 << 2) | /* GPB1 - input */ - (2 << 4) | /* GPB2 - input */ - (2 << 6) | /* GPB3 - input */ - (2 << 8) | /* GPB4 - input */ - (2 << 10) | /* GPB5 - input */ - (2 << 12) | /* GPB6 - input */ - (2 << 14) /* GPB7 - input */ + (SHOLD << 0) | /* GPB0 */ + (SHOLD << 2) | /* GPB1 */ + (SIN << 4) | /* GPB2 */ + (SHOLD << 6) | /* GPB3 */ + (SHOLD << 8) | /* GPB4 */ + (SIN << 10) | /* GPB5 ext pullup */ + (SIN << 12) /* GPB6 ext pullup */ ; __REG(GPBPUDSLP) = - (1 << 0) | /* GPB0 - pull down */ - (1 << 2) | /* GPB1 - pull down */ - (1 << 4) | /* GPB2 - pull down */ - (1 << 6) | /* GPB3 - pull down */ - (1 << 8) | /* GPB4 - pull down */ - (1 << 10) | /* GPB5 - pull down */ - (1 << 12) | /* GPB6 - pull down */ - (1 << 14) /* GPB7 - pull down */ + (SNP << 0) | /* GPB0 */ + (SNP << 2) | /* GPB1 */ + (SPU << 4) | /* GPB2 */ + (SNP << 6) | /* GPB3 */ + (SNP << 8) | /* GPB4 */ + (SNP << 10) | /* GPB5 */ + (SNP << 12) /* GPB6 */ ; /* ---------------------------- Port C ---------------------------- */ __REG(GPCCON) = - (0 << 0) | /* GPC0 - SPI_MISO0 INPUT */ + (0 << 0) | /* GPC0 - SPI_MISO0 INPUT motion sensor spi */ (1 << 4) | /* GPC1 - SPI_CLK0 OUTPUT */ (1 << 8) | /* GPC2 - SPI_MOSI0 OUTPUT */ (1 << 12) | /* GPC3 - SPI_CS0 OUTPUT */ - (1 << 16) | /* GPC4 - (NC) OUTPUT */ + (1 << 16) | /* GPC4 - (NC) OUTPUT lcm spi*/ (1 << 20) | /* GPC5 - SPI_CLK1 OUTPUT */ (1 << 24) | /* GPC6 - SPI_MOSI1 OUTPUT */ (1 << 28) /* GPC7 - SPI_CS1 OUTPUT */ ; - __REG(GPCPUD) = /* all pullup and pulldown disabled */ - (1 << 0) + __REG(GPCPUD) = + (SPD << 0) ; __REG(GPCDAT) = 0; /* just for determinism */ - __REG(GPCCONSLP) = - (2 << 0) | /* GPC0 - input */ - (2 << 2) | /* GPC1 - input */ - (2 << 4) | /* GPC2 - input */ - (2 << 6) | /* GPC3 - input */ - (2 << 8) | /* GPC4 - input */ - (2 << 10) | /* GPC5 - input */ - (2 << 12) | /* GPC6 - input */ - (2 << 14) /* GPC7 - input */ + __REG(GPCCONSLP) = /* both peripherals down in suspend */ + (SIN << 0) | /* GPC0 */ + (S0 << 2) | /* GPC1 */ + (S0 << 4) | /* GPC2 */ + (S0 << 6) | /* GPC3 */ + (SIN << 8) | /* GPC4 */ + (S0 << 10) | /* GPC5 */ + (S0 << 12) | /* GPC6 */ + (S0 << 14) /* GPC7 */ ; __REG(GPCPUDSLP) = - (1 << 0) | /* GPC0 - pull down */ - (1 << 2) | /* GPC1 - pull down */ - (1 << 4) | /* GPC2 - pull down */ - (1 << 6) | /* GPC3 - pull down */ - (1 << 8) | /* GPC4 - pull down */ - (1 << 10) | /* GPC5 - pull down */ - (1 << 12) | /* GPC6 - pull down */ - (1 << 14) /* GPC7 - pull down */ + (SPD << 0) | /* GPC0 */ + (SNP << 2) | /* GPC1 */ + (SNP << 4) | /* GPC2 */ + (SNP << 6) | /* GPC3 */ + (SPD << 8) | /* GPC4 */ + (SNP << 10) | /* GPC5 */ + (SNP << 12) | /* GPC6 */ + (SNP << 14) /* GPC7 */ ; /* ---------------------------- Port D ---------------------------- */ @@ -331,19 +340,19 @@ void port_init_om_3d7k(void) __REG(GPDDAT) = 0; /* just for determinism */ __REG(GPDCONSLP) = - (2 << 0) | /* GPD0 - input */ - (2 << 2) | /* GPD1 - input */ - (2 << 4) | /* GPD2 - input */ - (2 << 6) | /* GPD3 - input */ - (2 << 8) /* GPD4 - input */ + (S0 << 0) | /* GPD0 */ + (S0 << 2) | /* GPD1 */ + (S0 << 4) | /* GPD2 */ + (S0 << 6) | /* GPD3 */ + (S0 << 8) /* GPD4 */ ; __REG(GPDPUDSLP) = - (1 << 0) | /* GPD0 - pull down */ - (1 << 2) | /* GPD1 - pull down */ - (1 << 4) | /* GPD2 - pull down */ - (1 << 6) | /* GPD3 - pull down */ - (1 << 8) /* GPD4 - pull down */ + (SNP << 0) | /* GPD0 */ + (SNP << 2) | /* GPD1 */ + (SNP << 4) | /* GPD2 */ + (SNP << 6) | /* GPD3 */ + (SNP << 8) /* GPD4 */ ; /* ---------------------------- Port E ---------------------------- */ @@ -361,19 +370,19 @@ void port_init_om_3d7k(void) __REG(GPEDAT) = 0; /* just for determinism */ __REG(GPECONSLP) = - (2 << 0) | /* GPE0 - input */ - (2 << 2) | /* GPE1 - input */ - (2 << 4) | /* GPE2 - input */ - (2 << 6) | /* GPE3 - input */ - (2 << 8) /* GPE4 - input */ + (S0 << 0) | /* GPE0 */ + (S0 << 2) | /* GPE1 */ + (S0 << 4) | /* GPE2 */ + (S0 << 6) | /* GPE3 */ + (S0 << 8) /* GPE4 */ ; __REG(GPEPUDSLP) = - (1 << 0) | /* GPE0 - pull down */ - (1 << 2) | /* GPE1 - pull down */ - (1 << 4) | /* GPE2 - pull down */ - (1 << 6) | /* GPE3 - pull down */ - (1 << 8) /* GPE4 - pull down */ + (SNP << 0) | /* GPE0 */ + (SNP << 2) | /* GPE1 */ + (SNP << 4) | /* GPE2 */ + (SNP << 6) | /* GPE3 */ + (SNP << 8) /* GPE4 */ ; /* ---------------------------- Port F ---------------------------- */ @@ -397,37 +406,38 @@ void port_init_om_3d7k(void) (1 << 30) /* GPF15 - OUTPUT CAM_PWRDN */ ; - __REG(GPFPUD) = (1 << (2 * 12)) | (1 << (2 * 11)) | (1 << (2 * 10)) | - (1 << (2 * 9)) | (1 << (2 * 8)) | (1 << (2 * 7)) | - (1 << (2 * 6)) | (1 << (2 * 5)); /* all cam data pulldown */ + __REG(GPFPUD) = + (SPD << (2 * 12)) | + (SPD << (2 * 11)) | + (SPD << (2 * 10)) | + (SPD << (2 * 9)) | + (SPD << (2 * 8)) | + (SPD << (2 * 7)) | + (SPD << (2 * 6)) | + (SPD << (2 * 5)); /* all cam data pulldown */ __REG(GPFDAT) = (1 << 15); /* assert CAM_PWRDN */ __REG(GPFCONSLP) = - (2 << 0) | /* GPF0 - input */ - (2 << 2) | /* GPF1 - input */ - (2 << 4) | /* GPF2 - input */ - (2 << 6) | /* GPF3 - input */ - (2 << 8) | /* GPF4 - input */ - (2 << 10) | /* GPF5 - input */ - (2 << 12) | /* GPF6 - input */ - (2 << 14) | /* GPF7 - input */ - (2 << 16) | /* GPF8 - input */ - (2 << 18) | /* GPF9 - input */ - (2 << 20) | /* GPF10 - input */ - (2 << 22) | /* GPF11 - input */ - (2 << 24) | /* GPF12 - input */ - (2 << 26) | /* GPF13 - input */ - (2 << 28) | /* GPF14 - input */ - (2 << 30) /* GPF15 - input */ + (S0 << 0) | /* GPF0 */ + (S0 << 2) | /* GPF1 */ + (S0 << 4) | /* GPF2 */ + (S0 << 6) | /* GPF3 */ + (S0 << 8) | /* GPF4 */ + (SIN << 10) | /* GPF5 */ + (SIN << 12) | /* GPF6 */ + (SIN << 14) | /* GPF7 */ + (SIN << 16) | /* GPF8 */ + (SIN << 18) | /* GPF9 */ + (SIN << 20) | /* GPF10 */ + (SIN << 22) | /* GPF11 */ + (SIN << 24) | /* GPF12 */ + (S0 << 26) | /* GPF13 */ + (S0 << 28) | /* GPF14 */ + (S0 << 30) /* GPF15 */ ; __REG(GPFPUDSLP) = - (1 << 0) | /* GPF0 - pull down */ - (1 << 2) | /* GPF1 - pull down */ - (1 << 4) | /* GPF2 - pull down */ - (1 << 6) | /* GPF3 - pull down */ - (1 << 8) | /* GPF4 - pull down */ (1 << 10) | /* GPF5 - pull down */ (1 << 12) | /* GPF6 - pull down */ (1 << 14) | /* GPF7 - pull down */ @@ -435,10 +445,7 @@ void port_init_om_3d7k(void) (1 << 18) | /* GPF9 - pull down */ (1 << 20) | /* GPF10 - pull down */ (1 << 22) | /* GPF11 - pull down */ - (1 << 24) | /* GPF12 - pull down */ - (1 << 26) | /* GPF13 - pull down */ - (1 << 28) | /* GPF14 - pull down */ - (1 << 30) /* GPF15 - pull down */ + (1 << 24) /* GPF12 - pull down */ ; /* ---------------------------- Port G ---------------------------- */ @@ -458,71 +465,52 @@ void port_init_om_3d7k(void) __REG(GPGDAT) = 0; /* just for determinism */ __REG(GPGCONSLP) = - (2 << 0) | /* GPG0 - input */ - (2 << 2) | /* GPG1 - input */ - (2 << 4) | /* GPG2 - input */ - (2 << 6) | /* GPG3 - input */ - (2 << 8) | /* GPG4 - input */ - (2 << 10) | /* GPG5 - input */ - (2 << 12) /* GPG6 - input */ + (S0 << 0) | /* GPG0 - it's not powered*/ + (S0 << 2) | /* GPG1 */ + (S0 << 4) | /* GPG2 */ + (S0 << 6) | /* GPG3 */ + (S0 << 8) | /* GPG4 */ + (S0 << 10) | /* GPG5 */ + (S0 << 12) /* GPG6 */ ; - __REG(GPGPUDSLP) = - (1 << 0) | /* GPG0 - pull down */ - (1 << 2) | /* GPG1 - pull down */ - (1 << 4) | /* GPG2 - pull down */ - (1 << 6) | /* GPG3 - pull down */ - (1 << 8) | /* GPG4 - pull down */ - (1 << 10) | /* GPG5 - pull down */ - (1 << 12) /* GPG6 - pull down */ - ; + __REG(GPGPUDSLP) = 0; /* ---------------------------- Port H ---------------------------- */ __REG(GPHCON0) = - (0 << 0) | /* GPH0 - NC OUT 0 */ - (0 << 4) | /* GPH1 - NC OUT 0 */ - (0 << 8) | /* GPH2 - NC OUT 0 */ - (0 << 12) | /* GPH3 - NC OUT 0 */ - (0 << 16) | /* GPH4 - NC OUT 0 */ - (0 << 20) | /* GPH5 - NC OUT 0 */ - (1 << 24) | /* GPH6 - OUTPUT nWLAN_RESET */ - (1 << 28) /* GPH7 - OUTPUT HDQ */ + (1 << 0) | /* GPH0 - NC OUT 0 */ + (1 << 4) | /* GPH1 - NC OUT 0 */ + (1 << 8) | /* GPH2 - NC OUT 0 */ + (1 << 12) | /* GPH3 - NC OUT 0 */ + (1 << 16) | /* GPH4 - NC OUT 0 */ + (1 << 20) | /* GPH5 - NC OUT 0 */ + (1 << 24) | /* GPH6 - OUTPUT nBT_RESET */ + (0 << 28) /* GPH7 - INPUT HDQ */ ; __REG(GPHCON1) = - (1 << 0) | /* GPH8 - OUTPUT nWLAN_PD */ - (0 << 4) /* GPH9 - OUTPUT (NC) */ + (1 << 0) | /* GPH8 - OUTPUT BT PIO5 */ + (0 << 4) /* GPH9 - INPUT LED INT */ ; - __REG(GPHPUD) = 0x40555; /* all NC pulldown */ + __REG(GPHPUD) = (SPU << (9 * 2)) | (SPU << (7 * 2)); __REG(GPHDAT) = 0; __REG(GPHCONSLP) = - (2 << 0) | /* GPH0 - input */ - (2 << 2) | /* GPH1 - input */ - (2 << 4) | /* GPH2 - input */ - (2 << 6) | /* GPH3 - input */ - (2 << 8) | /* GPH4 - input */ - (2 << 10) | /* GPH5 - input */ - (2 << 12) | /* GPH6 - input */ - (2 << 14) | /* GPH7 - INPUT (HDQ) */ - (2 << 16) | /* GPH8 - input */ - (2 << 18) /* GPH9 - input */ + (S0 << 0) | /* GPH0 */ + (S0 << 2) | /* GPH1 */ + (S0 << 4) | /* GPH2 */ + (S0 << 6) | /* GPH3 */ + (S0 << 8) | /* GPH4 */ + (S0 << 10) | /* GPH5 */ + (S0 << 12) | /* GPH6 */ + (SHOLD << 14) | /* GPH7 - INPUT (HDQ) */ + (S0 << 16) | /* GPH8 */ + (SIN << 18) /* GPH9 */ ; - __REG(GPHPUDSLP) = - (1 << 0) | /* GPH0 - pull down */ - (1 << 2) | /* GPH1 - pull down */ - (1 << 4) | /* GPH2 - pull down */ - (1 << 6) | /* GPH3 - pull down */ - (1 << 8) | /* GPH4 - pull down */ - (1 << 10) | /* GPH5 - pull down */ - (2 << 12) | /* GPH6 - PULLUP (HDQ) */ - (1 << 14) | /* GPH7 - pull down */ - (1 << 16) | /* GPH8 - pull down */ - (1 << 18) /* GPH9 - pull down */ - ; + __REG(GPHPUDSLP) = (SPU << (9 * 2)); /* ---------------------------- Port I ---------------------------- */ @@ -550,41 +538,28 @@ void port_init_om_3d7k(void) __REG(GPIDAT) = 0; /* just for determinism */ __REG(GPICONSLP) = - (2 << 0) | /* GPI0 - input */ - (2 << 2) | /* GPI1 - input */ - (2 << 4) | /* GPI2 - input */ - (2 << 6) | /* GPI3 - input */ - (2 << 8) | /* GPI4 - input */ - (2 << 10) | /* GPI5 - input */ - (2 << 12) | /* GPI6 - input */ - (2 << 14) | /* GPI7 - input */ - (2 << 16) | /* GPI8 - input */ - (2 << 18) | /* GPI9 - input */ - (2 << 20) | /* GPI10 - input */ - (2 << 22) | /* GPI11 - input */ - (2 << 24) | /* GPI12 - input */ - (2 << 26) | /* GPI13 - input */ - (2 << 28) | /* GPI14 - input */ - (2 << 30) /* GPI15 - input */ + (SIN << 0) | /* GPI0 - input */ + (SIN << 2) | /* GPI1 - input */ + (S0 << 4) | /* GPI2 - input */ + (S0 << 6) | /* GPI3 - input */ + (S0 << 8) | /* GPI4 - input */ + (S0 << 10) | /* GPI5 - input */ + (S0 << 12) | /* GPI6 - input */ + (S0 << 14) | /* GPI7 - input */ + (SIN << 16) | /* GPI8 - input */ + (S0 << 18) | /* GPI9 - input */ + (S0 << 20) | /* GPI10 - input */ + (S0 << 22) | /* GPI11 - input */ + (S0 << 24) | /* GPI12 - input */ + (S0 << 26) | /* GPI13 - input */ + (S0 << 28) | /* GPI14 - input */ + (S0 << 30) /* GPI15 - input */ ; __REG(GPIPUDSLP) = (1 << 0) | /* GPI0 - pull down */ (1 << 2) | /* GPI1 - pull down */ - (1 << 4) | /* GPI2 - pull down */ - (1 << 6) | /* GPI3 - pull down */ - (1 << 8) | /* GPI4 - pull down */ - (1 << 10) | /* GPI5 - pull down */ - (1 << 12) | /* GPI6 - pull down */ - (1 << 14) | /* GPI7 - pull down */ - (1 << 16) | /* GPI8 - pull down */ - (1 << 18) | /* GPI9 - pull down */ - (1 << 20) | /* GPI10 - pull down */ - (1 << 22) | /* GPI11 - pull down */ - (1 << 24) | /* GPI12 - pull down */ - (1 << 26) | /* GPI13 - pull down */ - (1 << 28) | /* GPI14 - pull down */ - (1 << 30) /* GPI15 - pull down */ + (1 << 16) /* GPI8 - pull down */ ; /* ---------------------------- Port J ---------------------------- */ @@ -609,77 +584,68 @@ void port_init_om_3d7k(void) __REG(GPJDAT) = 0; /* just for determinism */ __REG(GPJCONSLP) = - (2 << 0) | /* GPJ0 - input */ - (2 << 2) | /* GPJ1 - input */ - (2 << 4) | /* GPJ2 - input */ - (2 << 6) | /* GPJ3 - input */ - (2 << 8) | /* GPJ4 - input */ - (2 << 10) | /* GPJ5 - input */ - (2 << 12) | /* GPJ6 - input */ - (2 << 14) | /* GPJ7 - input */ - (2 << 16) | /* GPJ8 - input */ - (2 << 18) | /* GPJ9 - input */ - (2 << 20) | /* GPJ10 - input */ - (2 << 22) /* GPJ11 - input */ + (S0 << 0) | /* GPJ0 */ + (S0 << 2) | /* GPJ1 */ + (S0 << 4) | /* GPJ2 */ + (S0 << 6) | /* GPJ3 */ + (S0 << 8) | /* GPJ4 */ + (S0 << 10) | /* GPJ5 */ + (S0 << 12) | /* GPJ6 */ + (S0 << 14) | /* GPJ7 */ + (S0 << 16) | /* GPJ8 */ + (S0 << 18) | /* GPJ9 */ + (S0 << 20) | /* GPJ10 */ + (S0 << 22) /* GPJ11 */ ; __REG(GPJPUDSLP) = - (1 << 0) | /* GPJ0 - pull down */ - (1 << 2) | /* GPJ1 - pull down */ - (1 << 4) | /* GPJ2 - pull down */ - (1 << 6) | /* GPJ3 - pull down */ - (1 << 8) | /* GPJ4 - pull down */ - (1 << 10) | /* GPJ5 - pull down */ - (1 << 12) | /* GPJ6 - pull down */ - (1 << 14) | /* GPJ7 - pull down */ - (1 << 16) | /* GPJ8 - pull down */ - (1 << 18) | /* GPJ9 - pull down */ - (1 << 20) | /* GPJ10 - pull down */ - (1 << 22) /* GPJ11 - pull down */ + 0 ; /* ---------------------------- Port K ---------------------------- */ __REG(GPKCON0) = - (1 << 0) | /* GPK0 - OUTPUT nWLAN_POWERON */ - (0 << 4) | /* GPK1 - input (NC) */ + (1 << 0) | /* GPK0 - OUTPUT NC */ + (1 << 4) | /* GPK1 - OUTPUT NC */ (1 << 8) | /* GPK2 - OUTPUT (nMODEM_ON) */ - (0 << 12) | /* GPK3 - input (NC) */ - (0 << 16) | /* GPK4 - input (NC) */ - (0 << 20) | /* GPK5 - input (NC) */ - (1 << 24) | /* GPK6 - output */ - (0 << 28) /* GPK7 - input (NC) */ + + (1 << 12) | /* GPK3 - OUTPUT (LED_TRIG) */ + (1 << 16) | /* GPK4 - OUTPUT (LED_EN) */ + (0 << 20) | /* GPK5 - OUTPUT NC */ + (1 << 24) | /* GPK6 - OUTPUT (LCD_RESET) */ + (0 << 28) /* GPK7 - OUTPUT NC */ ; __REG(GPKCON1) = - (0 << 0) | /* GPK8 - input (NC) */ - (0 << 4) | /* GPK9 - input (NC) */ - (0 << 8) | /* GPK10 - input (NC) */ - (0 << 12) | /* GPK11 - input (NC) */ - (0 << 16) | /* GPK12 - input (NC) */ - (0 << 20) | /* GPK13 - input (NC) */ - (0 << 24) | /* GPK14 - input (NC) */ - (0 << 28) /* GPK15 - input (NC) */ + (1 << 0) | /* GPK8 - OUTPUT NC */ + (1 << 4) | /* GPK9 - OUTPUT NC */ + (1 << 8) | /* GPK10 - OUTPUT NC */ + (1 << 12) | /* GPK11 - OUTPUT NC */ + (1 << 16) | /* GPK12 - OUTPUT NC */ + (1 << 20) | /* GPK13 - OUTPUT NC */ + (1 << 24) | /* GPK14 - OUTPUT NC */ + (1 << 28) /* GPK15 - OUTPUT NC */ ; - __REG(GPKPUD) = 0x55555544; /* all input pulldown */ + __REG(GPKPUD) = 0; - __REG(GPKDAT) = - (1 << 2) | /* deassert nMODEM_ON */ - (1 << 0) | /* deassert nWLAN_POWERON */ - (1 << 6) /* deassert LCM_RESET */ + __REG(GPKDAT) = /* rest output 0 */ + (SHOLD << (2 * 2)) | /* nMODEM_ON */ + (SHOLD << (2 * 3)) | /* LED_TRIG */ + (SHOLD << (2 * 4)) | /* LED_EN */ + (S0 << (2 * 6)) /* LCD_RESET */ ; /* ---------------------------- Port L ---------------------------- */ __REG(GPLCON0) = - (0 << 0) | /* GPL0 - OUTPUT (NC) */ - (0 << 4) | /* GPL1 - OUTPUT (NC) */ - (0 << 8) | /* GPL2 - OUTPUT (NC) */ - (0 << 12) | /* GPL3 - OUTPUT (NC) */ - (0 << 16) | /* GPL4 - OUTPUT (NC) */ - (0 << 20) | /* GPL5 - OUTPUT (NC) */ - (0 << 24) | /* GPL6 - OUTPUT (NC) */ - (0 << 28) /* GPL7 - OUTPUT (NC) */ + (1 << 0) | /* GPL0 - OUTPUT (NC) */ + (1 << 4) | /* GPL1 - OUTPUT (NC) */ + (1 << 8) | /* GPL2 - OUTPUT (NC) */ + (1 << 12) | /* GPL3 - OUTPUT (NC) */ + (1 << 16) | /* GPL4 - OUTPUT (NC) */ + (1 << 20) | /* GPL5 - OUTPUT (NC) */ + (1 << 24) | /* GPL6 - OUTPUT (NC) */ + (1 << 28) /* GPL7 - OUTPUT (NC) */ ; __REG(GPLCON1) = (1 << 0) | /* GPL8 - OUTPUT (NC) */ @@ -691,7 +657,7 @@ void port_init_om_3d7k(void) (1 << 24) /* GPL14 - OUTPUT (NC) */ ; - __REG(GPLPUD) = 0x5555; /* all pullup and pulldown disabled */ + __REG(GPLPUD) = 0; /* all pullup and pulldown disabled */ __REG(GPLDAT) = 0; @@ -701,7 +667,7 @@ void port_init_om_3d7k(void) __REG(GPMCON) = (1 << 0) | /* GPM0 - OUTPUT (TP_RESET) */ (1 << 4) | /* GPM1 - OUTPUT (NC) */ - (1 << 8) | /* GPM2 - OUTPUT (GPS_LNA_EN) */ + (1 << 8) | /* GPM2 - OUTPUT (NC) */ (1 << 12) | /* GPM3 - OUTPUT (NC) */ (0 << 16) | /* GPM4 - INPUT (nUSB_FLT) */ (0 << 20) /* GPM5 - INPUT (nUSB_OC) */ @@ -721,7 +687,7 @@ void port_init_om_3d7k(void) (2 << 8) | /* GPN4 - EXINT4 PWR_IRQ */ (2 << 10) | /* GPN5 - EXINT5 nTOUCH */ (2 << 12) | /* GPN6 - EXINT6 nJACK_INSERT */ - (2 << 14) | /* GPN7 - EXINT7 GPS_INT */ + (1 << 14) | /* GPN7 - EXINT7 NC OUTPUT */ (2 << 16) | /* GPN8 - EXINT8 nHOLD */ (2 << 18) | /* GPN9 - EXINT9 WLAN_WAKEUP */ (2 << 20) | /* GPN10 - EXINT10 nG1INT2 */ @@ -732,7 +698,24 @@ void port_init_om_3d7k(void) (0 << 30) /* GPN15 - INPUT (iROM CFG2) */ ; - __REG(GPNPUD) = 0; /* all pullup and pulldown disabled */ + __REG(GPNPUD) = + (SPD << 0) | /* GPN0 - EXINT0 nG1INT1 */ + (SPU << 2) | /* GPN1 - EXINT1 KEY_MINUS */ + (SPU << 4) | /* GPN2 - EXINT2 KEY_PLUS */ + (SPU << 6) | /* GPN3 - EXINT3 PWR_IND */ + (SNP << 8) | /* GPN4 - EXINT4 PWR_IRQ */ + (SPU << 10) | /* GPN5 - EXINT5 nTOUCH */ + (SNP << 12) | /* GPN6 - EXINT6 nJACK_INSERT */ + (SNP << 14) | /* GPN7 - EXINT7 NC OP */ + (SPU << 16) | /* GPN8 - EXINT8 nHOLD */ + (SPU << 18) | /* GPN9 - EXINT9 BT_WAKEUP */ + (SPD << 20) | /* GPN10 - EXINT10 nG1INT2 */ + (SPD << 22) | /* GPN11 - EXINT11 nIO1 */ + (SPU << 24) | /* GPN12 - EXINT12 nONKEYWAKE */ + (SPD << 26) | /* GPN13 - INPUT (iROM CFG0) */ + (SPD << 28) | /* GPN14 - INPUT (iROM CFG1) */ + (SPD << 30) /* GPN15 - INPUT (iROM CFG2) */ + ; __REG(GPNDAT) = 0; @@ -742,182 +725,126 @@ void port_init_om_3d7k(void) __REG(GPOCON) = (2 << 0) | /* GPO0 - XM0CS2 (nNANDCS0) */ (1 << 2) | /* GPO1 - OUTPUT (nMODEM_RESET) */ - (0 << 4) | /* GPO2 - input (NC) */ - (0 << 6) | /* GPO3 - input (NC) */ - (0 << 8) | /* GPO4 - input (NC) */ - (0 << 10) | /* GPO5 - input (NC) */ - (0 << 12) | /* GPO6 - input (NC) */ - (0 << 14) | /* GPO7 - input (NC) */ - (0 << 16) | /* GPO8 - input (NC) */ - (0 << 18) | /* GPO9 - input (NC) */ - (0 << 20) | /* GPO10 - input (NC) */ - (0 << 22) | /* GPO11 - input (NC) */ - (0 << 24) | /* GPO12 - input (NC) */ - (0 << 26) | /* GPO13 - input (NC) */ - (0 << 28) | /* GPO14 - input (NC) */ - (0 << 30) /* GPO15 - input (NC) */ + (1 << 4) | /* GPO2 - input (NC) */ + (1 << 6) | /* GPO3 - input (NC) */ + (1 << 8) | /* GPO4 - input (NC) */ + (1 << 10) | /* GPO5 - input (NC) */ + (1 << 12) | /* GPO6 - input (NC) */ + (1 << 14) | /* GPO7 - input (NC) */ + (1 << 16) | /* GPO8 - input (NC) */ + (1 << 18) | /* GPO9 - input (NC) */ + (1 << 20) | /* GPO10 - input (NC) */ + (1 << 22) | /* GPO11 - input (NC) */ + (1 << 24) | /* GPO12 - input (NC) */ + (1 << 26) | /* GPO13 - input (NC) */ + (1 << 28) | /* GPO14 - input (NC) */ + (1 << 30) /* GPO15 - input (NC) */ ; - __REG(GPOPUD) = 0x55555550; /* all NC pulldown */ + __REG(GPOPUD) = 0; /* no pulling */ __REG(GPODAT) = (1 << 15); /* assert CAM_PWRDN */ __REG(GPOCONSLP) = - (3 << 0) | /* GPO0 - hold state */ - (1 << 2) | /* GPO1 - OUTPUT 1 (do not reset modem) */ - (0 << 4) | /* GPO2 - OUTPUT 0 */ - (0 << 6) | /* GPO3 - OUTPUT 0 */ - (0 << 8) | /* GPO4 - OUTPUT 0 */ - (0 << 10) | /* GPO5 - OUTPUT 0 */ - (0 << 12) | /* GPO6 - OUTPUT 0 */ - (0 << 14) | /* GPO7 - OUTPUT 0 */ - (0 << 16) | /* GPO8 - OUTPUT 0 */ - (0 << 18) | /* GPO9 - OUTPUT 0 */ - (0 << 20) | /* GPO10 - OUTPUT 0 */ - (0 << 22) | /* GPO11 - OUTPUT 0 */ - (0 << 24) | /* GPO12 - OUTPUT 0 */ - (0 << 26) | /* GPO13 - OUTPUT 0 */ - (0 << 28) | /* GPO14 - OUTPUT 0 */ - (0 << 30) /* GPO15 - OUTPUT 0 */ + (SHOLD << 0) | /* GPO0 - hold state */ + (SHOLD << 2) | /* GPO1 - OUTPUT 1 (do not reset modem) */ + (S0 << 4) | /* GPO2 - OUTPUT 0 */ + (S0 << 6) | /* GPO3 - OUTPUT 0 */ + (S0 << 8) | /* GPO4 - OUTPUT 0 */ + (S0 << 10) | /* GPO5 - OUTPUT 0 */ + (S0 << 12) | /* GPO6 - OUTPUT 0 */ + (S0 << 14) | /* GPO7 - OUTPUT 0 */ + (S0 << 16) | /* GPO8 - OUTPUT 0 */ + (S0 << 18) | /* GPO9 - OUTPUT 0 */ + (S0 << 20) | /* GPO10 - OUTPUT 0 */ + (S0 << 22) | /* GPO11 - OUTPUT 0 */ + (S0 << 24) | /* GPO12 - OUTPUT 0 */ + (S0 << 26) | /* GPO13 - OUTPUT 0 */ + (S0 << 28) | /* GPO14 - OUTPUT 0 */ + (S0 << 30) /* GPO15 - OUTPUT 0 */ ; __REG(GPOPUDSLP) = - (0 << 0) | /* GPO0 - no pull up or down */ - (0 << 2) | /* GPO1 - no pull up or down */ - (0 << 4) | /* GPO2 - no pull up or down */ - (0 << 6) | /* GPO3 - no pull up or down */ - (0 << 8) | /* GPO4 - no pull up or down */ - (0 << 10) | /* GPO5 - no pull up or down */ - (0 << 12) | /* GPO6 - no pull up or down */ - (0 << 14) | /* GPO7 - no pull up or down */ - (0 << 16) | /* GPO8 - no pull up or down */ - (0 << 18) | /* GPO9 - no pull up or down */ - (0 << 20) | /* GPO10 - no pull up or down */ - (0 << 22) | /* GPO11 - no pull up or down */ - (0 << 24) | /* GPO12 - no pull up or down */ - (0 << 26) | /* GPO13 - no pull up or down */ - (0 << 28) | /* GPO14 - no pull up or down */ - (0 << 30) /* GPO15 - no pull up or down */ + 0 ; /* ---------------------------- Port P ---------------------------- */ __REG(GPPCON) = - (0 << 0) | /* GPP0 - input (NC) */ - (0 << 2) | /* GPP1 - input (NC) */ - (0 << 4) | /* GPP2 - input (NC) */ - (0 << 6) | /* GPP3 - input (NC) */ - (0 << 8) | /* GPP4 - input (NC) */ - (0 << 10) | /* GPP5 - input (NC) */ - (0 << 12) | /* GPP6 - input (NC) */ - (0 << 14) | /* GPP7 - input (NC) */ - (0 << 16) | /* GPP8 - input (NC) */ - (0 << 18) | /* GPP9 - input (NC) */ - (0 << 20) | /* GPP10 - input (NC) */ - (0 << 22) | /* GPP11 - input (NC) */ - (0 << 24) | /* GPP12 - input (NC) */ - (0 << 26) | /* GPP13 - input (NC) */ - (0 << 28) | /* GPP14 - input (NC) */ - (0 << 30) /* GPP15 - input (NC) */ + (1 << 0) | /* GPP0 - input (NC) */ + (1 << 2) | /* GPP1 - input (NC) */ + (1 << 4) | /* GPP2 - input (NC) */ + (1 << 6) | /* GPP3 - input (NC) */ + (1 << 8) | /* GPP4 - input (NC) */ + (1 << 10) | /* GPP5 - input (NC) */ + (1 << 12) | /* GPP6 - input (NC) */ + (1 << 14) | /* GPP7 - input (NC) */ + (1 << 16) | /* GPP8 - input (NC) */ + (1 << 18) | /* GPP9 - input (NC) */ + (1 << 20) | /* GPP10 - input (NC) */ + (1 << 22) | /* GPP11 - input (NC) */ + (1 << 24) | /* GPP12 - input (NC) */ + (1 << 26) | /* GPP13 - input (NC) */ + (1 << 28) | /* GPP14 - input (NC) */ + (1 << 30) /* GPP15 - input (NC) */ ; - __REG(GPPPUD) = 0x15555555; /* all pulldown */ + __REG(GPPPUD) = 0; /* no pull */ - __REG(GPPDAT) = 0; /* assert CAM_PWRDN */ + __REG(GPPDAT) = 0; __REG(GPPCONSLP) = - (0 << 0) | /* GPP0 - OUTPUT 0 */ - (0 << 2) | /* GPP1 - OUTPUT 0 */ - (0 << 4) | /* GPP2 - OUTPUT 0 */ - (0 << 6) | /* GPP3 - OUTPUT 0 */ - (0 << 8) | /* GPP4 - OUTPUT 0 */ - (0 << 10) | /* GPP5 - OUTPUT 0 */ - (0 << 12) | /* GPP6 - OUTPUT 0 */ - (0 << 14) | /* GPP7 - OUTPUT 0 */ - (0 << 16) | /* GPP8 - OUTPUT 0 */ - (0 << 18) | /* GPP9 - OUTPUT 0 */ - (0 << 20) | /* GPP10 - OUTPUT 0 */ - (0 << 22) | /* GPP11 - OUTPUT 0 */ - (0 << 24) | /* GPP12 - OUTPUT 0 */ - (0 << 26) | /* GPP13 - OUTPUT 0 */ - (0 << 28) | /* GPP14 - OUTPUT 0 */ - (0 << 30) /* GPP15 - OUTPUT 0 */ + (S0 << 0) | /* GPP0 - OUTPUT 0 */ + (S0 << 2) | /* GPP1 - OUTPUT 0 */ + (S0 << 4) | /* GPP2 - OUTPUT 0 */ + (S0 << 6) | /* GPP3 - OUTPUT 0 */ + (S0 << 8) | /* GPP4 - OUTPUT 0 */ + (S0 << 10) | /* GPP5 - OUTPUT 0 */ + (S0 << 12) | /* GPP6 - OUTPUT 0 */ + (S0 << 14) | /* GPP7 - OUTPUT 0 */ + (S0 << 16) | /* GPP8 - OUTPUT 0 */ + (S0 << 18) | /* GPP9 - OUTPUT 0 */ + (S0 << 20) | /* GPP10 - OUTPUT 0 */ + (S0 << 22) | /* GPP11 - OUTPUT 0 */ + (S0 << 24) | /* GPP12 - OUTPUT 0 */ + (S0 << 26) | /* GPP13 - OUTPUT 0 */ + (S0 << 28) | /* GPP14 - OUTPUT 0 */ + (S0 << 30) /* GPP15 - OUTPUT 0 */ ; - __REG(GPPPUDSLP) = - (0 << 0) | /* GPP0 - no pull up or down */ - (0 << 2) | /* GPP1 - no pull up or down */ - (0 << 4) | /* GPP2 - no pull up or down */ - (0 << 6) | /* GPP3 - no pull up or down */ - (0 << 8) | /* GPP4 - no pull up or down */ - (0 << 10) | /* GPP5 - no pull up or down */ - (0 << 12) | /* GPP6 - no pull up or down */ - (0 << 14) | /* GPP7 - no pull up or down */ - (0 << 16) | /* GPP8 - no pull up or down */ - (0 << 18) | /* GPP9 - no pull up or down */ - (0 << 20) | /* GPP10 - no pull up or down */ - (0 << 22) | /* GPP11 - no pull up or down */ - (0 << 24) | /* GPP12 - no pull up or down */ - (0 << 26) | /* GPP13 - no pull up or down */ - (0 << 28) | /* GPP14 - no pull up or down */ - (0 << 30) /* GPP15 - no pull up or down */ - ; + __REG(GPPPUDSLP) = 0; /* ---------------------------- Port Q ---------------------------- */ __REG(GPQCON) = - (0 << 0) | /* GPQ0 - input (NC) */ - (0 << 2) | /* GPQ1 - input (NC) */ - (0 << 4) | /* GPQ2 - input (NC) */ - (0 << 6) | /* GPQ3 - input (NC) */ - (0 << 8) | /* GPQ4 - input (NC) */ - (0 << 10) | /* GPQ5 - input (NC) */ - (0 << 12) | /* GPQ6 - input (NC) */ - (0 << 14) | /* GPQ7 - input (NC) */ - (0 << 16) /* GPQ8 - input (NC) */ + (1 << 0) | /* GPQ0 - input (NC) */ + (1 << 2) | /* GPQ1 - input (NC) */ + (1 << 4) | /* GPQ2 - input (NC) */ + (1 << 6) | /* GPQ3 - input (NC) */ + (1 << 8) | /* GPQ4 - input (NC) */ + (1 << 10) | /* GPQ5 - input (NC) */ + (1 << 12) | /* GPQ6 - input (NC) */ + (1 << 14) | /* GPQ7 - input (NC) */ + (1 << 16) /* GPQ8 - input (NC) */ ; - __REG(GPQPUD) = 0x15555; /* all pulldown */ + __REG(GPQPUD) = 0; /* all pulldown */ __REG(GPQDAT) = 0; /* assert CAM_PWRDN */ __REG(GPQCONSLP) = - (0 << 0) | /* GPQ0 - OUTPUT 0 */ - (0 << 2) | /* GPQ1 - OUTPUT 0 */ - (0 << 4) | /* GPQ2 - OUTPUT 0 */ - (0 << 6) | /* GPQ3 - OUTPUT 0 */ - (0 << 8) | /* GPQ4 - OUTPUT 0 */ - (0 << 10) | /* GPQ5 - OUTPUT 0 */ - (0 << 12) | /* GPQ6 - OUTPUT 0 */ - (0 << 14) | /* GPQ7 - OUTPUT 0 */ - (0 << 16) | /* GPQ8 - OUTPUT 0 */ - (0 << 18) | /* GPQ9 - OUTPUT 0 */ - (0 << 20) | /* GPQ10 - OUTPUT 0 */ - (0 << 22) | /* GPQ11 - OUTPUT 0 */ - (0 << 24) | /* GPQ12 - OUTPUT 0 */ - (0 << 26) | /* GPQ13 - OUTPUT 0 */ - (0 << 28) | /* GPQ14 - OUTPUT 0 */ - (0 << 30) /* GPQ15 - OUTPUT 0 */ + (S0 << 0) | /* GPQ0 - OUTPUT 0 */ + (S0 << 2) | /* GPQ1 - OUTPUT 0 */ + (S0 << 4) | /* GPQ2 - OUTPUT 0 */ + (S0 << 6) | /* GPQ3 - OUTPUT 0 */ + (S0 << 8) | /* GPQ4 - OUTPUT 0 */ + (S0 << 10) | /* GPQ5 - OUTPUT 0 */ + (S0 << 12) | /* GPQ6 - OUTPUT 0 */ + (S0 << 14) | /* GPQ7 - OUTPUT 0 */ + (S0 << 16) /* GPQ8 - OUTPUT 0 */ ; - __REG(GPQPUDSLP) = - (0 << 0) | /* GPQ0 - no pull up or down */ - (0 << 2) | /* GPQ1 - no pull up or down */ - (0 << 4) | /* GPQ2 - no pull up or down */ - (0 << 6) | /* GPQ3 - no pull up or down */ - (0 << 8) | /* GPQ4 - no pull up or down */ - (0 << 10) | /* GPQ5 - no pull up or down */ - (0 << 12) | /* GPQ6 - no pull up or down */ - (0 << 14) | /* GPQ7 - no pull up or down */ - (0 << 16) | /* GPQ8 - no pull up or down */ - (0 << 18) | /* GPQ9 - no pull up or down */ - (0 << 20) | /* GPQ10 - no pull up or down */ - (0 << 22) | /* GPQ11 - no pull up or down */ - (0 << 24) | /* GPQ12 - no pull up or down */ - (0 << 26) | /* GPQ13 - no pull up or down */ - (0 << 28) | /* GPQ14 - no pull up or down */ - (0 << 30) /* GPQ15 - no pull up or down */ - ; + __REG(GPQPUDSLP) = 0; /* LCD Controller enable */