acrn-config: set default package value for _S3 and _S5
Some BIOS does not support s3/s5, so there might be no _S3 or _S5 package in host ACPI table, previous code did not handle this, so the build would be failed with the generated board file. Set default s3/s5 package value to 0 for such case. Tracked-On: #3854 Signed-off-by: Wei Liu <weix.w.liu@intel.com> Acked-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
parent
24d3eaba27
commit
9ea7a85ca5
|
@ -91,6 +91,11 @@ def multi_info_parser(config, default_platform, msg_s, msg_e):
|
|||
multi_lines = board_cfg_lib.get_info(board_cfg_lib.BOARD_INFO_FILE, msg_s, msg_e)
|
||||
|
||||
for s_line in multi_lines:
|
||||
# parse the commend line
|
||||
if '/*' in s_line:
|
||||
print("{}".format(s_line), file=config)
|
||||
continue
|
||||
|
||||
if s_line.split()[1] in write_direct:
|
||||
if "PM1A_CNT" in s_line.split()[1] and int(s_line.split()[2].strip('UL'), 16) == 0:
|
||||
pm_ac_sz.pm1a_cnt_ac_sz = False
|
||||
|
|
|
@ -343,6 +343,13 @@ def decode_sx_pkg(pkg_len, f_node):
|
|||
return (pkg_val_pm1a, pkg_val_pm1b, pkg_val_resv, need_break)
|
||||
|
||||
|
||||
def set_default_sx_value(sx_name, config):
|
||||
print("\t/* {} is not supported by BIOS */".format(sx_name), file=config)
|
||||
print("\t#define {}_PKG_VAL_PM1A 0x0U".format(sx_name), file=config)
|
||||
print("\t#define {}_PKG_VAL_PM1B 0x0U".format(sx_name), file=config)
|
||||
print("\t#define {}_PKG_RESERVED 0x0U".format(sx_name), file=config)
|
||||
|
||||
|
||||
def read_pm_sdata(sysnode, sx_name, config):
|
||||
"""This will read pm Sx state of power
|
||||
:param sysnode: the system node of Sx power state, like:/sys/firmware/acpi/tables/DSDT
|
||||
|
@ -358,6 +365,14 @@ def read_pm_sdata(sysnode, sx_name, config):
|
|||
|
||||
(need_break, need_continue, pkg_len) = read_sx_locate(sx_name, f_node)
|
||||
if need_break:
|
||||
# BIOS dose not support for SX, set it to default value
|
||||
s_name = ''
|
||||
if 'S3' in sx_name:
|
||||
s_name = 'S3'
|
||||
else:
|
||||
s_name = 'S5'
|
||||
|
||||
set_default_sx_value(s_name, config)
|
||||
break
|
||||
if need_continue:
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue