Set PCI bus operations at buildtime for ramstage

PCI bus operations are static through the ramstage, and should be
initialized from the very beginning. For all the replaced instances,
there is no MMCONF_SUPPORT nor MMCONF_SUPPORT_DEFAULT selected for
the northbridge, so these continue to use PCI IO config access.

Change-Id: I658abd4a02aa70ad4c9273568eb5560c6e572fb1
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/3607
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Kyösti Mälkki 2013-07-03 10:51:34 +03:00 committed by Stefan Reinauer
parent 52914323bf
commit 33e5df3f25
25 changed files with 24 additions and 28 deletions

View File

@ -22,8 +22,4 @@ static inline const struct pci_bus_operations *pci_config_default(void)
#endif #endif
} }
static inline void pci_set_method(device_t dev)
{
dev->ops->ops_pci_bus = pci_config_default();
}
#endif /* ARCH_I386_PCI_OPS_H */ #endif /* ARCH_I386_PCI_OPS_H */

View File

@ -161,6 +161,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = 0, //enable_resources, .enable_resources = 0, //enable_resources,
.init = 0, .init = 0,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
}; };
#if 0 #if 0
@ -188,7 +189,6 @@ static void enable_dev(struct device *dev)
/* Set the operations if it is a special bus type */ /* Set the operations if it is a special bus type */
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} }
#if 0 #if 0
/* This is never hit as none of the sc520 boards have /* This is never hit as none of the sc520 boards have

View File

@ -136,6 +136,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
#if CONFIG_GENERATE_SMBIOS_TABLES #if CONFIG_GENERATE_SMBIOS_TABLES
.get_smbios_data = qemu_get_smbios_data, .get_smbios_data = qemu_get_smbios_data,
#endif #endif
@ -186,7 +187,6 @@ static void northbridge_enable(struct device *dev)
/* Set the operations if it is a special bus type */ /* Set the operations if it is a special bus type */
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} }
else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
dev->ops = &cpu_bus_ops; dev->ops = &cpu_bus_ops;

View File

@ -1135,7 +1135,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = amdk8_domain_scan_bus, .scan_bus = amdk8_domain_scan_bus,
.ops_pci_bus = &pci_cf8_conf1, .ops_pci_bus = pci_bus_default_ops,
}; };
static void add_more_links(device_t dev, unsigned total_links) static void add_more_links(device_t dev, unsigned total_links)

View File

@ -125,6 +125,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)
@ -152,7 +153,6 @@ static void enable_dev(struct device *dev)
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
printk(BIOS_SPEW, "DEVICE_PATH_DOMAIN\n"); printk(BIOS_SPEW, "DEVICE_PATH_DOMAIN\n");
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} }
else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
printk(BIOS_SPEW, "DEVICE_PATH_CPU_CLUSTER\n"); printk(BIOS_SPEW, "DEVICE_PATH_CPU_CLUSTER\n");

View File

@ -309,7 +309,6 @@ static void pci_domain_enable(device_t dev)
print_conf(); print_conf();
do_vsmbios(); do_vsmbios();
graphics_init(); graphics_init();
pci_set_method(dev);
} }
static struct device_operations pci_domain_ops = { static struct device_operations pci_domain_ops = {
@ -318,6 +317,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.enable = pci_domain_enable, .enable = pci_domain_enable,
.ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)

View File

@ -413,7 +413,6 @@ static void pci_domain_enable(device_t dev)
// print_conf(); // print_conf();
graphics_init(); graphics_init();
pci_set_method(dev);
} }
static struct device_operations pci_domain_ops = { static struct device_operations pci_domain_ops = {
@ -422,6 +421,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.enable = pci_domain_enable, .enable = pci_domain_enable,
.ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)

View File

@ -121,6 +121,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
}; };
static void enable_dev(struct device *dev) static void enable_dev(struct device *dev)
@ -130,7 +131,6 @@ static void enable_dev(struct device *dev)
/* Set the operations if it is a special bus type */ /* Set the operations if it is a special bus type */
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} }
} }

View File

@ -97,7 +97,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = &pci_cf8_conf1, .ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)

View File

@ -109,7 +109,7 @@ static struct device_operations pci_domain_ops = {
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci = &intel_pci_ops, .ops_pci = &intel_pci_ops,
.ops_pci_bus = &pci_cf8_conf1, .ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)

View File

@ -121,7 +121,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = e7520_domain_scan_bus, .scan_bus = e7520_domain_scan_bus,
.ops_pci_bus = &pci_cf8_conf1, /* Do we want to use the memory mapped space here? */ .ops_pci_bus = pci_bus_default_ops,
}; };
static void mc_read_resources(device_t dev) static void mc_read_resources(device_t dev)

View File

@ -120,7 +120,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = e7525_domain_scan_bus, .scan_bus = e7525_domain_scan_bus,
.ops_pci_bus = &pci_cf8_conf1, /* Do we want to use the memory mapped space here? */ .ops_pci_bus = pci_bus_default_ops,
}; };
static void mc_read_resources(device_t dev) static void mc_read_resources(device_t dev)

