From 936dbe1d064b24bb5f38889d50795e68a2309e62 Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Mon, 10 Sep 2018 10:51:26 +0800 Subject: sconfig: Allow setting device status in device tree For devices supporting both Linux and Windows, we may find some ACPI devices that only need drivers in Linux and should not even be shown in Windows Device Manager UI. The new 'hidden' keyword in device tree 'device' statement allows devices sharing same driver to call acpi_gen_writeSTA with different values. BUG=b:72200466 BRANCH=eve TEST=Builds and boots properly on device eve Change-Id: Iae881a294b122d3a581b456285d2992ab637fb8e Signed-off-by: Hung-Te Lin Reviewed-on: https://review.coreboot.org/28566 Tested-by: build bot (Jenkins) Reviewed-by: Duncan Laurie --- util/sconfig/sconfig.y | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'util/sconfig/sconfig.y') diff --git a/util/sconfig/sconfig.y b/util/sconfig/sconfig.y index 3e463059c8..3a6e9ab8a3 100755 --- a/util/sconfig/sconfig.y +++ b/util/sconfig/sconfig.y @@ -31,7 +31,7 @@ static struct chip_instance *cur_chip_instance; int number; } -%token CHIP DEVICE REGISTER BOOL BUS RESOURCE END EQUALS HEX STRING PCI PNP I2C APIC CPU_CLUSTER CPU DOMAIN IRQ DRQ IO NUMBER SUBSYSTEMID INHERIT IOAPIC_IRQ IOAPIC PCIINT GENERIC SPI USB MMIO +%token CHIP DEVICE REGISTER BOOL HIDDEN BUS RESOURCE END EQUALS HEX STRING PCI PNP I2C APIC CPU_CLUSTER CPU DOMAIN IRQ DRQ IO NUMBER SUBSYSTEMID INHERIT IOAPIC_IRQ IOAPIC PCIINT GENERIC SPI USB MMIO %% devtree: { cur_parent = root_parent; } chip; @@ -48,7 +48,7 @@ chip: CHIP STRING /* == path */ { cur_chip_instance = chip_dequeue_tail(); }; -device: DEVICE BUS NUMBER /* == devnum */ BOOL { +device: DEVICE BUS NUMBER /* == devnum */ status { $$ = new_device(cur_parent, cur_chip_instance, $2, $3, $4); cur_parent = $$->last_bus; } @@ -56,6 +56,8 @@ device: DEVICE BUS NUMBER /* == devnum */ BOOL { cur_parent = $5->parent; }; +status: BOOL | HIDDEN; + resource: RESOURCE NUMBER /* == resnum */ EQUALS NUMBER /* == resval */ { add_resource(cur_parent, $1, strtol($2, NULL, 0), strtol($4, NULL, 0)); } ; -- cgit v1.2.3