Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 361fd12

Browse files
steven-lgsbuildslave
authored andcommitted
Use a more robust way to get end of manufacturing state
should use the register 0x6c bit 30 for the EOM state, if the value is 0x1, it means eom is done; otherwise it means still in manufacturing mode. The 0x40 register bit 4 is not stable which will show wrong state in some rare cases. Change-Id: Ie979870c8a6b37f62f4853a3382bff2cc5ee5ab8 Tracked-On: https://jira.devtools.intel.com/browse/OAM-83525 Signed-off-by: Genshen, Li <[email protected]> Reviewed-on: https://android.intel.com:443/674999
1 parent 509c793 commit 361fd12

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

drivers/lifecycle/lifecycle.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,16 @@
3737
#include "lifecycle/LifeCycleProtocol.h"
3838
#include "lifecycle/lifecycle.h"
3939

40-
#define HECI1_HFS 0x40
40+
#define HECI1_FW_STS6 0x6c
4141

42-
typedef union hfs1 {
42+
typedef union hfs6 {
4343
struct {
44-
u32 working_state: 4; /* Current working state */
45-
u32 manuf_mode: 1; /* Manufacturing mode */
46-
u32 part_tbl_status: 1; /* Indicates status of flash
47-
* partition table */
48-
u32 reserved: 25; /* Reserved for further use */
49-
u32 d0i3_support: 1; /* Indicates D0i3 support */
44+
u32 reserved1: 30; /* Reserved */
45+
u32 eom_mode: 1; /* eom mode */
46+
u32 reserved2: 1; /* Reserved */
5047
} field;
5148
u32 data;
52-
} hfs1_t;
49+
} hfs6_t;
5350

5451
static struct {
5552
u16 vid;
@@ -63,7 +60,7 @@ get_life_cycle_state(__attribute__((__unused__)) EFI_LIFE_CYCLE_STATE_PROTOCOL *
6360
EFI_LIFE_CYCLE_STATE *LifeCycleState)
6461
{
6562
pcidev_t pci_dev = 0;
66-
hfs1_t status;
63+
hfs6_t status;
6764
size_t i;
6865

6966
for (i = 0; i < ARRAY_SIZE(SUPPORTED_DEVICES); i++)
@@ -75,9 +72,9 @@ get_life_cycle_state(__attribute__((__unused__)) EFI_LIFE_CYCLE_STATE_PROTOCOL *
7572
if (!pci_dev)
7673
return EFI_UNSUPPORTED;
7774

78-
status.data = pci_read_config32(pci_dev, HECI1_HFS);
75+
status.data = pci_read_config32(pci_dev, HECI1_FW_STS6);
7976

80-
if (status.field.manuf_mode)
77+
if (!status.field.eom_mode)
8178
*LifeCycleState = LC_STATE_MANUFACTURING;
8279
else
8380
*LifeCycleState = LC_STATE_ENDUSER;

0 commit comments

Comments
 (0)