northbridge/intel/sandybridge: Update hostbridge.asl to ASL2.0 syntax

This change updates hostbridge.asl to use ASL2.0 syntax. This
increases the readability of the ASL code.

TEST=Verified using --timeless option to abuild that the resulting
coreboot.rom is same as without the ASL2.0 syntax changes for google/link.

Change-Id: I5345ee22df7da92ee48c718f5bd748d7ea6155f2
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41978
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
This commit is contained in:
Furquan Shaikh 2020-06-01 13:44:57 -07:00 committed by Patrick Georgi
parent 506479d2a8
commit 9e94cce35d
1 changed files with 26 additions and 27 deletions

View File

@ -130,17 +130,16 @@ Device (MCHC)
External (\_SB.CP00._PSS) External (\_SB.CP00._PSS)
Method (PSSS, 1, NotSerialized) Method (PSSS, 1, NotSerialized)
{ {
Store (One, Local0) /* Start at P1 */ Local0 = 1 /* Start at P1 */
Store (SizeOf (\_SB.CP00._PSS), Local1) Local1 = SizeOf (\_SB.CP00._PSS)
While (LLess (Local0, Local1)) { While (Local0 < Local1) {
/* Store _PSS entry Control value to Local2 */ /* Store _PSS entry Control value to Local2 */
ShiftRight (DeRefOf (Index (DeRefOf (Index Local2 = DeRefOf (Index (DeRefOf (Index (\_SB.CP00._PSS, Local0)), 4)) >> 8
(\_SB.CP00._PSS, Local0)), 4)), 8, Local2) If (Local2 == Arg0) {
If (LEqual (Local2, Arg0)) { Return (Local0 - 1)
Return (Subtract (Local0, 1))
} }
Increment (Local0) Local0++
} }
Return (0) Return (0)
@ -160,23 +159,23 @@ Device (MCHC)
Store ("Set TDP Down", Debug) Store ("Set TDP Down", Debug)
/* Set CTC */ /* Set CTC */
Store (CTCD, CTCS) CTCS = CTCD
/* Set TAR */ /* Set TAR */
Store (TARD, TARS) TARS = TARD
/* Set PPC limit and notify OS */ /* Set PPC limit and notify OS */
Store (PSSS (TARD), PPCM) PPCM = PSSS (TARD)
PPCN () PPCN ()
/* Set PL2 to 1.25 * PL1 */ /* Set PL2 to 1.25 * PL1 */
Divide (Multiply (CTDD, 125), 100, , PL2V) PL2V = (CTDD * 125) / 100
/* Set PL1 */ /* Set PL1 */
Store (CTDD, PL1V) PL1V = CTDD
/* Store the new TDP Down setting */ /* Store the new TDP Down setting */
Store (CTCD, CTCC) CTCC = CTCD
Release (CTCM) Release (CTCM)
Return (1) Return (1)
@ -196,23 +195,23 @@ Device (MCHC)
Store ("Set TDP Nominal", Debug) Store ("Set TDP Nominal", Debug)
/* Set PL1 */ /* Set PL1 */
Store (CTDN, PL1V) PL1V = CTDN
/* Set PL2 to 1.25 * PL1 */ /* Set PL2 to 1.25 * PL1 */
Divide (Multiply (CTDN, 125), 100, , PL2V) PL2V = (CTDN * 125) / 100
/* Set PPC limit and notify OS */ /* Set PPC limit and notify OS */
Store (PSSS (TARN), PPCM) PPCM = PSSS (TARN)
PPCN () PPCN ()
/* Set TAR */ /* Set TAR */
Store (TARN, TARS) TARS = TARN
/* Set CTC */ /* Set CTC */
Store (CTCN, CTCS) CTCS = CTCN
/* Store the new TDP Nominal setting */ /* Store the new TDP Nominal setting */
Store (CTCN, CTCC) CTCC = CTCN
Release (CTCM) Release (CTCM)
Return (1) Return (1)
@ -343,18 +342,18 @@ Method (_CRS, 0, Serialized)
// Fix up PCI memory region // Fix up PCI memory region
// Start with Top of Lower Usable DRAM // Start with Top of Lower Usable DRAM
Store (^MCHC.TLUD, Local0) Local0 = ^MCHC.TLUD
Store (^MCHC.MEBA, Local1) Local1 = ^MCHC.MEBA
// Check if ME base is equal // Check if ME base is equal
If (LEqual (Local0, Local1)) { If (Local0 == Local1) {
// Use Top Of Memory instead // Use Top Of Memory instead
Store (^MCHC.TOM, Local0) Local0 = ^MCHC.TOM
} }
Store (Local0, PMIN) PMIN = Local0
Store (Subtract(CONFIG_MMCONF_BASE_ADDRESS, 1), PMAX) PMAX = CONFIG_MMCONF_BASE_ADDRESS - 1
Add(Subtract(PMAX, PMIN), 1, PLEN) PLEN = PMAX - PMIN + 1
Return (MCRS) Return (MCRS)
} }