#include <x86emu/x86emu.h>
+#include "pcbios/pcibios.h"
+
#define MEM_WB(where, what) wrb(where, what)
#define MEM_WW(where, what) wrw(where, what)
#define MEM_WL(where, what) wrl(where, what)
u32 x_inl(u16 port);
void x_outl(u16 port, u32 val);
+
+// sys.c
+void X86EMU_setMemBase(void *base, size_t size);
+
/* general software interrupt handler */
u32 getIntVect(int num)
{
#include "pcibios.h"
-int pcibios_handler()
+int pcibios_handler(void)
{
- int i, ret = 0;
+ int ret = 0;
struct device *dev = 0;
switch (X86_AX) {
SET_FAILED = 0x88,
BUFFER_TOO_SMALL = 0x89
};
-#endif /* PCI_BIOS_H */
\ No newline at end of file
+
+int pcibios_handler(void);
+
+#endif /* PCI_BIOS_H */
unsigned decode_rm00_address(int rm);
unsigned decode_rm01_address(int rm);
unsigned decode_rm10_address(int rm);
+unsigned decode_rmXX_address(int mod, int rm);
#ifdef __cplusplus
} /* End of "C" linkage for C++ */
void pci_dev_init(struct device *dev)
{
#if CONFIG_PCI_ROM_RUN == 1 || CONFIG_VGA_ROM_RUN == 1
+ void run_bios(struct device * dev, unsigned long addr);
struct rom_header *rom, *ram;
#if CONFIG_PCI_ROM_RUN != 1
if (ram == NULL)
return;
- run_bios(dev, ram);
+ run_bios(dev, (unsigned long)ram);
#if CONFIG_CONSOLE_VGA == 1
/* vga_inited is a trigger of the VGA console code. */
}
post_code(0x25);
- /* Die if any leftover Static devices are are found.
+ /* Die if any left over static devices are are found.
* There's probably a problem in the Config.lb.
*/
if(old_devices) {
for(left = old_devices; left; left = left->sibling) {
printk_err("%s\n", dev_path(left));
}
- die("PCI: Left over static devices. Check your Config.lb\n");
+ printk_warning("PCI: Left over static devices. Check your mainboard Config.lb\n");
}
/* For all children that implement scan_bus (i.e. bridges)
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
+#include <string.h>
struct rom_header * pci_rom_probe(struct device *dev)
{
return NULL;
}
- rom_data = (unsigned char *) rom_header + le32_to_cpu(rom_header->data);
+ rom_data = (struct pci_data *) ((void *)rom_header + le32_to_cpu(rom_header->data));
printk_spew("PCI ROM Image, Vendor %04x, Device %04x,\n",
rom_data->vendor, rom_data->device);
if (dev->vendor != rom_data->vendor || dev->device != rom_data->device) {
rom_address = pci_read_config32(dev, PCI_ROM_ADDRESS);
do {
- rom_header = (unsigned char *) rom_header + image_size; // get next image
- rom_data = (unsigned char *) rom_header + le32_to_cpu(rom_header->data);
+ rom_header = (struct rom_header *)((void *) rom_header + image_size); // get next image
+ rom_data = (struct pci_data *)((void *) rom_header + le32_to_cpu(rom_header->data));
image_size = le32_to_cpu(rom_data->ilen) * 512;
} while ((rom_data->type!=0) && (rom_data->indicator!=0)); // make sure we got x86 version
#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);
+ memcpy((void *)PCI_VGA_RAM_IMAGE_START, rom_header, rom_size);
return (struct rom_header *) (PCI_VGA_RAM_IMAGE_START);
} else {
printk_debug("copying non-VGA ROM Image from 0x%x to 0x%x, 0x%x bytes\n",
/* error... */
return;
}
- printk_debug("PCIEXP: tunning %s\n", dev_path(dev));
+ printk_debug("PCIe: tunning %s\n", dev_path(dev));
#warning "IMPLEMENT PCI EXPRESS TUNING"
}