2 /* sconfig, coreboot device tree compiler */
3 /* SPDX-License-Identifier: GPL-2.0-only */
5 #include "sconfig.tab.h"
15 device {return(DEVICE);}
16 alias {return(ALIAS);}
18 use {return(REFERENCE);}
19 ref {return(REFERENCE);}
20 as {return(ASSOCIATION);}
21 register {return(REGISTER);}
22 fw_config {return(FW_CONFIG_TABLE);}
23 field {return(FW_CONFIG_FIELD);}
24 option {return(FW_CONFIG_OPTION);}
25 probe {return(FW_CONFIG_PROBE);}
26 unprovisioned {return(FW_CONFIG_UNPROVISIONED);}
27 on {yylval.number=1; return(BOOL);}
28 off {yylval.number=0; return(BOOL);}
29 hidden {yylval.number=3; return(STATUS);}
30 mandatory {yylval.number=5; return(STATUS);}
31 pci {yylval.number=PCI; return(BUS);}
32 pnp {yylval.number=PNP; return(BUS);}
33 i2c {yylval.number=I2C; return(BUS);}
34 cpu_cluster {yylval.number=CPU_CLUSTER; return(BUS);}
35 cpu {yylval.number=CPU; return(BUS);}
36 domain {yylval.number=DOMAIN; return(BUS);}
37 generic {yylval.number=GENERIC; return(BUS);}
38 mmio {yylval.number=MMIO; return(BUS);}
39 spi {yylval.number=SPI; return(BUS);}
40 usb {yylval.number=USB; return(BUS);}
41 gpio {yylval.number=GPIO; return(BUS);}
42 mdio {yylval.number=MDIO; return(BUS);}
43 irq {yylval.number=IRQ; return(RESOURCE);}
44 drq {yylval.number=DRQ; return(RESOURCE);}
45 io {yylval.number=IO; return(RESOURCE);}
46 inherit {return(INHERIT);}
47 subsystemid {return(SUBSYSTEMID);}
49 smbios_slot_desc {return(SLOT_DESC);}
50 smbios_dev_info {return(SMBIOS_DEV_INFO);}
53 0x[0-9a-fA-F.]+ {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
54 [0-9.]+ {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
55 [0-9a-fA-F.]+ {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(NUMBER);}
56 \"\"[^\"]+\"\" {yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
57 \"[^\"]+\" {yylval.string = malloc(yyleng-1); strncpy(yylval.string, yytext+1, yyleng-2); yylval.string[yyleng-2]='\0'; return(STRING);}
58 [^ \n\t]+ {yylval.string = malloc(yyleng+1); strncpy(yylval.string, yytext, yyleng); yylval.string[yyleng]='\0'; return(STRING);}