diff options
author | Felix Singer <felixsinger@posteo.net> | 2022-12-16 07:11:17 +0100 |
---|---|---|
committer | Felix Singer <felixsinger@posteo.net> | 2022-12-23 10:18:48 +0000 |
commit | 35e65a8bc36628baad7d2ed94bef7619971e6d88 (patch) | |
tree | a3b4d2afe3494eee4049db95f04a69d61113f006 /src | |
parent | 86bc2e708dc2600c5611b6573d43645e7d57e561 (diff) |
tree: Replace And(a,b,c) with ASL 2.0 syntax
Replace `And (a, b, c)` with `c = a & b`, respectively `c &= b` where
possible.
Change-Id: Ie558f9d0b597c56ca3b31498edb68de8877d3a2f
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70850
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
21 files changed, 60 insertions, 60 deletions
diff --git a/src/drivers/intel/gma/acpi/configure_brightness_levels.asl b/src/drivers/intel/gma/acpi/configure_brightness_levels.asl index 5adb1a2a32..c2f63513c7 100644 --- a/src/drivers/intel/gma/acpi/configure_brightness_levels.asl +++ b/src/drivers/intel/gma/acpi/configure_brightness_levels.asl @@ -76,7 +76,7 @@ Sleep (1) If (And (ASLC, 0x2) == 0) { /* Request has been processed, check status: */ - And (ASLC >> 12, 0x3, Local1) + Local1 = (ASLC >> 12) & 3 If (Local1 == 0) { Return (Zero) } Else { diff --git a/src/ec/google/chromeec/acpi/ec.asl b/src/ec/google/chromeec/acpi/ec.asl index 59f14d1d08..ce81880051 100644 --- a/src/ec/google/chromeec/acpi/ec.asl +++ b/src/ec/google/chromeec/acpi/ec.asl @@ -630,7 +630,7 @@ Device (EC0) */ Method (UPPC, 1, Serialized) { - And (USPP, Not (1 << Arg0), USPP) + USPP &= Not (1 << Arg0) } #endif diff --git a/src/ec/quanta/ene_kb3940q/acpi/ec.asl b/src/ec/quanta/ene_kb3940q/acpi/ec.asl index 9d38bb6461..f60238b950 100644 --- a/src/ec/quanta/ene_kb3940q/acpi/ec.asl +++ b/src/ec/quanta/ene_kb3940q/acpi/ec.asl @@ -131,7 +131,7 @@ Device (EC0) Local0 = CTMP // Use Local0 to avoid iasl warning: Method Local is set but never used - And(Local0, Ones, Local0) + Local0 &= Ones // Find and program number of P-States MPST = SizeOf (\_SB.CP00._PSS) diff --git a/src/ec/quanta/it8518/acpi/battery.asl b/src/ec/quanta/it8518/acpi/battery.asl index ef7a8e2520..53bcb6a10f 100644 --- a/src/ec/quanta/it8518/acpi/battery.asl +++ b/src/ec/quanta/it8518/acpi/battery.asl @@ -244,7 +244,7 @@ Device (BATX) If (ACPW) { // Set only charging/discharging bits - And (Local0, 0x03, Local1) + Local1 = Local0 & 3 } Else { @@ -253,7 +253,7 @@ Device (BATX) } // Flag if the battery level is critical - And (Local0, 0x04, Local4) + Local4 = Local0 & 4 Local1 |= Local4 PBST[0] = Local1 diff --git a/src/ec/smsc/mec1308/acpi/battery.asl b/src/ec/smsc/mec1308/acpi/battery.asl index f0e6d6d4ec..09f3bd51ad 100644 --- a/src/ec/smsc/mec1308/acpi/battery.asl +++ b/src/ec/smsc/mec1308/acpi/battery.asl @@ -61,7 +61,7 @@ Device (BAT0) { Local0 = Arg0 >> 8 Local1 = Arg0 << 8 - And (Local1, 0xFF00, Local1) + Local1 &= 0xFF00 Local0 |= Local1 If (Local0 == 0xFFFF) { Local0 = 0xFFFFFFFF @@ -111,14 +111,14 @@ Device (BAT0) // Check if AC is present If (ACEX) { // Set only charging/discharging bits - And (Local0, 0x03, Local1) + Local1 = Local0 & 3 } Else { // Always discharging when on battery power Local1 = 0x01 } // Flag if the battery level is critical - And (Local0, 0x04, Local4) + Local4 = Local0 & 4 Local1 |= Local4 PBST[0] = Local1 diff --git a/src/mainboard/aopen/dxplplusu/acpi/e7505_pri.asl b/src/mainboard/aopen/dxplplusu/acpi/e7505_pri.asl index 4ea50c5aac..98b52f279b 100644 --- a/src/mainboard/aopen/dxplplusu/acpi/e7505_pri.asl +++ b/src/mainboard/aopen/dxplplusu/acpi/e7505_pri.asl @@ -36,7 +36,7 @@ Device (MBRS) CreateQWordField (MSBF, \_SB.MBRS._Y1C._MAX, MEMM) CreateQWordField (MSBF, \_SB.MBRS._Y1C._LEN, LELM) - And (\_SB.PCI0.RLAR, 0x03FF, Local1) + Local1 = \_SB.PCI0.RLAR & 0x03FF Local1++ If (Local1 > 0x40) { @@ -47,7 +47,7 @@ Device (MBRS) CreateDWordField (MSBF, \_SB.MBRS._Y1D._MIN, MS00) CreateDWordField (MSBF, \_SB.MBRS._Y1D._MAX, MS01) CreateDWordField (MSBF, \_SB.MBRS._Y1D._LEN, MEM2) - And (\_SB.PCI0.TOLM, 0xF800, Local1) + Local1 = \_SB.PCI0.TOLM & 0xF800 Local1 >>= 4 Local1-- If (Local1 > 0x10) diff --git a/src/mainboard/aopen/dxplplusu/acpi/e7505_sec.asl b/src/mainboard/aopen/dxplplusu/acpi/e7505_sec.asl index 6976be84d4..2a206e08fe 100644 --- a/src/mainboard/aopen/dxplplusu/acpi/e7505_sec.asl +++ b/src/mainboard/aopen/dxplplusu/acpi/e7505_sec.asl @@ -41,7 +41,7 @@ Method (_CRS, 0, NotSerialized) CreateDWordField (PBRS, \_SB.PCI0._Y08._MIN, MEML) CreateDWordField (PBRS, \_SB.PCI0._Y08._MAX, MEMH) CreateDWordField (PBRS, \_SB.PCI0._Y08._LEN, LENM) - And (\_SB.PCI0.TOLM, 0xF800, Local1) + Local1 = \_SB.PCI0.TOLM & 0xF800 Local1 >>= 4 MEML = Local1 << 0x14 MEMH = IO_APIC_ADDR - 1 diff --git a/src/mainboard/aopen/dxplplusu/acpi/i82801db.asl b/src/mainboard/aopen/dxplplusu/acpi/i82801db.asl index 8fb24bf88a..2d223c515a 100644 --- a/src/mainboard/aopen/dxplplusu/acpi/i82801db.asl +++ b/src/mainboard/aopen/dxplplusu/acpi/i82801db.asl @@ -115,7 +115,7 @@ Device (ICH0) Local0 = PBAR If (Local0 && 1) { - And (Local0, 0xFFFE, Local0) + Local0 &= 0xFFFE IOA1 = Local0 IOA2 = Local0 IOAL = 0x80 @@ -129,7 +129,7 @@ Device (ICH0) Local0 = GBAR If (Local0 && 1) { - And (Local0, 0xFFFE, Local0) + Local0 &= 0xFFFE IOS1 = Local0 IOS2 = Local0 IOSL = 0x40 diff --git a/src/mainboard/aopen/dxplplusu/acpi/superio.asl b/src/mainboard/aopen/dxplplusu/acpi/superio.asl index cd8dc8bf2f..bb1632971d 100644 --- a/src/mainboard/aopen/dxplplusu/acpi/superio.asl +++ b/src/mainboard/aopen/dxplplusu/acpi/superio.asl @@ -110,28 +110,28 @@ Method (_INI, 0, NotSerialized) /* GPIO initial output levels */ Local0 = GP_1 - And( Local0, 0x7C, Local0) + Local0 &= 0x7C Local0 |= 0x81 GP_1 = Local0 Local0 = GP_2 - And( Local0, 0xFE, Local0) + Local0 &= 0xFE Local0 |= 0 GP_2 = Local0 Local0 = GP_3 - And( Local0, 0x7F, Local0) + Local0 &= 0x7F Local0 |= 0x80 GP_3 = Local0 Local0 = GP_4 - And( Local0, 0x7F, Local0) + Local0 &= 0x7F Local0 |= 0 GP_4 = Local0 /* Power Led */ Local0 = LED1 - And( Local0, 0xfc, Local0) + Local0 &= 0xfc Local0 |= 1 LED1 = Local0 diff --git a/src/mainboard/google/cyan/variants/terra/include/variant/acpi/mainboard.asl b/src/mainboard/google/cyan/variants/terra/include/variant/acpi/mainboard.asl index 1f46c69aeb..7ab1b84706 100644 --- a/src/mainboard/google/cyan/variants/terra/include/variant/acpi/mainboard.asl +++ b/src/mainboard/google/cyan/variants/terra/include/variant/acpi/mainboard.asl @@ -10,7 +10,7 @@ Scope (\_SB) { Method (GPID, 0, Serialized) // GPID: Get Project ID for Terra2/Terra3 { - And(\BDID >> 3, 0x01, Local0) + Local0 = (\BDID >> 3) & 1 Return (Local0) } } diff --git a/src/mainboard/lenovo/s230u/acpi/gpe.asl b/src/mainboard/lenovo/s230u/acpi/gpe.asl index f9ba2096fb..27daf64028 100644 --- a/src/mainboard/lenovo/s230u/acpi/gpe.asl +++ b/src/mainboard/lenovo/s230u/acpi/gpe.asl @@ -20,7 +20,7 @@ Scope (_GPE) Local0 = One << Arg1 If (Arg0 == Zero) { Not (Local0, Local0) - And (GIV0, Local0, GIV0) + GIV0 &= Local0 } Else { GIV0 |= Local0 } diff --git a/src/soc/intel/baytrail/acpi/lpe.asl b/src/soc/intel/baytrail/acpi/lpe.asl index a997a6e2a0..d0ce253ff3 100644 --- a/src/soc/intel/baytrail/acpi/lpe.asl +++ b/src/soc/intel/baytrail/acpi/lpe.asl @@ -93,7 +93,7 @@ Device (LPEA) Method (_ON) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } diff --git a/src/soc/intel/baytrail/acpi/lpss.asl b/src/soc/intel/baytrail/acpi/lpss.asl index 8882e0efa8..113d5c0d2f 100644 --- a/src/soc/intel/baytrail/acpi/lpss.asl +++ b/src/soc/intel/baytrail/acpi/lpss.asl @@ -118,7 +118,7 @@ Device (I2C1) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -177,7 +177,7 @@ Device (I2C2) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -236,7 +236,7 @@ Device (I2C3) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -295,7 +295,7 @@ Device (I2C4) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -354,7 +354,7 @@ Device (I2C5) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -413,7 +413,7 @@ Device (I2C6) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -472,7 +472,7 @@ Device (I2C7) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -525,7 +525,7 @@ Device (SPI1) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -634,7 +634,7 @@ Device (UAR1) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -687,7 +687,7 @@ Device (UAR2) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } diff --git a/src/soc/intel/baytrail/acpi/scc.asl b/src/soc/intel/baytrail/acpi/scc.asl index 0dcac61021..d11173b935 100644 --- a/src/soc/intel/baytrail/acpi/scc.asl +++ b/src/soc/intel/baytrail/acpi/scc.asl @@ -47,7 +47,7 @@ Device (EMMC) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } @@ -110,7 +110,7 @@ Device (SDIO) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -162,7 +162,7 @@ Device (SDCD) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } diff --git a/src/soc/intel/braswell/acpi/lpe.asl b/src/soc/intel/braswell/acpi/lpe.asl index 494fd244aa..9f400458c3 100644 --- a/src/soc/intel/braswell/acpi/lpe.asl +++ b/src/soc/intel/braswell/acpi/lpe.asl @@ -93,7 +93,7 @@ Device (LPEA) Method (_ON) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } diff --git a/src/soc/intel/braswell/acpi/lpss.asl b/src/soc/intel/braswell/acpi/lpss.asl index da495b8279..2c720ffcc1 100644 --- a/src/soc/intel/braswell/acpi/lpss.asl +++ b/src/soc/intel/braswell/acpi/lpss.asl @@ -149,7 +149,7 @@ Device (I2C1) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -208,7 +208,7 @@ Device (I2C2) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -267,7 +267,7 @@ Device (I2C3) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -326,7 +326,7 @@ Device (I2C4) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -385,7 +385,7 @@ Device (I2C5) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -444,7 +444,7 @@ Device (I2C6) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -503,7 +503,7 @@ Device (I2C7) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -556,7 +556,7 @@ Device (UAR1) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -609,7 +609,7 @@ Device (UAR2) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } diff --git a/src/soc/intel/braswell/acpi/scc.asl b/src/soc/intel/braswell/acpi/scc.asl index 9eaf7d2d66..91c5d278f1 100644 --- a/src/soc/intel/braswell/acpi/scc.asl +++ b/src/soc/intel/braswell/acpi/scc.asl @@ -47,7 +47,7 @@ Device (EMMC) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } @@ -148,7 +148,7 @@ Device (SDIO) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } @@ -200,7 +200,7 @@ Device (SDCD) Method (_PS0) { - And (PSAT, 0xfffffffc, PSAT) + PSAT &= 0xfffffffc PSAT |= 0 } } diff --git a/src/soc/intel/cannonlake/acpi/scs.asl b/src/soc/intel/cannonlake/acpi/scs.asl index 5e8fb33f75..7def761f75 100644 --- a/src/soc/intel/cannonlake/acpi/scs.asl +++ b/src/soc/intel/cannonlake/acpi/scs.asl @@ -45,7 +45,7 @@ Scope (\_SB.PCI0) { ^^SCSC (PID_EMMC) /* Set Power State to D0 */ - And (PMCR, 0xFFFC, PMCR) + PMCR &= 0xFFFC ^TEMP = PMCR } @@ -209,7 +209,7 @@ Scope (\_SB.PCI0) { ^^SCSC (PID_SDX) /* Set Power State to D0 */ - And (PMCR, 0xFFFC, PMCR) + PMCR &= 0xFFFC ^TEMP = PMCR #if CONFIG(MB_HAS_ACTIVE_HIGH_SD_PWR_ENABLE) diff --git a/src/soc/intel/icelake/acpi/scs.asl b/src/soc/intel/icelake/acpi/scs.asl index 2ec8569e8a..8fbbfaf4a2 100644 --- a/src/soc/intel/icelake/acpi/scs.asl +++ b/src/soc/intel/icelake/acpi/scs.asl @@ -43,7 +43,7 @@ Scope (\_SB.PCI0) { ^^SCSC (PID_EMMC) /* Set Power State to D0 */ - And (PMCR, 0xFFFC, PMCR) + PMCR &= 0xFFFC ^TEMP = PMCR } @@ -96,7 +96,7 @@ Scope (\_SB.PCI0) { ^^SCSC (PID_SDX) /* Set Power State to D0 */ - And (PMCR, 0xFFFC, PMCR) + PMCR &= 0xFFFC ^TEMP = PMCR } diff --git a/src/superio/winbond/w83627hf/acpi/superio.asl b/src/superio/winbond/w83627hf/acpi/superio.asl index b2dffc63b8..051fab5db5 100644 --- a/src/superio/winbond/w83627hf/acpi/superio.asl +++ b/src/superio/winbond/w83627hf/acpi/superio.asl @@ -399,9 +399,9 @@ Device(SIO) { Name (_UID, "w83627hf-pport") Method (MODE, 1) { - And(Arg0, 0x07, Local0) + Local0 = Arg0 & 7 ENTER_CONFIG_MODE (1) - And(OPT1, 0x3, Local1) + Local1 = OPT1 & 3 OPT1 = Local1 | Local0 EXIT_CONFIG_MODE() } @@ -420,7 +420,7 @@ Device(SIO) { { Local0 = 0x00 ENTER_CONFIG_MODE (1) - And(OPT1, 0x3, Local1) + Local1 = OPT1 & 3 If (ACTR) { If (Local1 != 2) { Local0 = 0x0D @@ -488,8 +488,8 @@ Device(SIO) { IOR0 = Local1 /* Set align and length based on active parallel port mode */ - And(Local2, 0x3, Local3) - And(Local2, 0x4, Local4) + Local3 = Local2 & 3 + Local4 = Local2 & 4 If (Local4) { IOAL = 0x04 } @@ -578,7 +578,7 @@ Device(SIO) { IO1H = Local1 /* Mode */ Local3 = OPT1 - And (Local3, 0xF8, Local3) + Local3 &= 0xF8 OPT1 = Local2 | Local3 /* DMA off */ DMA0 = 0x04 @@ -1347,7 +1347,7 @@ Device(SIO) { { ENTER_CONFIG_MODE (9) Local0 = OPT4 - And(Local0, 63, Local0) + Local0 &= 63 OPT4 = Local0 | (And(Arg0, 0x03) << 6) EXIT_CONFIG_MODE () } @@ -1357,7 +1357,7 @@ Device(SIO) { { ENTER_CONFIG_MODE (8) Local0 = OPT4 - And(Local0, 63, Local0) + Local0 &= 63 OPT4 = Local0 | (And(Arg0, 0x03) << 6) EXIT_CONFIG_MODE () } diff --git a/src/superio/winbond/w83667hg-a/ps2_controller.asl b/src/superio/winbond/w83667hg-a/ps2_controller.asl index ef9a01fe96..139a68643a 100644 --- a/src/superio/winbond/w83667hg-a/ps2_controller.asl +++ b/src/superio/winbond/w83667hg-a/ps2_controller.asl @@ -49,7 +49,7 @@ SIOI = 0x87 /* Read Pin56 function select */ - And(CR2A, 0x2, Local0) + Local0 = CR2A & 2 /* Restore default SuperIO access */ SIOI = 0xAA |