summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/devices/Config.lb1
-rw-r--r--src/devices/chip.c11
-rw-r--r--src/include/device/chip.h8
-rw-r--r--src/mainboard/motorola/sandpoint/Config.lb2
-rw-r--r--util/newconfig/config.g14
5 files changed, 26 insertions, 10 deletions
diff --git a/src/devices/Config.lb b/src/devices/Config.lb
index 3dd2ac3935..199c7da46b 100644
--- a/src/devices/Config.lb
+++ b/src/devices/Config.lb
@@ -1,3 +1,4 @@
object device.o
object device_util.o
object pci_device.o
+object chip.o
diff --git a/src/devices/chip.c b/src/devices/chip.c
index d25c92e0d7..e99d731043 100644
--- a/src/devices/chip.c
+++ b/src/devices/chip.c
@@ -10,6 +10,15 @@
void
chip_configure(struct chip *root, enum chip_pass pass)
{
- while (root) {
+ struct chip *c;
+
+ for (c = root; c; c = c->next) {
+ if (root->control && root->control->enable)
+ root->control->enable(root, pass);
+ }
+
+ for (c = root; c; c = c->next) {
+ if (root->children)
+ chip_configure(root->children, pass);
}
}
diff --git a/src/include/device/chip.h b/src/include/device/chip.h
index 8de91a1129..328b64216e 100644
--- a/src/include/device/chip.h
+++ b/src/include/device/chip.h
@@ -6,6 +6,11 @@
*/
/* some of the types of resources chips can control */
+#ifndef CHIP_CONFIGURE
+#define CHIP_CONFIGURE(chip, pass) chip_configure(chip, pass)
+#else
+#define CHIP_CONFIGURE(chip, pass)
+#endif
struct com_ports {
unsigned int enable,baud, base, irq;
@@ -24,6 +29,7 @@ struct lpt_ports {
enum chip_pass {
CHIP_PRE_CONSOLE,
+ CHIP_PRE_PCI,
CHIP_PRE_DEVICE_ENUMERATE,
CHIP_PRE_DEVICE_CONFIGURE,
CHIP_PRE_DEVICE_ENABLE,
@@ -59,5 +65,5 @@ struct chip {
void *chip_info; /* the dreaded "void *" */
};
-extern struct chip *root;
+extern struct chip root;
extern void chip_configure(struct chip *, enum chip_pass);
diff --git a/src/mainboard/motorola/sandpoint/Config.lb b/src/mainboard/motorola/sandpoint/Config.lb
index f5e6c17a50..49e529e37f 100644
--- a/src/mainboard/motorola/sandpoint/Config.lb
+++ b/src/mainboard/motorola/sandpoint/Config.lb
@@ -34,7 +34,7 @@ end
##
southbridge winbond/w83c553 end
superio NSC/pc97307
- register "com1={1} com2={1} floppy=0 lpt=1 keyboard=1 hwmonitor=1"
+ register ".com1={1}, .lpt={0}, .port=SIO_COM1_BASE"
end
##
diff --git a/util/newconfig/config.g b/util/newconfig/config.g
index 3938fd8abe..2e2b04f273 100644
--- a/util/newconfig/config.g
+++ b/util/newconfig/config.g
@@ -580,7 +580,7 @@ class partobj:
if (self.chipconfig):
debug.info(debug.gencode, "gencode: chipconfig(%d)" % self.instance)
file.write("#include \"%s/chip.h\"\n" % self.dir)
- file.write("extern struct superio_control %s_control;\n" % \
+ file.write("extern struct chip_control %s_control;\n" % \
self.flatten_name)
file.write("struct %s_config %s_config_%d" % (\
self.flatten_name ,\
@@ -590,7 +590,7 @@ class partobj:
file.write("\t= {\n")
for i in self.registercode:
file.write( "\t %s" % i)
- file.write("\t}\n")
+ file.write("\t};\n")
else:
file.write(";")
file.write("\n");
@@ -616,7 +616,7 @@ class partobj:
self.flatten_name )
# generate the pointer to the isntance
# of the chip struct
- file.write(" .chip_config = (void *) &%s_config_%d,\n" %\
+ file.write(" .chip_info = (void *) &%s_config_%d,\n" %\
(self.flatten_name, self.instance ))
file.write("};\n")
@@ -1510,7 +1510,7 @@ def writeimagemakefile(image):
file.write("\t$(CC) -c $(CFLAGS) -o $@ $<\n")
#file.write("%s\n" % objrule[2])
- # special rule for chips_target.c
+ # special rule for chip_target.c
file.write("chip_%s.o: chip_%s.c\n" % (target_name, target_name))
file.write("\t$(CC) -c $(CFLAGS) -o $@ $<\n")
@@ -1632,7 +1632,7 @@ def dumptree(part, lvl):
debug.info(debug.dumptree, "DONE DUMPTREE")
def writecode(image):
- filename = os.path.join(img_dir, "chips_%s.c" % target_name)
+ filename = os.path.join(img_dir, "chip_%s.c" % target_name)
print "Creating", filename
file = open(filename, 'w+')
# gen all the forward references
@@ -1642,9 +1642,9 @@ def writecode(image):
file.write("struct chip ")
while (i <= image.numparts()):
if (i):
- file.write("cdev%d "% i)
+ file.write(", dev%d"% i)
else:
- file.write("root ")
+ file.write("root")
i = i + 1
file.write(";\n")
gencode(image.getroot(), file)