diff options
Diffstat (limited to 'util/sconfig/sconfig.y')
-rwxr-xr-x | util/sconfig/sconfig.y | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/util/sconfig/sconfig.y b/util/sconfig/sconfig.y index 57e939d9f0..d441ff812d 100755 --- a/util/sconfig/sconfig.y +++ b/util/sconfig/sconfig.y @@ -19,11 +19,11 @@ static struct fw_config_field *cur_field; int number; } -%token CHIP DEVICE REGISTER BOOL STATUS MANDATORY BUS RESOURCE END EQUALS HEX STRING PCI PNP I2C APIC CPU_CLUSTER CPU DOMAIN IRQ DRQ SLOT_DESC IO NUMBER SUBSYSTEMID INHERIT IOAPIC_IRQ IOAPIC PCIINT GENERIC SPI USB MMIO LPC ESPI FW_CONFIG_TABLE FW_CONFIG_FIELD FW_CONFIG_OPTION FW_CONFIG_PROBE +%token CHIP DEVICE REGISTER ALIAS REFERENCE ASSOCIATION BOOL STATUS MANDATORY BUS RESOURCE END EQUALS HEX STRING PCI PNP I2C APIC CPU_CLUSTER CPU DOMAIN IRQ DRQ SLOT_DESC IO NUMBER SUBSYSTEMID INHERIT IOAPIC_IRQ IOAPIC PCIINT GENERIC SPI USB MMIO LPC ESPI FW_CONFIG_TABLE FW_CONFIG_FIELD FW_CONFIG_OPTION FW_CONFIG_PROBE %% devtree: { cur_parent = root_parent; } | devtree chip | devtree fw_config_table; -chipchildren: chipchildren device | chipchildren chip | chipchildren registers | /* empty */ ; +chipchildren: chipchildren device | chipchildren chip | chipchildren registers | chipchildren reference | /* empty */ ; devicechildren: devicechildren device | devicechildren chip | devicechildren resource | devicechildren subsystemid | devicechildren ioapic_irq | devicechildren smbios_slot_desc | devicechildren registers | devicechildren fw_config_probe | /* empty */ ; @@ -36,12 +36,18 @@ chip: CHIP STRING /* == path */ { cur_chip_instance = chip_dequeue_tail(); }; -device: DEVICE BUS NUMBER /* == devnum */ status { - $<dev>$ = new_device(cur_parent, cur_chip_instance, $<number>2, $<string>3, $<number>4); +device: DEVICE BUS NUMBER /* == devnum */ alias status { + $<dev>$ = new_device(cur_parent, cur_chip_instance, $<number>2, $<string>3, $<string>4, $<number>5); cur_parent = $<dev>$->last_bus; } devicechildren END { - cur_parent = $<dev>5->parent; + cur_parent = $<dev>6->parent; +}; + +alias: /* empty */ { + $<string>$ = NULL; +} | ALIAS STRING { + $<string>$ = $<string>2; }; status: BOOL | STATUS ; @@ -49,6 +55,9 @@ status: BOOL | STATUS ; resource: RESOURCE NUMBER /* == resnum */ EQUALS NUMBER /* == resval */ { add_resource(cur_parent, $<number>1, strtol($<string>2, NULL, 0), strtol($<string>4, NULL, 0)); } ; +reference: REFERENCE STRING /* == alias */ ASSOCIATION STRING /* == field in chip config */ + { add_reference(cur_chip_instance, $<string>4, $<string>2); } ; + registers: REGISTER STRING /* == regname */ EQUALS STRING /* == regval */ { add_register(cur_chip_instance, $<string>2, $<string>4); } ; |