[coreboot-gerrit] Patch set updated for coreboot: c8d0329 acpigen: Add acpigen_emit_eisaid.

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Sun Feb 16 01:06:01 CET 2014


Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5240

-gerrit

commit c8d03295f82cf6bee892c3ee6c252e2bdacb46a8
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Sat Feb 15 18:59:40 2014 +0100

    acpigen: Add acpigen_emit_eisaid.
    
    Change-Id: Ib92142a133445018cd152dabe299792ba5f36548
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 src/arch/x86/boot/acpigen.c         | 28 ++++++++++++++++++++++++++++
 src/arch/x86/include/arch/acpigen.h |  1 +
 2 files changed, 29 insertions(+)

diff --git a/src/arch/x86/boot/acpigen.c b/src/arch/x86/boot/acpigen.c
index 6496d75..affc1b8 100644
--- a/src/arch/x86/boot/acpigen.c
+++ b/src/arch/x86/boot/acpigen.c
@@ -739,3 +739,31 @@ int acpigen_write_mainboard_resources(const char *scope, const char *name)
 	acpigen_patch_len(len - 1);
 	return len;
 }
+
+static int hex2bin(char c)
+{
+	if (c >= 'A' && c <= 'F')
+		return c - 'A' + 10;
+	if (c >= 'a' && c <= 'f')
+		return c - 'a' + 10;
+	return c - '0';
+}
+
+int acpigen_emit_eisaid(const char *eisaid)
+{
+	u32 compact = 0;
+	compact |= (eisaid[0] - 'A' + 1) << 26;
+	compact |= (eisaid[1] - 'A' + 1) << 21;
+	compact |= (eisaid[2] - 'A' + 1) << 16;
+	compact |= hex2bin (eisaid[3]) << 12;
+	compact |= hex2bin (eisaid[4]) << 8;
+	compact |= hex2bin (eisaid[5]) << 4;
+	compact |= hex2bin (eisaid[6]);
+
+	acpigen_emit_byte(0xc);
+	acpigen_emit_byte((compact >> 24) & 0xff);
+	acpigen_emit_byte((compact >> 16) & 0xff);
+	acpigen_emit_byte((compact >> 8) & 0xff);
+	acpigen_emit_byte(compact & 0xff);
+	return 5;
+}
diff --git a/src/arch/x86/include/arch/acpigen.h b/src/arch/x86/include/arch/acpigen.h
index be138ce..9257903 100644
--- a/src/arch/x86/include/arch/acpigen.h
+++ b/src/arch/x86/include/arch/acpigen.h
@@ -62,6 +62,7 @@ int acpigen_write_resourcetemplate_header(void);
 int acpigen_write_resourcetemplate_footer(int len);
 int acpigen_write_mainboard_resource_template(void);
 int acpigen_write_mainboard_resources(const char *scope, const char *name);
+int acpigen_emit_eisaid(const char *eisaid);
 
 int get_cst_entries(acpi_cstate_t **);
 



More information about the coreboot-gerrit mailing list