From 8f625f6e9361e06da7017593df841fc69d5d68df Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Wed, 5 May 2010 13:13:47 +0000 Subject: 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 Acked-by: Stefan Reinauer Acked-by: Peter Stuge git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5526 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/sconfig/sconfig.y | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'util/sconfig/sconfig.y') 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 */ { $$ = new_chip(cur_parent, cur_bus, $2); cur_parent = $$; } - devices END { + chipchildren END { cur_parent = $3->parent; fold_in($3); add_header($3); @@ -54,7 +52,7 @@ device: DEVICE BUS NUMBER /* == devnum */ BOOL { cur_parent = $$; cur_bus = $$; } - devicesorresources END { + devicechildren END { cur_parent = $5->parent; cur_bus = $5->bus; fold_in($5); -- cgit v1.2.3