Add capability to set PMU prim-info property

This property is missing from the Mac mini, and is required to
initialise the Power Manager.
This commit is contained in:
Elliot Nunn 2018-03-05 13:25:29 +08:00
parent 46d862c98c
commit e12a315f42

View File

@ -36,6 +36,9 @@ SET_COMPATIBLE_PROPERTY = [x for x in [
# 'Power Macintosh', # 'Power Macintosh',
] if x] ] if x]
SET_PRIM_INFO = None
# SET_PRIM_INFO = ['000000ff', '0000002c', '00030d40', '0001e705', '00001400', '00000000', '0000260d', '46000270'] # for mini
# Adds code to set the AAPL,debug property early in the boot script # Adds code to set the AAPL,debug property early in the boot script
DEBUG_PROPERTY = 0 DEBUG_PROPERTY = 0
# DEBUG_PROPERTY |= 0x00000001 # Print general informative messages. # DEBUG_PROPERTY |= 0x00000001 # Print general informative messages.
@ -91,6 +94,16 @@ info_size = len(tbxi)
BOOT_SCRIPT = '' BOOT_SCRIPT = ''
if SET_PRIM_INFO:
BOOT_SCRIPT += "\ SET_PRIM_INFO\n"
BOOT_SCRIPT += "dev via-pmu dev power-mgt\n"
BOOT_SCRIPT += '%s encode-int\n' % SET_PRIM_INFO[0]
for x in SET_PRIM_INFO[1:]:
BOOT_SCRIPT += '%s encode-int encode+\n' % x
BOOT_SCRIPT += '" prim-info" property\n'
BOOT_SCRIPT += 'device-end\n'
BOOT_SCRIPT += '\ END SET_PRIM_INFO\n'
if DEBUG_PROPERTY: BOOT_SCRIPT += """ if DEBUG_PROPERTY: BOOT_SCRIPT += """
\ DEBUG_PROPERTY \ DEBUG_PROPERTY
dev / dev /