comparison TCS211-fw-arch @ 9:5de1f72ce941

TCS211-fw-arch: flash chip type autodetection reinstated
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 20 Dec 2018 07:09:54 +0000
parents fcd1cf531017
children f5ddeacbe744
comparison
equal deleted inserted replaced
8:dc0e9c91d54a 9:5de1f72ce941
1202 there is a piece of autodetection code that reads the flash chip ID, and the 1202 there is a piece of autodetection code that reads the flash chip ID, and the
1203 autodetected ID is then looked up in a hard-coded table that gives the driver 1203 autodetected ID is then looked up in a hard-coded table that gives the driver
1204 and geometry details and the location of the FFS sectors for each supported 1204 and geometry details and the location of the FFS sectors for each supported
1205 flash chip type. However, this approach has its limitations: 1205 flash chip type. However, this approach has its limitations:
1206 1206
1207 * The sequence of write operations which TI's autodetection code issues in 1207 * The sequence of write operations which TI's original autodetection code
1208 order to put the flash chip into its Read ID mode worked for older flash 1208 issues in order to put the flash chip into its Read ID mode worked for older
1209 chips that were used by TI and Openmoko, but does not work for the newer 1209 flash chips that were used by TI and Openmoko, but does not work for the newer
1210 Spansion S71PL129NC0HFW4B flash chip which we (FreeCalypso) have copied from 1210 Spansion S71PL129NC0HFW4B flash chip which we (FreeCalypso) have copied from
1211 the Pirelli DP-L10 phone. 1211 the Pirelli DP-L10 phone. We have now fixed it, but until recently we had to
1212 disable flash autodetection and hard-code the flash chip type on Pirelli and
1213 FCDEV3B targets.
1212 1214
1213 * While the physical flash chip used on a given phone or modem board is a 1215 * While the physical flash chip used on a given phone or modem board is a
1214 physical property that can be autodetected, the choice of which flash sectors 1216 physical property that can be autodetected, the choice of which flash sectors
1215 should be used for FFS is a matter of policy. Before we built our own 1217 should be used for FFS is a matter of policy. Before we built our own
1216 FreeCalypso hardware, we had to run our fw on some pre-existing "alien" hw 1218 FreeCalypso hardware, we had to run our fw on some pre-existing "alien" hw
1223 matter of board wiring whether that second flash chip select is connected to 1225 matter of board wiring whether that second flash chip select is connected to
1224 Calypso chip select nCS2, nCS3 or nCS4 - thus FFS addresses in the second bank 1226 Calypso chip select nCS2, nCS3 or nCS4 - thus FFS addresses in the second bank
1225 have to be hard-coded with conditional compilation per board type and cannot 1227 have to be hard-coded with conditional compilation per board type and cannot
1226 be autodetected. 1228 be autodetected.
1227 1229
1228 To support our new repertoire of possible hardware targets, the logic has been 1230 To support our new repertoire of possible hardware targets, we have made the
1229 changed as follows in our Magnetite and Selenite firmwares: 1231 following changes in our Magnetite and Selenite firmwares:
1230 1232
1231 * When the target is our own FC hardware family (CONFIG_TARGET_FCFAM) or the 1233 * We have a new version of the ffsdrv_device_id_read() autodetection function
1232 Pirelli DP-L10 phone (CONFIG_TARGET_PIRELLI), flash chip type autodetection 1234 that issues AMD's Read ID command sequence in a way that works with all flash
1233 is disabled and a strictly fixed hard-coded FFS configuration is used; 1235 chips which we've encountered so far in real life, including Openmoko's
1234 1236 Samsung K5A3281 and our new (originally Pirelli's) Spansion flash chip. We
1235 * When the target is one of Mot C1xx subfamilies, the autodetection logic is 1237 have also incorporated the logic from Pirelli's firmware that distinguishes
1236 kept (several different flash chip types are found in these phones), but a 1238 between S71PL-J and S71PL-N chips: they have different sector sizes which FFS
1237 different table is used, giving our aftermarket FFS configurations for these 1239 needs to know about, but they have the same ID codes and can only be
1238 Mot C1xx flash chip types; 1240 distinguished through CFI.
1239 1241
1240 * When the target is gtamodem (Openmoko GTA01/02 modem) or dsample (TI's 1242 * The autodetected flash ID code is looked up in a compiled-in table like
1241 D-Sample board), we use the original autodetection logic and device table 1243 before, but we now have 4 different versions of this table selected by
1242 which we got from TI/Openmoko. 1244 conditional compilation based on the target for which the firmware is being
1243 1245 built:
1244 We have also changed the AMD multibank flash driver to issue write commands in 1246
1245 a way that is compatible with our new S71PL129NC0HFW4B chip. 1247 - For our own FC hardware family (CONFIG_TARGET_FCFAM) we have our brand-new
1248 table of possible flash configurations which we keep free of any legacy
1249 gunk;
1250
1251 - For Mot C1xx targets (CONFIG_TARGET_COMPAL) we have a dedicated table
1252 giving our aftermarket FFS configurations for Intel flash chip types found
1253 in these phones;
1254
1255 - For the Pirelli DP-L10 target (CONFIG_TARGET_PIRELLI) we likewise have
1256 another dedicated table giving our aftermarket FFS config for Pirelli's
1257 S71PL-J or S71PL-N flash;
1258
1259 - The #else clause is the original table from TI/Openmoko, used on
1260 dsample and gtamodem targets.
1261
1262 The advantages of this new approach over our previous approach of disabling
1263 flash autodetection and using a strictly fixed hard-coded FFS config for
1264 FreeCalypso and Pirelli targets are:
1265
1266 * The high-capacity flash chip we are currently using (S71PL129NC0HFW4B) is
1267 great for development boards or perhaps for a high-end Pirelli-like feature
1268 phone, but it would be way overkill for an embedded modem product - for the
1269 latter device class a smaller flash chip like Openmoko's K5A32xx would be
1270 more appropriate. The new autodetection approach makes it possible to build
1271 a single fw image that can run on both large-flash and small-flash boards.
1272
1273 * I've only seen Pirelli phones with S71PL-N flash so far, but their original
1274 fw supports both S71PL-J and S71PL-N with autodetection. We can now do
1275 likewise in our FreeCalypso fw.
1276
1277 Finally, independent of flash chip type autodetection vs. hard-coding issues,
1278 we have had to change the AMD multibank flash driver to issue write commands in
1279 a way that is compatible with our new S71PL129NC0HFW4B chip. It still works
1280 just as well with Openmoko's K5A32xx.
1246 1281
1247 FFS life cycle 1282 FFS life cycle
1248 -------------- 1283 --------------
1249 1284
1250 In products that have been built according to TI's original way, including 1285 In products that have been built according to TI's original way, including