This patch adds support for the GTA01Bv2 variant of the FIC GTA01 (Neo1973) phone Index: git/Makefile =================================================================== --- git.orig/Makefile 2007-01-04 12:22:12.000000000 +0100 +++ git/Makefile 2007-01-04 12:22:16.000000000 +0100 @@ -1918,6 +1918,7 @@ gta01_config \ gta01v3_config \ +gta01bv2_config \ gta01v4_config : unconfig @board/gta01/split_by_variant.sh $@ Index: git/board/gta01/gta01.c =================================================================== --- git.orig/board/gta01/gta01.c 2007-01-04 12:22:12.000000000 +0100 +++ git/board/gta01/gta01.c 2007-01-04 12:22:16.000000000 +0100 @@ -35,28 +35,29 @@ DECLARE_GLOBAL_DATA_PTR; -#if 1 +#if defined(CONFIG_ARCH_GTA01_v3) || defined(CONFIG_ARCH_GTA01_v4) //#define M_MDIV 0xA1 /* Fout = 202.8MHz */ //#define M_PDIV 0x3 //#define M_SDIV 0x1 #define M_MDIV 0x90 /* Fout = 202.8MHz */ #define M_PDIV 0x7 #define M_SDIV 0x0 -#else -#define M_MDIV 0x5c /* Fout = 150.0MHz */ -#define M_PDIV 0x4 +#elif defined(CONFIG_ARCH_GTA01B_v2) +#if 0 +#define M_MDIV 0x7d /* Fout = 266MHz */ +#define M_PDIV 0x1 +#define M_SDIV 0x1 +#endif +#define M_MDIV 0x90 /* Fout = 202.8MHz */ +#define M_PDIV 0x7 #define M_SDIV 0x0 +#else +#error Please define GTA01 revision #endif -#if 1 #define U_M_MDIV 0x78 #define U_M_PDIV 0x2 #define U_M_SDIV 0x3 -#else -#define U_M_MDIV 0x48 -#define U_M_PDIV 0x3 -#define U_M_SDIV 0x2 -#endif static inline void delay (unsigned long loops) { @@ -137,7 +138,31 @@ gpio->GPHCON = 0x0000FAAA; gpio->GPHUP = 0x000007FF; +#elif defined(CONFIG_ARCH_GTA01B_v2) + gpio->GPACON = 0x005E47FF; + gpio->GPBCON = 0x00145416; + gpio->GPBUP = 0x000007FF; + gpio->GPBDAT |= 0x4; /* Set GBP2 to high (Flash power-up) */ + + gpio->GPCCON = 0xAAAA12A9; + gpio->GPCUP = 0x0000FFFF; + + gpio->GPDCON = 0xAAAAAAAA; + gpio->GPDUP = 0x0000FFFF; + + gpio->GPECON = 0xA02AAAAA; + gpio->GPEUP = 0x0000FFFF; + + gpio->GPFCON = 0x0000aa19; + gpio->GPFUP = 0x000000FF; + gpio->GPFDAT |= 0x4; /* Set GBF2 to high (nGSM_EN) */ + + gpio->GPGCON = 0xFF40F0C1; + gpio->GPGUP = 0x0000AFEF; + + gpio->GPHCON = 0x0000FAAA; + gpio->GPHUP = 0x000007FF; #else #error Please define GTA01 version #endif @@ -156,9 +181,11 @@ int board_late_init(void) { +#if defined(CONFIG_ARCH_GTA01_v3) || defined(CONFIG_ARCH_GTA01_v4) const char mmc_power = 0x8f; - /* enable D3REG 3.3V (SC/MMC power) */ + /* enable D2REG 3.3V (SC/MMC power) */ i2c_write(0x08, 0x25, 1, &mmc_power, 1); +#endif return 0; } @@ -176,5 +203,7 @@ return 0x00000130; #elif defined(CONFIG_ARCH_GTA01_v4) return 0x00000140; +#elif defined(CONFIG_ARCH_GTA01B_v2) + return 0x00000220; #endif } Index: git/board/gta01/split_by_variant.sh =================================================================== --- git.orig/board/gta01/split_by_variant.sh 2007-01-04 12:22:12.000000000 +0100 +++ git/board/gta01/split_by_variant.sh 2007-01-04 12:22:16.000000000 +0100 @@ -15,16 +15,23 @@ case "$1" in gta01v4_config) echo "#define CONFIG_ARCH_GTA01_v4" > ${obj}include/config.h + echo "GTA01_BIG_FLASH=n" > ${obj}board/gta01/config.tmp ;; gta01v3_config) echo "#define CONFIG_ARCH_GTA01_v3" > ${obj}include/config.h + echo "GTA01_BIG_FLASH=n" > ${obj}board/gta01/config.tmp ;; + gta01bv2_config) + echo "#define CONFIG_ARCH_GTA01B_v2" > ${obj}include/config.h + echo "GTA01_BIG_FLASH=y" > ${obj}board/gta01/config.tmp + ;; *) echo "$0:: Unrecognised config - using gta01v3_config" echo "#define CONFIG_ARCH_GTA01_v3" > ${obj}include/config.h + echo "GTA01_BIG_FLASH=n" > ${obj}board/gta01/config.tmp ;; esac Index: git/include/configs/gta01.h =================================================================== --- git.orig/include/configs/gta01.h 2007-01-04 12:22:12.000000000 +0100 +++ git/include/configs/gta01.h 2007-01-04 12:22:16.000000000 +0100 @@ -128,6 +128,8 @@ #define CFG_PROMPT "GTA01v3 # " /* Monitor Command Prompt */ #elif defined(CONFIG_ARCH_GTA01_v4) #define CFG_PROMPT "GTA01v4 # " /* Monitor Command Prompt */ +#elif defined(CONFIG_ARCH_GTA01B_v2) +#define CFG_PROMPT "GTA01Bv2 # " /* Monitor Command Prompt */ #endif #define CFG_CBSIZE 256 /* Console I/O Buffer Size */ #define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */ @@ -166,7 +168,13 @@ */ #define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */ #define PHYS_SDRAM_1 0x30000000 /* SDRAM Bank #1 */ +#if defined(CONFIG_ARCH_GTA01_v3) || defined(CONFIG_ARCH_GTA01_v4) #define PHYS_SDRAM_1_SIZE 0x04000000 /* 64 MB */ +#elif defined(CONFIG_ARCH_GTA01B_v2) +#define PHYS_SDRAM_1_SIZE 0x08000000 /* 128 MB */ +#else +#error Please define GTA01 variant +#endif #define PHYS_SDRAM_RES_SIZE 0x00200000 /* 2 MB for frame buffer */ /*----------------------------------------------------------------------- Index: git/board/gta01/lowlevel_init.S =================================================================== --- git.orig/board/gta01/lowlevel_init.S 2007-01-04 12:22:07.000000000 +0100 +++ git/board/gta01/lowlevel_init.S 2007-01-04 12:22:16.000000000 +0100 @@ -108,12 +108,16 @@ #define B5_PMC 0x0 /* normal */ #define B6_MT 0x3 /* SDRAM */ -#define B6_Trcd 0x1 +#define B6_Trcd 0x1 /* 3clk */ +#if defined (CONFIG_ARCH_GTA01_v3) || defined(CONFIG_ARCH_GTA01_v4) #define B6_SCAN 0x1 /* 9bit */ +#elif defined(CONFIG_ARCH_GTA01B_v2) +#define B6_SCAN 0x2 /* 10bit */ +#endif #define B7_MT 0x3 /* SDRAM */ #define B7_Trcd 0x1 /* 3clk */ -#define B7_SCAN 0x1 /* 9bit */ +#define B7_SCAN 0x2 /* 10bit */ /* REFRESH parameter */ #define REFEN 0x1 /* Refresh enable */ @@ -149,6 +153,19 @@ orr r1, r1, #0xc0000000 mcr p15, 0, r1, c1, c0, 0 +#if defined(CONFIG_ARCH_GTA01_v4) || defined(CONFIG_ARCH_GTA01B_v2) + /* switch on power for NAND */ + ldr r0, =0x56000010 /* GPBCON */ + ldr r1, [r0] + orr r1, r1, #0x10 + str r1, [r0] + + ldr r0, =0x56000014 /* GPBDAT */ + ldr r1, [r0] + orr r1, r1, #(1 <<2) + str r1, [r0] +#endif + /* everything is fine now */ mov pc, lr Index: git/board/gta01/config.mk =================================================================== --- git.orig/board/gta01/config.mk 2007-01-04 12:22:07.000000000 +0100 +++ git/board/gta01/config.mk 2007-01-04 12:22:16.000000000 +0100 @@ -8,18 +8,26 @@ # see http://www.samsung.com/ for more information on SAMSUNG # +# GTA01v3 has 1 bank of 64 MB SDRAM +# GTA01v4 has 1 bank of 64 MB SDRAM # -# GTA01 has 1 bank of 64 MB DRAM +# 3000'0000 to 3400'0000 +# we load ourself to 33F8'0000 +# +# GTA01Bv2 or later has 1 bank of 128 MB SDRAM # -# 3000'0000 to 3400'0000 +# 3000'0000 to 3800'0000 +# we load ourself to 37F8'0000 # # Linux-Kernel is expected to be at 3000'8000, entry 3000'8000 # optionally with a ramdisk at 3080'0000 # -# we load ourself to 33F8'0000 -# -# download area is 3300'0000 -# +# download area is 3200'0000 or 3300'0000 +sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp +ifeq ($(GTA01_BIG_RAM),y) +TEXT_BASE = 0x37F80000 +else TEXT_BASE = 0x33F80000 +endif