annotate gsm-fw/bsp/flashchipinit.S @ 875:dab341e172de

fc-shell: sysprim sending (sp command) implemented
author Space Falcon <falcon@ivan.Harhan.ORG>
date Sat, 30 May 2015 07:41:23 +0000
parents 2768b4339275
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
857
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
2 * TI's TCS211 firmware is designed to autodetect the flash chip type for
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
3 * its FFS, selecting different FFS configurations depending on what flash
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
4 * chip is found. In our FreeCalypso fw we fix our FFS configuration at
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
5 * compile time instead (for us it's more a matter of either mimicking or
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
6 * working around what the previous firmwares on our target devices do),
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
7 * so we have no "proper" place for flash chip type autodetection logic in
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
8 * our fw architecture.
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
9 *
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
10 * However, the following function (to be executed out of IRAM) mimics the
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
11 * sequence of flash chip accesses performed by TCS211's flash chip type
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
12 * autodetection function. It was added in a stray hope that it might fix
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
13 * the perplexing crash behavior we see when booting on a GTA02 modem that
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
14 * is "hot", i.e., powered off and then back on without giving it a long
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
15 * time to "cool".
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
16 */
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
17
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
18 .code 32
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
19 .text
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
20
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
21 .globl flash_chip_init
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
22 flash_chip_init:
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
23 ldr r1, =0x0300AAAA
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
24 ldr r2, =0x03005555
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
25 ldr r3, =0x03000000
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
26 /* read ID mode sequence */
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
27 mov r0, #0xAA
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
28 strh r0, [r1]
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
29 mov r0, #0x55
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
30 strh r0, [r2]
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
31 mov r0, #0x90
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
32 strh r0, [r1]
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
33 /* dummy reads */
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
34 ldrh r0, [r3, #0]
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
35 ldrh r0, [r3, #2]
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
36 /* Intel reset command */
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
37 mov r0, #0xFF
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
38 strh r0, [r3]
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
39 /* AMD reset sequence */
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
40 mov r0, #0xAA
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
41 strh r0, [r1]
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
42 mov r0, #0x55
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
43 strh r0, [r2]
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
44 mov r0, #0xF0
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
45 strh r0, [r1]
2768b4339275 a flash chip init/reset function added to Application_Initialize(),
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
46 bx lr