aboutsummaryrefslogtreecommitdiff
path: root/util/sconfig/main.c
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2018-09-10 10:51:26 +0800
committerPatrick Georgi <pgeorgi@google.com>2018-09-16 08:37:36 +0000
commit936dbe1d064b24bb5f38889d50795e68a2309e62 (patch)
treea36e952beca9a575d9272fd0c2dce1f084d9db7e /util/sconfig/main.c
parentc1dc7932b5ad3fe1f7a67f167b202c9019714466 (diff)
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 <hungte@chromium.org> Reviewed-on: https://review.coreboot.org/28566 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Diffstat (limited to 'util/sconfig/main.c')
-rw-r--r--util/sconfig/main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/sconfig/main.c b/util/sconfig/main.c
index 6c1824a0b1..4ac935e7b1 100644
--- a/util/sconfig/main.c
+++ b/util/sconfig/main.c
@@ -480,7 +480,7 @@ static void set_new_child(struct bus *parent, struct device *child)
struct device *new_device(struct bus *parent,
struct chip_instance *chip_instance,
const int bustype, const char *devnum,
- int enabled)
+ int status)
{
char *tmp;
int path_a;
@@ -511,7 +511,8 @@ struct device *new_device(struct bus *parent,
sprintf(name, "_dev%d", new_d->id);
new_d->name = name;
- new_d->enabled = enabled;
+ new_d->enabled = status & 0x01;
+ new_d->hidden = (status >> 1) & 0x01;
new_d->chip_instance = chip_instance;
chip_instance->ref_count++;
@@ -787,6 +788,7 @@ static void pass1(FILE *fil, struct device *ptr, struct device *next)
fprintf(fil, ptr->path, ptr->path_a, ptr->path_b);
fprintf(fil, "},\n");
fprintf(fil, "\t.enabled = %d,\n", ptr->enabled);
+ fprintf(fil, "\t.hidden = %d,\n", ptr->hidden);
fprintf(fil, "\t.on_mainboard = 1,\n");
if (ptr->subsystem_vendor > 0)
fprintf(fil, "\t.subsystem_vendor = 0x%04x,\n",