Bug #4769


gtm900b target: autodetection between MGCxGSMT and MG01GSMT hw is wrong

Added by falconia about 3 years ago. Updated about 3 years ago.

OsmocomBB Firmware
Target version:
Start date:
Due date:
% Done:


Spec Reference:


There exist 3 different hw variants which were all sold as GTM900-B by Huawei: MG01GSMT, MGC1GSMT and MGC2GSMT. The last of the 3 was also made with 850&1900 MHz SAW filters and sold as GTM900-P. MGC1 and MGC2 are fully firmware-compatible, but the earliest MG01GSMT has different flash size and thus different FFS location (would matter for #3582), and a different set of TSPACT signals for RFFE control. The current code in OBB uses the flash manufacturer ID (Spansion vs. Samsung) to decide which set of RFFE control signals should be used, but this logic is wrong.

To this Mother's knowledge MG01GSMT was shipped with only one flash chip type (Spansion S71PL064J), but I have personally seen 3 different flash chip types on the MGCxGSMT family:

  • Spansion S71PL032J
  • Samsung K5A3281CTM (same as Openmoko GTA02)
  • Samsung K5L3316CAM

All 3 just-listed chips found in MGCxGSMT modules have the same 4 MiB total size and the same geometry toward the higher addresses end, and thankfully Huawei used the same FFS configuration on all 3 - but the 8 MiB chip on MG01GSMT is obviously different.

The problem with the current autodetection logic is that it assumes that Spansion flash means MG01GSMT. This logic will give the wrong answer on MGC2GSMT modules with S71PL032J flash - it is a Spansion flash chip, but the module is still an MGC2GSMT variant and needs MGCxGSMT RFFE control signals.

My approach would be to make separate gtm900mg01 and gtm900mgc fw build targets, but if you wish to continue autodetecting based on the flash chip type, you should use flash total size rather than manufacturer ID: 4 MiB means MGCxGSMT, 8 MiB means MG01GSMT.


os4769-20200928.patch os4769-20200928.patch 10.6 KB falconia, 09/28/2020 08:10 PM
Actions #1

Updated by falconia about 3 years ago

The attached patch fixes flash-based autodetection (changes the code to look at the complete flash device ID rather than just the manufacturer ID) and adds the appropriate tiffs_init() calls for 4 MiB vs. 8 MiB flash. The latter addition is necessary for #3582.

Actions #2

Updated by laforge about 3 years ago

  • Status changed from New to In Progress
  • Assignee set to laforge
Actions #4

Updated by laforge about 3 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 30 to 100

patches merged.


Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)