Skip to content

Commit 7cea8ee

Browse files
committed
Remove outdated definition of FLASH_PARAMETERS
1 parent c38ed92 commit 7cea8ee

File tree

2 files changed

+7
-32
lines changed

2 files changed

+7
-32
lines changed

common/descriptor.h

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -72,43 +72,18 @@ typedef struct FLASH_DESCRIPTOR_MAP_ {
7272
UINT32 DescriptorVersion; // Reserved prior to Coffee Lake
7373
} FLASH_DESCRIPTOR_MAP;
7474

75-
// Component section
75+
// Component section structure
7676
// Flash parameters DWORD structure
7777
typedef struct FLASH_PARAMETERS_ {
78-
UINT8 FirstChipDensity : 4;
79-
UINT8 SecondChipDensity : 4;
80-
UINT8 : 8;
78+
UINT16 : 16;
8179
UINT8 : 1;
8280
UINT8 ReadClockFrequency : 3; // Hardcoded value of 20 Mhz (000b) in v1 descriptors
83-
UINT8 FastReadEnabled : 1;
84-
UINT8 FastReadFrequency : 3;
85-
UINT8 FlashWriteFrequency : 3;
86-
UINT8 FlashReadStatusFrequency : 3;
87-
UINT8 DualOutputFastReadSupported : 1;
88-
UINT8 : 1;
81+
UINT8 : 4;
82+
UINT8 : 8;
8983
} FLASH_PARAMETERS;
9084

91-
// Flash densities
92-
#define FLASH_DENSITY_512KB 0x00
93-
#define FLASH_DENSITY_1MB 0x01
94-
#define FLASH_DENSITY_2MB 0x02
95-
#define FLASH_DENSITY_4MB 0x03
96-
#define FLASH_DENSITY_8MB 0x04
97-
#define FLASH_DENSITY_16MB 0x05
98-
#define FLASH_DENSITY_32MB 0x06
99-
#define FLASH_DENSITY_64MB 0x07
100-
#define FLASH_DENSITY_UNUSED 0x0F
101-
102-
// Flash frequencies
103-
#define FLASH_FREQUENCY_20MHZ 0x00
104-
#define FLASH_FREQUENCY_33MHZ 0x01
105-
#define FLASH_FREQUENCY_48MHZ 0x02
106-
#define FLASH_FREQUENCY_50MHZ_30MHZ 0x04
107-
#define FLASH_FREQUENCY_17MHZ 0x06
108-
109-
// Component section structure
11085
typedef struct FLASH_DESCRIPTOR_COMPONENT_SECTION_ {
111-
FLASH_PARAMETERS FlashParameters;
86+
FLASH_PARAMETERS FlashParameters; // Bit field with SPI flash parameters, changes almost every CPU generation, so will remain mostly undefined for now
11287
UINT8 InvalidInstruction0; // Instructions for SPI chip, that must not be executed, like FLASH ERASE
11388
UINT8 InvalidInstruction1; //
11489
UINT8 InvalidInstruction2; //

common/ffsparser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,8 @@ USTATUS FfsParser::parseIntelImage(const UByteArray & intelImage, const UINT32 l
326326
const FLASH_DESCRIPTOR_COMPONENT_SECTION* componentSection = (const FLASH_DESCRIPTOR_COMPONENT_SECTION*)calculateAddress8((UINT8*)descriptor, descriptorMap->ComponentBase);
327327

328328
UINT8 descriptorVersion = 2;
329-
// Check descriptor version by getting hardcoded value of FlashParameters.ReadClockFrequency
330-
if (componentSection->FlashParameters.ReadClockFrequency == FLASH_FREQUENCY_20MHZ)
329+
// Check descriptor version by getting hardcoded value of zero in FlashParameters.ReadClockFrequency
330+
if (componentSection->FlashParameters.ReadClockFrequency == 0)
331331
descriptorVersion = 1;
332332

333333
// Regions

0 commit comments

Comments
 (0)