summaryrefslogtreecommitdiff
path: root/util/sconfig/sconfig.y
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@coresystems.de>2010-05-05 13:13:47 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2010-05-05 13:13:47 +0000
commit8f625f6e9361e06da7017593df841fc69d5d68df (patch)
treee1b8e3bdcabdad4d5ced00fdc0c4482195e6f9ee /util/sconfig/sconfig.y
parent8d313685b094f0ffa020e5707c5857b1a2063d28 (diff)
Improve the sconfig parser:
- The device tree must start with a chip (not a device) - It's more clearly visible at which places chip, device, register and resource can be used. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5526 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/sconfig/sconfig.y')
-rwxr-xr-xutil/sconfig/sconfig.y12
1 files changed, 5 insertions, 7 deletions
diff --git a/util/sconfig/sconfig.y b/util/sconfig/sconfig.y
index 162ce7050d..1c5db2ab5f 100755
--- a/util/sconfig/sconfig.y
+++ b/util/sconfig/sconfig.y
@@ -31,19 +31,17 @@ static struct device *cur_parent, *cur_bus;
}
%token CHIP DEVICE REGISTER BOOL BUS RESOURCE END EQUALS HEX STRING PCI PNP I2C APIC APIC_CLUSTER PCI_DOMAIN IRQ DRQ IO NUMBER
%%
-devtree: { cur_parent = cur_bus = head; } devchip { postprocess_devtree(); } ;
+devtree: { cur_parent = cur_bus = head; } chip { postprocess_devtree(); } ;
-devchip: chip | device ;
+chipchildren: chipchildren device | chipchildren chip | chipchildren registers | /* empty */ ;
-devices: devices devchip | devices registers | ;
-
-devicesorresources: devicesorresources devchip | devicesorresources resource | ;
+devicechildren: devicechildren device | devicechildren chip | devicechildren resource | /* empty */ ;
chip: CHIP STRING /* == path */ {
$<device>$ = new_chip(cur_parent, cur_bus, $<string>2);
cur_parent = $<device>$;
}
- devices END {
+ chipchildren END {
cur_parent = $<device>3->parent;
fold_in($<device>3);
add_header($<device>3);
@@ -54,7 +52,7 @@ device: DEVICE BUS NUMBER /* == devnum */ BOOL {
cur_parent = $<device>$;
cur_bus = $<device>$;
}
- devicesorresources END {
+ devicechildren END {
cur_parent = $<device>5->parent;
cur_bus = $<device>5->bus;
fold_in($<device>5);