comparison bsp/flashchipinit.S @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:75a11d740a02
1 /*
2 * TI's TCS211 firmware is designed to autodetect the flash chip type for
3 * its FFS, selecting different FFS configurations depending on what flash
4 * chip is found. In our FreeCalypso fw we fix our FFS configuration at
5 * compile time instead (for us it's more a matter of either mimicking or
6 * working around what the previous firmwares on our target devices do),
7 * so we have no "proper" place for flash chip type autodetection logic in
8 * our fw architecture.
9 *
10 * However, the following function (to be executed out of IRAM) mimics the
11 * sequence of flash chip accesses performed by TCS211's flash chip type
12 * autodetection function. It was added in a stray hope that it might fix
13 * the perplexing crash behavior we see when booting on a GTA02 modem that
14 * is "hot", i.e., powered off and then back on without giving it a long
15 * time to "cool".
16 */
17
18 .code 32
19 .text
20
21 .globl flash_chip_init
22 flash_chip_init:
23 ldr r1, =0x0300AAAA
24 ldr r2, =0x03005555
25 ldr r3, =0x03000000
26 /* read ID mode sequence */
27 mov r0, #0xAA
28 strh r0, [r1]
29 mov r0, #0x55
30 strh r0, [r2]
31 mov r0, #0x90
32 strh r0, [r1]
33 /* dummy reads */
34 ldrh r0, [r3, #0]
35 ldrh r0, [r3, #2]
36 /* Intel reset command */
37 mov r0, #0xFF
38 strh r0, [r3]
39 /* AMD reset sequence */
40 mov r0, #0xAA
41 strh r0, [r1]
42 mov r0, #0x55
43 strh r0, [r2]
44 mov r0, #0xF0
45 strh r0, [r1]
46 bx lr