mb/google/octopus: enable xdci controller
[coreboot.git] / util / sconfig / sconfig.h
blob119d7b5fbf24f59977410eeea1b560976caf3846
1 /*
2 * sconfig, coreboot device tree compiler
4 * Copyright (C) 2010 coresystems GmbH
5 * written by Patrick Georgi <patrick@georgi-clan.de>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
17 #include <stdio.h>
18 #include <stdlib.h>
19 #include <string.h>
20 #include <sys/types.h>
21 #include <sys/stat.h>
22 #include <unistd.h>
23 #include <errno.h>
25 enum devtype { chip, device };
27 struct resource;
28 struct resource {
29 int type;
30 int index;
31 int base;
32 struct resource *next;
35 struct reg;
36 struct reg {
37 char *key;
38 char *value;
39 struct reg *next;
42 struct pci_irq_info {
43 int ioapic_irq_pin;
44 int ioapic_dst_id;
46 struct device;
47 struct device {
48 int id;
49 int enabled;
50 int used;
51 int multidev;
52 int link;
53 int rescnt;
54 int chiph_exists;
55 int subsystem_vendor;
56 int subsystem_device;
57 int inherit_subsystem;
58 char *ops;
59 char *name;
60 char *name_underscore;
61 char *path;
62 int path_a;
63 int path_b;
64 int bustype;
65 struct pci_irq_info pci_irq_info[4];
66 enum devtype type;
67 struct device *parent;
68 struct device *bus;
69 struct device *next;
70 struct device *nextdev;
71 struct device *children;
72 struct device *latestchild;
73 struct device *next_sibling;
74 struct device *sibling;
75 struct device *chip;
76 struct resource *res;
77 struct reg *reg;
80 struct device *head;
82 struct header;
83 struct header {
84 char *name;
85 int chiph_exists;
86 struct header *next;
89 void fold_in(struct device *parent);
91 void postprocess_devtree(void);
92 struct device *new_chip(struct device *parent, struct device *bus, char *path);
93 void add_header(struct device *dev);
94 struct device *new_device(struct device *parent, struct device *busdev,
95 const int bus, const char *devnum, int enabled);
96 void alias_siblings(struct device *d);
97 void add_resource(struct device *dev, int type, int index, int base);
98 void add_register(struct device *dev, char *name, char *val);
99 void add_pci_subsystem_ids(struct device *dev, int vendor, int device,
100 int inherit);
101 void add_ioapic_info(struct device *dev, int apicid, const char *_srcpin,
102 int irqpin);
104 void yyrestart(FILE *input_file);