mb/google/poppy/variants/nocturne: remove dup'ed dptf_enable
[coreboot.git] / util / sconfig / sconfig.y
blob3e463059c834163548004826fd752a3cbbae4628
1 %{
2 /*
3 * sconfig, coreboot device tree compiler
5 * Copyright (C) 2010 coresystems GmbH
6 * written by Patrick Georgi <patrick@georgi-clan.de>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
18 #include "sconfig.h"
20 int yylex();
21 void yyerror(const char *s);
23 static struct bus *cur_parent;
24 static struct chip_instance *cur_chip_instance;
27 %union {
28 struct device *dev;
29 struct chip_instance *chip_instance;
30 char *string;
31 int number;
34 %token CHIP DEVICE REGISTER BOOL BUS RESOURCE END EQUALS HEX STRING PCI PNP I2C APIC CPU_CLUSTER CPU DOMAIN IRQ DRQ IO NUMBER SUBSYSTEMID INHERIT IOAPIC_IRQ IOAPIC PCIINT GENERIC SPI USB MMIO
36 devtree: { cur_parent = root_parent; } chip;
38 chipchildren: chipchildren device | chipchildren chip | chipchildren registers | /* empty */ ;
40 devicechildren: devicechildren device | devicechildren chip | devicechildren resource | devicechildren subsystemid | devicechildren ioapic_irq | /* empty */ ;
42 chip: CHIP STRING /* == path */ {
43 $<chip_instance>$ = new_chip_instance($<string>2);
44 chip_enqueue_tail(cur_chip_instance);
45 cur_chip_instance = $<chip_instance>$;
47 chipchildren END {
48 cur_chip_instance = chip_dequeue_tail();
51 device: DEVICE BUS NUMBER /* == devnum */ BOOL {
52 $<dev>$ = new_device(cur_parent, cur_chip_instance, $<number>2, $<string>3, $<number>4);
53 cur_parent = $<dev>$->last_bus;
55 devicechildren END {
56 cur_parent = $<dev>5->parent;
59 resource: RESOURCE NUMBER /* == resnum */ EQUALS NUMBER /* == resval */
60 { add_resource(cur_parent, $<number>1, strtol($<string>2, NULL, 0), strtol($<string>4, NULL, 0)); } ;
62 registers: REGISTER STRING /* == regname */ EQUALS STRING /* == regval */
63 { add_register(cur_chip_instance, $<string>2, $<string>4); } ;
65 subsystemid: SUBSYSTEMID NUMBER NUMBER
66 { add_pci_subsystem_ids(cur_parent, strtol($<string>2, NULL, 16), strtol($<string>3, NULL, 16), 0); };
68 subsystemid: SUBSYSTEMID NUMBER NUMBER INHERIT
69 { add_pci_subsystem_ids(cur_parent, strtol($<string>2, NULL, 16), strtol($<string>3, NULL, 16), 1); };
71 ioapic_irq: IOAPIC_IRQ NUMBER PCIINT NUMBER
72 { add_ioapic_info(cur_parent, strtol($<string>2, NULL, 16), $<string>3, strtol($<string>4, NULL, 16)); };