view gsm-fw/bsp/flashchipinit.S @ 923:10b4bed10192

gsm-fw/L1: fix for the DSP patch corruption bug The L1 code we got from the LoCosto fw contains a feature for DSP CPU load measurement. This feature is a LoCosto-ism, i.e., not applicable to earlier DBB chips (Calypso) with their respective earlier DSP ROMs. Most of the code dealing with that feature is conditionalized as #if (DSP >= 38), but one spot was missed, and the MCU code was writing into an API word dealing with this feature. In TCS211 this DSP API word happens to be used by the DSP code patch, hence that write was corrupting the patched DSP code.
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Mon, 19 Oct 2015 17:13:56 +0000
parents 2768b4339275
children
line wrap: on
line source

/*
 * 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