changeset 857:2768b4339275

a flash chip init/reset function added to Application_Initialize(), see the comments in gsm-fw/bsp/flashchipinit.S
author Space Falcon <falcon@ivan.Harhan.ORG>
date Fri, 01 May 2015 16:27:59 +0000
parents d527ac304ad5
children 4c6e7ada647b
files gsm-fw/bsp/Makefile gsm-fw/bsp/flashchipinit.S gsm-fw/sysglue/appinit.c
diffstat 3 files changed, 48 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/bsp/Makefile	Thu Apr 30 07:40:30 2015 +0000
+++ b/gsm-fw/bsp/Makefile	Fri May 01 16:27:59 2015 +0000
@@ -5,7 +5,7 @@
 
 sinclude ../include/config.mk
 
-IOBJS=	irq_twiddle.o niq32.o
+IOBJS=	flashchipinit.o irq_twiddle.o niq32.o
 XTOBJS=	armio.o clkm.o init_target.o inth.o niq.o timer.o timer1.o timer2.o
 
 ifeq (${CONFIG_INCLUDE_SIM},1)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/bsp/flashchipinit.S	Fri May 01 16:27:59 2015 +0000
@@ -0,0 +1,46 @@
+/*
+ * TI's TCS211 firmware is designed to autodetect the flash chip type for
+ * its FFS, selecting different FFS configurations depending on what flash
+ * chip is found.  In our FreeCalypso fw we fix our FFS configuration at
+ * compile time instead (for us it's more a matter of either mimicking or
+ * working around what the previous firmwares on our target devices do),
+ * so we have no "proper" place for flash chip type autodetection logic in
+ * our fw architecture.
+ *
+ * However, the following function (to be executed out of IRAM) mimics the
+ * sequence of flash chip accesses performed by TCS211's flash chip type
+ * autodetection function.  It was added in a stray hope that it might fix
+ * the perplexing crash behavior we see when booting on a GTA02 modem that
+ * is "hot", i.e., powered off and then back on without giving it a long
+ * time to "cool".
+ */
+
+	.code 32
+	.text
+
+	.globl	flash_chip_init
+flash_chip_init:
+	ldr	r1, =0x0300AAAA
+	ldr	r2, =0x03005555
+	ldr	r3, =0x03000000
+/* read ID mode sequence */
+	mov	r0, #0xAA
+	strh	r0, [r1]
+	mov	r0, #0x55
+	strh	r0, [r2]
+	mov	r0, #0x90
+	strh	r0, [r1]
+/* dummy reads */
+	ldrh	r0, [r3, #0]
+	ldrh	r0, [r3, #2]
+/* Intel reset command */
+	mov	r0, #0xFF
+	strh	r0, [r3]
+/* AMD reset sequence */
+	mov	r0, #0xAA
+	strh	r0, [r1]
+	mov	r0, #0x55
+	strh	r0, [r2]
+	mov	r0, #0xF0
+	strh	r0, [r1]
+	bx	lr
--- a/gsm-fw/sysglue/appinit.c	Thu Apr 30 07:40:30 2015 +0000
+++ b/gsm-fw/sysglue/appinit.c	Fri May 01 16:27:59 2015 +0000
@@ -15,6 +15,7 @@
 	 * of calls to other functions, so I've inlined it.
 	 */
 	ABB_Sem_Create();
+	flash_chip_init();	/* FreeCalypso addition */
 	ffs_main_init();
 	/*
 	 * The call to pcm_init() used to be at the end of ffs_main_init(),