From 4c0290af7e9eb48a749b8ea8d6130b2883a30134 Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Sat, 7 Oct 2006 13:49:58 +0000 Subject: [PATCH] getting the tree back after an error git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@5 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- src/mainboard/emulation/qemu-i386/Makefile | 5 ++ src/mainboard/emulation/qemu-i386/cmos.layout | 74 +++++++++++++++++++ .../emulation/qemu-i386/irq_tables.c | 35 +++++++++ src/mainboard/emulation/qemu-i386/mainboard.c | 11 +++ .../emulation/qemu-i386/setup_before_car.c | 25 +++++++ 5 files changed, 150 insertions(+) create mode 100644 src/mainboard/emulation/qemu-i386/Makefile create mode 100644 src/mainboard/emulation/qemu-i386/cmos.layout create mode 100644 src/mainboard/emulation/qemu-i386/irq_tables.c create mode 100644 src/mainboard/emulation/qemu-i386/mainboard.c create mode 100644 src/mainboard/emulation/qemu-i386/setup_before_car.c diff --git a/src/mainboard/emulation/qemu-i386/Makefile b/src/mainboard/emulation/qemu-i386/Makefile new file mode 100644 index 0000000000..d35d8e083d --- /dev/null +++ b/src/mainboard/emulation/qemu-i386/Makefile @@ -0,0 +1,5 @@ +# +# Makefile for the linux kernel. +# + +obj-y = mainboard.o irq_tables.o setup_before_car.o diff --git a/src/mainboard/emulation/qemu-i386/cmos.layout b/src/mainboard/emulation/qemu-i386/cmos.layout new file mode 100644 index 0000000000..5ba4c032c1 --- /dev/null +++ b/src/mainboard/emulation/qemu-i386/cmos.layout @@ -0,0 +1,74 @@ +entries + +#start-bit length config config-ID name +#0 8 r 0 seconds +#8 8 r 0 alarm_seconds +#16 8 r 0 minutes +#24 8 r 0 alarm_minutes +#32 8 r 0 hours +#40 8 r 0 alarm_hours +#48 8 r 0 day_of_week +#56 8 r 0 day_of_month +#64 8 r 0 month +#72 8 r 0 year +#80 4 r 0 rate_select +#84 3 r 0 REF_Clock +#87 1 r 0 UIP +#88 1 r 0 auto_switch_DST +#89 1 r 0 24_hour_mode +#90 1 r 0 binary_values_enable +#91 1 r 0 square-wave_out_enable +#92 1 r 0 update_finished_enable +#93 1 r 0 alarm_interrupt_enable +#94 1 r 0 periodic_interrupt_enable +#95 1 r 0 disable_clock_updates +#96 288 r 0 temporary_filler +0 384 r 0 reserved_memory +384 1 e 4 boot_option +385 1 e 4 last_boot +386 1 e 1 ECC_memory +388 4 r 0 reboot_bits +392 3 e 5 baud_rate +400 1 e 1 power_on_after_fail +412 4 e 6 debug_level +416 4 e 7 boot_first +420 4 e 7 boot_second +424 4 e 7 boot_third +428 4 h 0 boot_index +432 8 h 0 boot_countdown +1008 16 h 0 check_sum + +enumerations + +#ID value text +1 0 Disable +1 1 Enable +2 0 Enable +2 1 Disable +4 0 Fallback +4 1 Normal +5 0 115200 +5 1 57600 +5 2 38400 +5 3 19200 +5 4 9600 +5 5 4800 +5 6 2400 +5 7 1200 +6 6 Notice +6 7 Info +6 8 Debug +6 9 Spew +7 0 Network +7 1 HDD +7 2 Floppy +7 8 Fallback_Network +7 9 Fallback_HDD +7 10 Fallback_Floppy +#7 3 ROM + +checksums + +checksum 392 1007 1008 + + diff --git a/src/mainboard/emulation/qemu-i386/irq_tables.c b/src/mainboard/emulation/qemu-i386/irq_tables.c new file mode 100644 index 0000000000..d75eaa4639 --- /dev/null +++ b/src/mainboard/emulation/qemu-i386/irq_tables.c @@ -0,0 +1,35 @@ +/* This file was generated by getpir.c, do not modify! + (but if you do, please run checkpir on it to verify) + * Contains the IRQ Routing Table dumped directly from your memory, which BIOS sets up + * + * Documentation at : http://www.microsoft.com/hwdev/busbios/PCIIRQ.HTM +*/ + +#include + +const struct irq_routing_table intel_irq_routing_table = { + PIRQ_SIGNATURE, /* u32 signature */ + PIRQ_VERSION, /* u16 version */ + 32+16*6, /* there can be total 6 devices on the bus */ + 0x00, /* Where the interrupt router lies (bus) */ + (0x01<<3)|0x0, /* Where the interrupt router lies (dev) */ + 0, /* IRQs devoted exclusively to PCI usage */ + 0x8086, /* Vendor */ + 0x7000, /* Device */ + 0, /* Crap (miniport) */ + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* u8 rfu[11] */ + 0x7, /* u8 checksum , this hase to set to some value that would give 0 after the sum of all bytes for this structure (including checksum) */ + { + /* bus, dev|fn, {link, bitmap}, {link, bitmap}, {link, bitmap}, {link, bitmap}, slot, rfu */ + {0x00,(0x01<<3)|0x0, {{0x60, 0xdef8}, {0x61, 0xdef8}, {0x62, 0xdef8}, {0x63, 0x0def8}}, 0x0, 0x0}, + {0x00,(0x02<<3)|0x0, {{0x61, 0xdef8}, {0x62, 0xdef8}, {0x63, 0xdef8}, {0x60, 0x0def8}}, 0x1, 0x0}, + {0x00,(0x03<<3)|0x0, {{0x62, 0xdef8}, {0x63, 0xdef8}, {0x60, 0xdef8}, {0x61, 0x0def8}}, 0x2, 0x0}, + {0x00,(0x04<<3)|0x0, {{0x63, 0xdef8}, {0x60, 0xdef8}, {0x61, 0xdef8}, {0x62, 0x0def8}}, 0x3, 0x0}, + {0x00,(0x05<<3)|0x0, {{0x60, 0xdef8}, {0x61, 0xdef8}, {0x62, 0xdef8}, {0x63, 0x0def8}}, 0x4, 0x0}, + {0x00,(0x06<<3)|0x0, {{0x61, 0xdef8}, {0x62, 0xdef8}, {0x63, 0xdef8}, {0x60, 0x0def8}}, 0x5, 0x0}, + } +}; +unsigned long write_pirq_routing_table(unsigned long addr) +{ + return copy_pirq_routing_table(addr); +} diff --git a/src/mainboard/emulation/qemu-i386/mainboard.c b/src/mainboard/emulation/qemu-i386/mainboard.c new file mode 100644 index 0000000000..485212590e --- /dev/null +++ b/src/mainboard/emulation/qemu-i386/mainboard.c @@ -0,0 +1,11 @@ +#include +#include +#include +#include +#include +#include "dtc.h" + +struct chip_operations mainboard_emulation_qemu_i386_ops = { + CHIP_NAME("qemu mainboard ") +}; + diff --git a/src/mainboard/emulation/qemu-i386/setup_before_car.c b/src/mainboard/emulation/qemu-i386/setup_before_car.c new file mode 100644 index 0000000000..8e03551a10 --- /dev/null +++ b/src/mainboard/emulation/qemu-i386/setup_before_car.c @@ -0,0 +1,25 @@ +#include +#include +#include +#include +#include +#include +#include +#include "option_table.h" + +/* + */ +void udelay(int usecs) +{ + int i; + for(i = 0; i < usecs; i++) + outb(i&0xff, 0x80); +} + +void setup_before_car(void) +{ + outb(5, 0x80); + + uart_init(); + console_init(); +}