summaryrefslogtreecommitdiff
path: root/src/mainboard/google
diff options
context:
space:
mode:
authorTarun Tuli <taruntuli@google.com>2023-03-30 12:46:38 +0000
committerFelix Held <felix-coreboot@felixheld.de>2023-04-13 13:34:32 +0000
commitf7b23c80e4b5975d1beecbe0b39380cde5dd2ab2 (patch)
tree89dd1d69dcb8bfadaeafab7eeef6ad7a850681af /src/mainboard/google
parent64e540a7d87de78e05ff50191b4265ae811fcb19 (diff)
mb/google/brya/acpi: LTOB - Add support for a 8 byte integer to buffer
This function adds support to convert a integer into a 8 byte buffer TEST=verified returned buffer is as expected using acpiexec BUG=b:271938907 Signed-off-by: Tarun Tuli <taruntuli@google.com> Change-Id: I89eb50f1452657c26b97eb5609ed956fa8ee8117 Reviewed-on: https://review.coreboot.org/c/coreboot/+/73898 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r--src/mainboard/google/brya/acpi/utility.asl15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mainboard/google/brya/acpi/utility.asl b/src/mainboard/google/brya/acpi/utility.asl
index 9cdfb49c41..49f3dca8e9 100644
--- a/src/mainboard/google/brya/acpi/utility.asl
+++ b/src/mainboard/google/brya/acpi/utility.asl
@@ -37,3 +37,18 @@ Method (ITOB, 1)
Local0[3] = (Arg0 >> 24) & 0xFF
Return (Local0)
}
+
+/* Convert from 64-bit integer to 8-byte buffer (little-endian) */
+Method (LTOB, 1)
+{
+ Local0 = Buffer(8) { 0, 0, 0, 0, 0, 0, 0, 0 }
+ Local0[0] = Arg0 & 0xFF
+ Local0[1] = (Arg0 >> 8) & 0xFF
+ Local0[2] = (Arg0 >> 16) & 0xFF
+ Local0[3] = (Arg0 >> 24) & 0xFF
+ Local0[4] = (Arg0 >> 32) & 0xFF
+ Local0[5] = (Arg0 >> 40) & 0xFF
+ Local0[6] = (Arg0 >> 48) & 0xFF
+ Local0[7] = (Arg0 >> 56) & 0xFF
+ Return (Local0)
+}