Duncan Laurie has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44036 )
Change subject: sconfig: Add function for parse+override of tree ......................................................................
sconfig: Add function for parse+override of tree
Extract the steps to parse and override a devicetree into a function so it can be used multiple times without copying the same logic.
Change-Id: I4e496a223757beb22e3bd678eb6115968bd32529 Signed-off-by: Duncan Laurie dlaurie@google.com --- M util/sconfig/main.c 1 file changed, 14 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/44036/1
diff --git a/util/sconfig/main.c b/util/sconfig/main.c index 66f9cbf..251aa3f 100644 --- a/util/sconfig/main.c +++ b/util/sconfig/main.c @@ -1666,6 +1666,18 @@ } }
+static void parse_override_devicetree(const char *file, struct device *dev) +{ + parse_devicetree(file, dev->bus); + + if (!dev_has_children(dev)) { + fprintf(stderr, "ERROR: Override tree needs at least one device!\n"); + exit(1); + } + + override_devicetree(&base_root_bus, dev->bus); +} + int main(int argc, char **argv) { static const struct option long_options[] = { @@ -1708,16 +1720,8 @@
parse_devicetree(base_devtree, &base_root_bus);
- if (override_devtree) { - parse_devicetree(override_devtree, &override_root_bus); - - if (!dev_has_children(&override_root_dev)) { - fprintf(stderr, "ERROR: Override tree needs at least one device!\n"); - exit(1); - } - - override_devicetree(&base_root_bus, &override_root_bus); - } + if (override_devtree) + parse_override_devicetree(override_devtree, &override_root_dev);
FILE *autogen = fopen(outputc, "w"); if (!autogen) {
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44036 )
Change subject: sconfig: Add function for parse+override of tree ......................................................................
Patch Set 1: Code-Review+2
Tim Wawrzynczak has uploaded a new patch set (#4) to the change originally created by Duncan Laurie. ( https://review.coreboot.org/c/coreboot/+/44036 )
Change subject: sconfig: Add function for parse+override of tree ......................................................................
sconfig: Add function for parse+override of tree
Extract the steps to parse and override a devicetree into a function so it can be used multiple times without copying the same logic.
Change-Id: I4e496a223757beb22e3bd678eb6115968bd32529 Signed-off-by: Duncan Laurie dlaurie@google.com --- M util/sconfig/main.c 1 file changed, 18 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/44036/4
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44036 )
Change subject: sconfig: Add function for parse+override of tree ......................................................................
Patch Set 5: Code-Review+2
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44036 )
Change subject: sconfig: Add function for parse+override of tree ......................................................................
Patch Set 5:
This doesn't pick cleanly for me onto chromium coreboot.
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44036 )
Change subject: sconfig: Add function for parse+override of tree ......................................................................
Patch Set 5: Code-Review+2
Tim Wawrzynczak has submitted this change. ( https://review.coreboot.org/c/coreboot/+/44036 )
Change subject: sconfig: Add function for parse+override of tree ......................................................................
sconfig: Add function for parse+override of tree
Extract the steps to parse and override a devicetree into a function so it can be used multiple times without copying the same logic.
Change-Id: I4e496a223757beb22e3bd678eb6115968bd32529 Signed-off-by: Duncan Laurie dlaurie@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/44036 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: Nick Vaccaro nvaccaro@google.com --- M util/sconfig/main.c 1 file changed, 14 insertions(+), 10 deletions(-)
Approvals: build bot (Jenkins): Verified Nick Vaccaro: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/util/sconfig/main.c b/util/sconfig/main.c index f561806..dbb266b 100644 --- a/util/sconfig/main.c +++ b/util/sconfig/main.c @@ -1666,6 +1666,18 @@ } }
+static void parse_override_devicetree(const char *file, struct device *dev) +{ + parse_devicetree(file, dev->bus); + + if (!dev_has_children(dev)) { + fprintf(stderr, "ERROR: Override tree needs at least one device!\n"); + exit(1); + } + + override_devicetree(&base_root_bus, dev->bus); +} + int main(int argc, char **argv) { static const struct option long_options[] = { @@ -1708,16 +1720,8 @@
parse_devicetree(base_devtree, &base_root_bus);
- if (override_devtree) { - parse_devicetree(override_devtree, &override_root_bus); - - if (!dev_has_children(&override_root_dev)) { - fprintf(stderr, "ERROR: Override tree needs at least one device!\n"); - exit(1); - } - - override_devicetree(&base_root_bus, &override_root_bus); - } + if (override_devtree) + parse_override_devicetree(override_devtree, &override_root_dev);
FILE *autogen = fopen(outputc, "w"); if (!autogen) {
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/44036 )
Change subject: sconfig: Add function for parse+override of tree ......................................................................
Patch Set 6:
Automatic boot test returned (PASS/FAIL/TOTAL): 8/1/9 "QEMU x86 q35/ich9" (x86_32) using payload TianoCore : SUCCESS : https://lava.9esec.io/r/20019 "QEMU x86 q35/ich9" (x86_32) using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/20018 "QEMU x86 i440fx/piix4" (x86_64) using payload SeaBIOS : FAIL : https://lava.9esec.io/r/20017 "QEMU x86 i440fx/piix4" (x86_32) using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/20016 "QEMU AArch64" using payload LinuxBoot_u-root_kexec : SUCCESS : https://lava.9esec.io/r/20015 "HP Z220 SFF Workstation" (x86_32) using payload LinuxBoot_BusyBox_kexec : SUCCESS : https://lava.9esec.io/r/20023 "HP Z220 SFF Workstation" (x86_32) using payload LinuxBoot_BusyBox_kexec : SUCCESS : https://lava.9esec.io/r/20022 "HP Compaq 8200 Elite SFF PC" (x86_32) using payload TianoCore : SUCCESS : https://lava.9esec.io/r/20021 "HP Compaq 8200 Elite SFF PC" (x86_32) using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/20020
Please note: This test is under development and might not be accurate at all!