mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
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 <rminnich@gmail.com> Acked-by: Myles Watson <mylesgw@gmail.com> git-svn-id: svn://coreboot.org/repository/coreboot-v3@961 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
32139165ec
commit
3eec9e7790
6 changed files with 16 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 <mainboard.h>
|
||||
#include <config.h>
|
||||
#include <types.h>
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue