summaryrefslogtreecommitdiffstats
path: root/util/x86emu/yabel
diff options
context:
space:
mode:
Diffstat (limited to 'util/x86emu/yabel')
-rw-r--r--util/x86emu/yabel/Config.lb9
-rw-r--r--util/x86emu/yabel/biosemu.c10
-rw-r--r--util/x86emu/yabel/compat/Config.lb1
-rw-r--r--util/x86emu/yabel/compat/functions.c4
-rw-r--r--util/x86emu/yabel/debug.c2
-rw-r--r--util/x86emu/yabel/debug.h4
-rw-r--r--util/x86emu/yabel/device.c14
-rw-r--r--util/x86emu/yabel/device.h7
-rw-r--r--util/x86emu/yabel/interrupt.c9
-rw-r--r--util/x86emu/yabel/io.c26
-rw-r--r--util/x86emu/yabel/mem.c6
-rw-r--r--util/x86emu/yabel/pmm.c4
-rw-r--r--util/x86emu/yabel/vbe.c7
13 files changed, 91 insertions, 12 deletions
diff --git a/util/x86emu/yabel/Config.lb b/util/x86emu/yabel/Config.lb
new file mode 100644
index 000000000000..54f0f6e0fcf7
--- /dev/null
+++ b/util/x86emu/yabel/Config.lb
@@ -0,0 +1,9 @@
+object biosemu.o
+object debug.o
+object device.o
+object interrupt.o
+object io.o
+object mem.o
+object pmm.o
+object vbe.o
+dir compat
diff --git a/util/x86emu/yabel/biosemu.c b/util/x86emu/yabel/biosemu.c
index c188e2baaa10..ca486138ba99 100644
--- a/util/x86emu/yabel/biosemu.c
+++ b/util/x86emu/yabel/biosemu.c
@@ -13,13 +13,19 @@
#include <string.h>
#include <types.h>
+#if !COREBOOT_V2
#include <cpu.h>
+#endif
#include "debug.h"
#include <x86emu/x86emu.h>
#include <x86emu/regs.h>
+#if COREBOOT_V2
+#include "../x86emu/prim_ops.h"
+#else
#include <x86emu/prim_ops.h> // for push_word
+#endif
#include "biosemu.h"
#include "io.h"
@@ -28,7 +34,11 @@
#include "device.h"
#include "pmm.h"
+#if COREBOOT_V2
+#include "compat/rtas.h"
+#else
#include <rtas.h>
+#endif
#include <device/device.h>
diff --git a/util/x86emu/yabel/compat/Config.lb b/util/x86emu/yabel/compat/Config.lb
new file mode 100644
index 000000000000..919526d16b8f
--- /dev/null
+++ b/util/x86emu/yabel/compat/Config.lb
@@ -0,0 +1 @@
+object functions.o
diff --git a/util/x86emu/yabel/compat/functions.c b/util/x86emu/yabel/compat/functions.c
index 64e9d40f09f9..6702dcc76d32 100644
--- a/util/x86emu/yabel/compat/functions.c
+++ b/util/x86emu/yabel/compat/functions.c
@@ -14,8 +14,10 @@
*/
#include <types.h>
-#include <device/device.h>
+#if !COREBOOT_V2
#include <config.h>
+#endif
+#include <device/device.h>
#define VMEM_SIZE 1024 *1024 /* 1 MB */
diff --git a/util/x86emu/yabel/debug.c b/util/x86emu/yabel/debug.c
index 5d7085febeb8..c3768fcc5aa4 100644
--- a/util/x86emu/yabel/debug.c
+++ b/util/x86emu/yabel/debug.c
@@ -10,7 +10,9 @@
* IBM Corporation - initial implementation
*****************************************************************************/
+#if !COREBOOT_V2
#include <cpu.h>
+#endif
#include "debug.h"
diff --git a/util/x86emu/yabel/debug.h b/util/x86emu/yabel/debug.h
index e9317a3ed3da..de44c36b761b 100644
--- a/util/x86emu/yabel/debug.h
+++ b/util/x86emu/yabel/debug.h
@@ -19,7 +19,11 @@ extern u32 debug_flags;
extern void x86emu_dump_xregs(void);
/* printf is not available in coreboot... use printk */
+#if COREBOOT_V2
+#include <console/console.h>
+#else
#include <console.h>
+#endif
/* uurgs... yuck... x86emu/x86emu.h is redefining printk... we include it here
* and use its redefinition of printk
* TODO: FIX!!!! */
diff --git a/util/x86emu/yabel/device.c b/util/x86emu/yabel/device.c
index 602a4dec8792..515531eb0e05 100644
--- a/util/x86emu/yabel/device.c
+++ b/util/x86emu/yabel/device.c
@@ -12,13 +12,17 @@
#include "device.h"
+#if COREBOOT_V2
+#include "compat/rtas.h"
+#else
#include "rtas.h"
+#endif
#include <string.h>
#include "debug.h"
#include <device/device.h>
-#include <device/pci_ops.h>
#include <device/pci.h>
+#include <device/pci_ops.h>
#include <device/resource.h>
/* the device we are working with... */
@@ -47,6 +51,10 @@ biosemu_dev_get_addr_info(void)
struct resource *r;
u8 bus = bios_device.dev->bus->link;
u16 devfn = bios_device.dev->path.pci.devfn;
+
+ bios_device.bus = bus;
+ bios_device.devfn = devfn;
+
DEBUG_PRINTF("bus: %x, devfn: %x\n", bus, devfn);
for (i = 0; i < bios_device.dev->resources; i++) {
r = &bios_device.dev->resource[i];
@@ -388,7 +396,11 @@ biosemu_dev_init(struct device * device)
{
u8 rval = 0;
//init bios_device struct
+#if COREBOOT_V2
+ DEBUG_PRINTF("%s\n", __func__);
+#else
DEBUG_PRINTF("%s(%s)\n", __func__, device->dtsname);
+#endif
memset(&bios_device, 0, sizeof(bios_device));
#ifndef CONFIG_PCI_OPTION_ROM_RUN_YABEL
diff --git a/util/x86emu/yabel/device.h b/util/x86emu/yabel/device.h
index 5fc5c17eb6e7..c8e78db88607 100644
--- a/util/x86emu/yabel/device.h
+++ b/util/x86emu/yabel/device.h
@@ -14,11 +14,16 @@
#define DEVICE_LIB_H
#include <types.h>
+#if COREBOOT_V2
+#include <arch/byteorder.h>
+#include "compat/of.h"
+#else
#include <cpu.h>
+#include <byteorder.h>
#include "of.h"
+#endif
#include "debug.h"
-#include <byteorder.h>
// a Expansion Header Struct as defined in Plug and Play BIOS Spec 1.0a Chapter 3.2
typedef struct {
diff --git a/util/x86emu/yabel/interrupt.c b/util/x86emu/yabel/interrupt.c
index c6e8fccb63b3..39708984f6e4 100644
--- a/util/x86emu/yabel/interrupt.c
+++ b/util/x86emu/yabel/interrupt.c
@@ -10,7 +10,11 @@
* IBM Corporation - initial implementation
*****************************************************************************/
+#if COREBOOT_V2
+#include "compat/rtas.h"
+#else
#include <rtas.h>
+#endif
#include "biosemu.h"
#include "mem.h"
@@ -19,9 +23,14 @@
#include "pmm.h"
#include <x86emu/x86emu.h>
+#if COREBOOT_V2
+#include "../x86emu/prim_ops.h"
+#else
#include <x86emu/prim_ops.h>
+#endif
#ifdef CONFIG_PCI_OPTION_ROM_RUN_YABEL
+#include <device/pci.h>
#include <device/pci_ops.h>
#endif
diff --git a/util/x86emu/yabel/io.c b/util/x86emu/yabel/io.c
index fa77b8ae4a52..a3d9f40c0c4c 100644
--- a/util/x86emu/yabel/io.c
+++ b/util/x86emu/yabel/io.c
@@ -10,16 +10,21 @@
* IBM Corporation - initial implementation
*****************************************************************************/
+#include <types.h>
+#if COREBOOT_V2
+#include "compat/rtas.h"
+#include "compat/time.h"
+#else
#include <cpu.h>
-#include "device.h"
#include "rtas.h"
-#include "debug.h"
+#include <time.h>
+#endif
#include "device.h"
-#include <types.h>
+#include "debug.h"
#include <x86emu/x86emu.h>
-#include <time.h>
#ifdef CONFIG_PCI_OPTION_ROM_RUN_YABEL
+#include <device/pci.h>
#include <device/pci_ops.h>
#endif
@@ -359,10 +364,15 @@ pci_cfg_read(X86EMU_pioAddr addr, u8 size)
|| (devfn != bios_device.devfn)) {
// fail accesses to any device but ours...
printf
- ("Config access invalid! bus: %x, devfn: %x, offs: %x\n",
- bus, devfn, offs);
+ ("Config read access invalid! PCI device %x:%x.%x, offs: %x\n",
+ bus, devfn >> 3, devfn & 7, offs);
+#ifdef CONFIG_YABEL_NO_ILLEGAL_ACCESS
HALT_SYS();
} else {
+#else
+ }
+ {
+#endif
#ifdef CONFIG_PCI_OPTION_ROM_RUN_YABEL
switch (size) {
case 1:
@@ -410,8 +420,8 @@ pci_cfg_write(X86EMU_pioAddr addr, u32 val, u8 size)
|| (devfn != bios_device.devfn)) {
// fail accesses to any device but ours...
printf
- ("Config access invalid! bus: %x, devfn: %x, offs: %x\n",
- bus, devfn, offs);
+ ("Config write access invalid! PCI device %x:%x.%x, offs: %x\n",
+ bus, devfn >> 3, devfn & 7, offs);
HALT_SYS();
} else {
#ifdef CONFIG_PCI_OPTION_ROM_RUN_YABEL
diff --git a/util/x86emu/yabel/mem.c b/util/x86emu/yabel/mem.c
index 0f653e968d0c..af096bf3e5a2 100644
--- a/util/x86emu/yabel/mem.c
+++ b/util/x86emu/yabel/mem.c
@@ -11,12 +11,18 @@
*****************************************************************************/
#include <types.h>
+#if !COREBOOT_V2
#include <cpu.h>
+#endif
#include "debug.h"
#include "device.h"
#include "x86emu/x86emu.h"
#include "biosemu.h"
+#if COREBOOT_V2
+#include "compat/time.h"
+#else
#include <time.h>
+#endif
// define a check for access to certain (virtual) memory regions (interrupt handlers, BIOS Data Area, ...)
#ifdef DEBUG
diff --git a/util/x86emu/yabel/pmm.c b/util/x86emu/yabel/pmm.c
index 13b8e1a4dd4c..0186db92f566 100644
--- a/util/x86emu/yabel/pmm.c
+++ b/util/x86emu/yabel/pmm.c
@@ -10,7 +10,11 @@
****************************************************************************/
#include <x86emu/x86emu.h>
+#if COREBOOT_V2
+#include "../x86emu/prim_ops.h"
+#else
#include <x86emu/prim_ops.h>
+#endif
#include <string.h>
#include "biosemu.h"
diff --git a/util/x86emu/yabel/vbe.c b/util/x86emu/yabel/vbe.c
index 13612dea1937..5fbf36c63f88 100644
--- a/util/x86emu/yabel/vbe.c
+++ b/util/x86emu/yabel/vbe.c
@@ -11,15 +11,20 @@
*****************************************************************************/
#include <string.h>
-
#include <types.h>
+#if !COREBOOT_V2
#include <cpu.h>
+#endif
#include "debug.h"
#include <x86emu/x86emu.h>
#include <x86emu/regs.h>
+#if COREBOOT_V2
+#include "../x86emu/prim_ops.h"
+#else
#include <x86emu/prim_ops.h> // for push_word
+#endif
#include "biosemu.h"
#include "io.h"