View File

@ -145,7 +145,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = i3100_domain_scan_bus, .scan_bus = i3100_domain_scan_bus,
.ops_pci_bus = &pci_cf8_conf1, /* Do we want to use the memory mapped space here? */ .ops_pci_bus = pci_bus_default_ops,
}; };
static void mc_read_resources(device_t dev) static void mc_read_resources(device_t dev)

View File

@ -80,6 +80,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)
@ -104,7 +105,6 @@ static void enable_dev(struct device *dev)
/* Set the operations if it is a special bus type */ /* Set the operations if it is a special bus type */
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} }
else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
dev->ops = &cpu_bus_ops; dev->ops = &cpu_bus_ops;

View File

@ -106,6 +106,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)
@ -130,7 +131,6 @@ static void enable_dev(struct device *dev)
/* Set the operations if it is a special bus type */ /* Set the operations if it is a special bus type */
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} }
else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
dev->ops = &cpu_bus_ops; dev->ops = &cpu_bus_ops;

View File

@ -134,6 +134,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)
@ -158,7 +159,6 @@ static void enable_dev(struct device *dev)
/* Set the operations if it is a special bus type */ /* Set the operations if it is a special bus type */
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
dev->ops = &cpu_bus_ops; dev->ops = &cpu_bus_ops;
} }

View File

@ -101,6 +101,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)
@ -127,7 +128,6 @@ static void enable_dev(struct device *dev)
/* Set the operations if it is a special bus type. */ /* Set the operations if it is a special bus type. */
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
dev->ops = &cpu_bus_ops; dev->ops = &cpu_bus_ops;
} }

View File

@ -118,6 +118,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)
@ -142,7 +143,6 @@ static void enable_dev(struct device *dev)
/* Set the operations if it is a special bus type */ /* Set the operations if it is a special bus type */
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} }
else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
dev->ops = &cpu_bus_ops; dev->ops = &cpu_bus_ops;

View File

@ -108,6 +108,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
#if CONFIG_GENERATE_SMBIOS_TABLES #if CONFIG_GENERATE_SMBIOS_TABLES
.get_smbios_data = rdc_get_smbios_data, .get_smbios_data = rdc_get_smbios_data,
#endif #endif
@ -118,7 +119,6 @@ static void enable_dev(struct device *dev)
/* Set the operations if it is a special bus type */ /* Set the operations if it is a special bus type */
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} }
} }

View File

@ -236,6 +236,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = cn400_domain_scan_bus, .scan_bus = cn400_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)
@ -262,7 +263,6 @@ static void enable_dev(struct device *dev)
/* Set the operations if it is a special bus type. */ /* Set the operations if it is a special bus type. */
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
dev->ops = &cpu_bus_ops; dev->ops = &cpu_bus_ops;
} }

View File

@ -156,6 +156,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)
@ -182,7 +183,6 @@ static void enable_dev(struct device *dev)
/* Set the operations if it is a special bus type. */ /* Set the operations if it is a special bus type. */
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
dev->ops = &cpu_bus_ops; dev->ops = &cpu_bus_ops;
} }

View File

@ -88,6 +88,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)
@ -112,7 +113,6 @@ static void enable_dev(struct device *dev)
/* Our wonderful device model */ /* Our wonderful device model */
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
dev->ops = &cpu_bus_ops; dev->ops = &cpu_bus_ops;
} }

View File

@ -102,6 +102,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)
@ -126,7 +127,6 @@ static void enable_dev(struct device *dev)
/* Set the operations if it is a special bus type */ /* Set the operations if it is a special bus type */
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} }
else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
dev->ops = &cpu_bus_ops; dev->ops = &cpu_bus_ops;

View File

@ -162,6 +162,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)
@ -188,7 +189,6 @@ static void enable_dev(struct device *dev)
/* Set the operations if it is a special bus type */ /* Set the operations if it is a special bus type */
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} }
else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
dev->ops = &cpu_bus_ops; dev->ops = &cpu_bus_ops;

View File

@ -139,6 +139,7 @@ static struct device_operations pci_domain_ops = {
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,
.ops_pci_bus = pci_bus_default_ops,
}; };
static void cpu_bus_init(device_t dev) static void cpu_bus_init(device_t dev)
@ -165,7 +166,6 @@ static void enable_dev(struct device *dev)
/* Set the operations if it is a special bus type */ /* Set the operations if it is a special bus type */
if (dev->path.type == DEVICE_PATH_DOMAIN) { if (dev->path.type == DEVICE_PATH_DOMAIN) {
dev->ops = &pci_domain_ops; dev->ops = &pci_domain_ops;
pci_set_method(dev);
} else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
dev->ops = &cpu_bus_ops; dev->ops = &cpu_bus_ops;
} }