+/*
+ * This file is part of the coreboot project.
+ *
+ * It was originally based on the Linux kernel (arch/i386/kernel/pci-pc.c).
+ *
+ * Modifications are:
+ * Copyright (C) 2003 Eric Biederman <ebiederm@xmission.com>
+ * Copyright (C) 2003-2004 Linux Networx
+ * (Written by Eric Biederman <ebiederman@lnxi.com> for Linux Networx)
+ * Copyright (C) 2003 Ronald G. Minnich <rminnich@gmail.com>
+ * Copyright (C) 2004-2005 Li-Ta Lo <ollie@lanl.gov>
+ * Copyright (C) 2005-2006 Tyan
+ * (Written by Yinghai Lu <yhlu@tyan.com> for Tyan)
+ * Copyright (C) 2005-2006 Stefan Reinauer <stepan@openbios.org>
+ */
+
/*
* (c) 1999--2000 Martin Mares <mj@suse.cz>
- * (c) 2003 Eric Biederman <ebiederm@xmission.com>
- * (c) 2003 Linux Networx
*/
/* lots of mods by ron minnich (rminnich@lanl.gov), with
* the final architecture guidance from Tom Merritt (tjm@codegen.com)
}
#if CONFIG_CONSOLE_VGA == 1
-
device_t vga_pri = 0;
static void allocate_vga_resource(void)
{
#warning "This function knows to much about PCI stuff, it should be just a ietrator/visitor."
/* FIXME handle the VGA pallette snooping */
- struct device *dev, *vga, *vga_onboard;
+ struct device *dev, *vga, *vga_onboard, *vga_first, *vga_last;
struct bus *bus;
bus = 0;
vga = 0;
vga_onboard = 0;
+ vga_first = 0;
+ vga_last = 0;
for(dev = all_devices; dev; dev = dev->next) {
if (!dev->enabled) continue;
if (((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) &&
((dev->class >> 8) != PCI_CLASS_DISPLAY_OTHER))
{
- if (!vga) {
- if (dev->on_mainboard) {
- vga_onboard = dev;
- } else {
- vga = dev;
- }
- }
+ if (!vga_first) {
+ if (dev->on_mainboard) {
+ vga_onboard = dev;
+ } else {
+ vga_first = dev;
+ }
+ } else {
+ if (dev->on_mainboard) {
+ vga_onboard = dev;
+ } else {
+ vga_last = dev;
+ }
+ }
+
/* It isn't safe to enable other VGA cards */
dev->command &= ~(PCI_COMMAND_MEMORY | PCI_COMMAND_IO);
}
}
- if (!vga) {
- vga = vga_onboard;
- }
+ vga = vga_last;
+
+ if(!vga) {
+ vga = vga_first;
+ }
+
+#if CONFIG_CONSOLE_VGA_ONBOARD_AT_FIRST == 1
+ if (vga_onboard) // will use on board vga as pri
+#else
+ if (!vga) // will use last add on adapter as pri
+#endif
+ {
+ vga = vga_onboard;
+ }
+
if (vga) {
/* vga is first add on card or the only onboard vga */
bus = (bus == bus->dev->bus)? 0 : bus->dev->bus;
}
}
+
#endif
*/
int reset_bus(struct bus *bus)
{
- device_t dev;
if (bus && bus->dev && bus->dev->ops && bus->dev->ops->reset_bus)
{
bus->dev->ops->reset_bus(bus);
*/
void dev_enable(void)
{
- printk_info("Enabling resourcess...\n");
+ printk_info("Enabling resources...\n");
/* now enable everything. */
enable_resources(&dev_root);