comparison loadtools/scripts/compal.init @ 512:b0f9d38bfd9e

loadtools/scripts/compal.*: switch to 0x03000000 flash mapping
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 28 May 2019 17:35:55 +0000
parents ac48ed111d6a
children
comparison
equal deleted inserted replaced
511:0212edcec4d2 512:b0f9d38bfd9e
3 # official firmwares for all Compal models to which this init script applies. 3 # official firmwares for all Compal models to which this init script applies.
4 4
5 w16 fffffb00 00A3 5 w16 fffffb00 00A3
6 w16 fffffb02 00A3 6 w16 fffffb02 00A3
7 7
8 # On most targets we use the alternate nCS0 mapping at 0x03000000 to access 8 # Set the debug visibility bit in the FFFF:FB0E register so we can use
9 # the full flash bank even though the boot ROM is mapped at 0, overlapping 9 # the flash mapping at 0x03000000 like on all other platforms.
10 # the first 8 KiB of flash. However, the Calypso chip (all versions we work
11 # with) has a little design bug in this part of the silicon: the alternate
12 # nCS0 mapping at 0x03000000 works only when the debug visibility bit in the
13 # API-RHEA control register (bit 6 in the FFFF:FB0E register) is set, and
14 # does not work otherwise. This bit is initially set as the Calypso comes
15 # out of reset, and on most platforms we gain loadtool access via the boot ROM,
16 # hence the problem does not occur - but on these Compal targets we gain
17 # loadtool access either through Compal's bootloader or via tfc139, and in
18 # both cases Compal's fw (either the full fw or the bootloader part) has
19 # already set the register in question to the runtime operational value of
20 # 0x2A (unchanged from TI's TCS211 reference fw), with the debug visibility
21 # bit cleared, hence the 0x03000000 flash mapping no longer works.
22 #
23 # We could write into the FFFF:FB0E register here, restore the Calypso power-up
24 # state and use the 0x03000000 mapping like on other platforms, but the problem
25 # of the mapping not working as expected was first encountered in 2014 when we
26 # started working on Compal targets, whereas the root cause described above was
27 # only discovered in 2019. For now we are keeping the original workaround from
28 # 2014: we set the FFFF:FB10 register to map the flash (not the boot ROM)
29 # to address 0, and use that "main" mapping instead of the alternate one.
30 10
31 w16 fffffb10 0300 11 w16 fffffb0e 006A