+/*
+ * This file is part of the LinuxBIOS project.
+ *
+ * Copyright (C) 2005 Li-Ta Lo <ollie@lanl.gov>
+ * Copyright (C) 2005 Tyan
+ * (Written by Yinghai Lu <yhlu@tyan.com> for Tyan)
+ * Copyright (C) 2005 Ronald G. Minnich <rminnich@gmail.com>
+ * Copyright (C) 2005-2007 Stefan Reinauer <stepan@openbios.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
static void *pci_ram_image_start = (void *)PCI_RAM_IMAGE_START;
-#if CONFIG_CONSOLE_VGA == 1
-extern int vga_inited; // defined in vga_console.c
-#if CONFIG_CONSOLE_VGA_MULTI == 0
-extern device_t vga_pri; // the primary vga device, defined in device.c
-#endif
-#endif
-
struct rom_header *pci_rom_load(struct device *dev, struct rom_header *rom_header)
{
struct pci_data * rom_data;
rom_size = rom_header->size * 512;
if (PCI_CLASS_DISPLAY_VGA == rom_data->class_hi) {
-#if CONFIG_CONSOLE_VGA == 1
- #if CONFIG_CONSOLE_VGA_MULTI == 0
+#if CONFIG_CONSOLE_VGA == 1 && CONFIG_CONSOLE_VGA_MULTI == 0
+ extern device_t vga_pri; // the primary vga device, defined in device.c
if (dev != vga_pri) return NULL; // only one VGA supported
- #endif
- printk_debug("copying VGA ROM Image from %x to %x, %x bytes\n",
+#endif
+ printk_debug("copying VGA ROM Image from 0x%x to 0x%x, 0x%x bytes\n",
rom_header, PCI_VGA_RAM_IMAGE_START, rom_size);
memcpy(PCI_VGA_RAM_IMAGE_START, rom_header, rom_size);
- vga_inited = 1;
return (struct rom_header *) (PCI_VGA_RAM_IMAGE_START);
-#endif
} else {
- printk_debug("copying non-VGA ROM Image from %x to %x, %x bytes\n",
+ printk_debug("copying non-VGA ROM Image from 0x%x to 0x%x, 0x%x bytes\n",
rom_header, pci_ram_image_start, rom_size);
memcpy(pci_ram_image_start, rom_header, rom_size);
pci_ram_image_start += rom_size;