From 3eec9e77909bbabde2e63b0e9e4712d41e83f941 Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Wed, 29 Oct 2008 04:25:32 +0000 Subject: [PATCH] General cleanup and comments for things that should be fixed in future. Most substantive change is getting rid of 'initialized', which was only ever needed in v2 due to an implementation mistake. With Uwe's comments taken into account, Signed-off-by: Ronald G. Minnich Acked-by: Myles Watson git-svn-id: svn://coreboot.org/repository/coreboot-v3@961 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- device/device.c | 9 ++++----- device/device_util.c | 5 +---- include/device/device.h | 1 - mainboard/amd/dbm690t/mainboard.c | 5 +++++ mainboard/emulation/qemu-x86/vga.c | 2 ++ southbridge/intel/i82371eb/i82371eb.c | 4 ++++ 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/device/device.c b/device/device.c index 728d3d6d26..15e19fb885 100644 --- a/device/device.c +++ b/device/device.c @@ -805,6 +805,7 @@ unsigned int dev_phase3_scan(struct device *busdevice, unsigned int max) #warning do we call phase3_enable here. new_max = busdevice->ops->phase3_scan(busdevice, max); do_phase3 = 0; + /* do we *ever* use this path */ for (link = 0; link < busdevice->links; link++) { if (busdevice->link[link].reset_needed) { if (reset_bus(&busdevice->link[link])) { @@ -973,15 +974,13 @@ void dev_phase6(void) printk(BIOS_INFO, "Phase 6: Initializing devices...\n"); for (dev = all_devices; dev; dev = dev->next) { - if (dev->enabled && !dev->initialized && - dev->ops && dev->ops->phase6_init) { + if (dev->enabled && dev->ops && dev->ops->phase6_init) { if (dev->path.type == DEVICE_PATH_I2C) { printk(BIOS_DEBUG, "Phase 6: smbus: %s[%d]->", dev_path(dev->bus->dev), dev->bus->link); } printk(BIOS_DEBUG, "Phase 6: %s init.\n", dev_path(dev)); - dev->initialized = 1; dev->ops->phase6_init(dev); } } @@ -995,8 +994,8 @@ void show_all_devs(void) printk(BIOS_INFO, "Show all devs...\n"); for (dev = all_devices; dev; dev = dev->next) { printk(BIOS_SPEW, - "%s(%s): enabled %d have_resources %d initialized %d\n", + "%s(%s): enabled %d have_resources %d\n", dev->dtsname, dev_path(dev), dev->enabled, - dev->have_resources, dev->initialized); + dev->have_resources); } } diff --git a/device/device_util.c b/device/device_util.c index 406886a031..cbc0855acc 100644 --- a/device/device_util.c +++ b/device/device_util.c @@ -430,10 +430,7 @@ void compact_resources(struct device *dev) for (i = 0; i < dev->resources;) { resource = &dev->resource[i]; if (!resource->flags) { - /* Note: memmove() was used here. But this can never - * overlap, right? - */ - memcpy(resource, resource + 1, (dev->resources-i)* sizeof(*resource)); + memmove(resource, resource + 1, (dev->resources-i)* sizeof(*resource)); dev->resources -= 1; memset(&dev->resource[dev->resources], 0, sizeof(*resource)); diff --git a/include/device/device.h b/include/device/device.h index 392f4ba274..a71dda6a37 100644 --- a/include/device/device.h +++ b/include/device/device.h @@ -214,7 +214,6 @@ struct device { unsigned int class; /* 3 bytes: (base,sub,prog-if) */ unsigned int hdr_type; /* PCI header type */ unsigned int enabled : 1; /* set if we should enable the device */ - unsigned int initialized : 1; /* set if we have initialized the device */ unsigned int have_resources : 1; /* Set if we have read the devices resources */ unsigned int on_mainboard : 1; unsigned long rom_address; diff --git a/mainboard/amd/dbm690t/mainboard.c b/mainboard/amd/dbm690t/mainboard.c index ecda109deb..f604d73982 100644 --- a/mainboard/amd/dbm690t/mainboard.c +++ b/mainboard/amd/dbm690t/mainboard.c @@ -17,6 +17,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/* N.B. This file should be removed in the long term. */ +/* the nic code goes to the south support. The UMA code should + * be moved to the cpu support. + */ + #include #include #include diff --git a/mainboard/emulation/qemu-x86/vga.c b/mainboard/emulation/qemu-x86/vga.c index d233a1e0b8..4892d69a7c 100644 --- a/mainboard/emulation/qemu-x86/vga.c +++ b/mainboard/emulation/qemu-x86/vga.c @@ -38,6 +38,8 @@ static void setup_onboard(struct device *dev) /* * FIXME: This should be in the Super I/O code some day, * but since QEMU has no Super I/O... + * we need to create superio/emulation/qemu and move the keyboard + * bits there. */ init_pc_keyboard(0x60, 0x64, &conf); /* now run the rom */ diff --git a/southbridge/intel/i82371eb/i82371eb.c b/southbridge/intel/i82371eb/i82371eb.c index fde4f03faf..f9cdecb75b 100644 --- a/southbridge/intel/i82371eb/i82371eb.c +++ b/southbridge/intel/i82371eb/i82371eb.c @@ -43,6 +43,7 @@ static void i82371eb_ide_init(struct device *dev) { unsigned short c; + /* These should be controlled in the dts. */ printk(BIOS_DEBUG, "Enabling IDE channel 1\n"); c = pci_read_config16(dev, 0x40); c |= 0x8000; @@ -82,6 +83,9 @@ static void i82371eb_acpi_init(struct device *dev) pci_write_config8(dev, 0x80, 1); } +/*NOTE: We need our own read and set resources for this part! It has + * BARS that are not in the normal place (such as SMBUS) + */ /* You can override or extend each operation as needed for the device. */ struct device_operations i82371eb_isa = { .id = {.type = DEVICE_ID_PCI,