summaryrefslogtreecommitdiff
path: root/board/MAI/bios_emulator
diff options
context:
space:
mode:
Diffstat (limited to 'board/MAI/bios_emulator')
-rw-r--r--board/MAI/bios_emulator/glue.c54
-rw-r--r--board/MAI/bios_emulator/scitech/src/x86emu/makefile.uboot80
-rw-r--r--board/MAI/bios_emulator/x86interface.c7
3 files changed, 104 insertions, 37 deletions
diff --git a/board/MAI/bios_emulator/glue.c b/board/MAI/bios_emulator/glue.c
index b765ed54c98..f59ffaa56d6 100644
--- a/board/MAI/bios_emulator/glue.c
+++ b/board/MAI/bios_emulator/glue.c
@@ -271,9 +271,9 @@ int attempt_map_rom(pci_dev_t dev, void *copy_address)
pci_write_config_dword(dev, PCI_ROM_ADDRESS, 0);
pci_write_config_dword(dev, i, bar_backup);
- /* FIXME: */
- bat_map(2, 0x80000000, 256*1024*1024);
- show_bat_mapping();
+ /* FIXME: Shouldn't be needed anymore*/
+ /* bat_map(2, 0x80000000, 256*1024*1024);
+ show_bat_mapping(); */
/*
* Since most cards can probably only do 16 bit IO addressing, we
@@ -436,7 +436,6 @@ int find_image(u32 rom_address, u32 rom_size, void **image, u32 *image_size)
void show_bat_mapping(void)
{
-#ifdef DEBUG
u32 dbat0u, dbat0l, ibat0u, ibat0l;
u32 dbat1u, dbat1l, ibat1u, ibat1l;
u32 dbat2u, dbat2l, ibat2u, ibat2l;
@@ -477,7 +476,6 @@ void show_bat_mapping(void)
dbat3u, dbat3l, ibat3u, ibat3l);
printf("\nMSR: %08x HID0: %08x L2CR: %08x \n", msr,hid0, l2cr_reg);
-#endif
}
@@ -485,44 +483,34 @@ void show_bat_mapping(void)
void remove_init_data(void)
{
char *s;
- u32 batl = ((CFG_SDRAM_BASE+0x100000) | BATL_PP_RW);
- u32 batu =((CFG_SDRAM_BASE+0x100000) | BATU_BL_256M | BATU_VS | BATU_VP);
-#if 0 /* already done in board_init_r() */
- void *data = (void *)(CFG_INIT_RAM_ADDR+CFG_INIT_DATA_OFFSET);
- unsigned char data2[CFG_INIT_DATA_SIZE];
-
- /* Make a copy of the data */
- memcpy(data2, data, CFG_INIT_DATA_SIZE);
-#endif /* 0 */
/* Invalidate and disable data cache */
invalidate_l1_data_cache();
dcache_disable();
-#if 0
- /* Copy to the real RAM address */
- memcpy(data, data2, CFG_INIT_DATA_SIZE);
-#endif
-
- /*printf("Before ICache enable\n");
- show_bat_mapping();*/
-
- __asm volatile ("isync \n"
- "mtdbatu 2,%2 \n"
- "mtdbatl 2,%2 \n"
- "mtdbatu 1,%0 \n"
- "mtdbatl 1,%1 \n"
- "sync \n"
- "isync \n"
- : : "r" (batu), "r" (batl), "r" (0));
-
- /* show_bat_mapping(); */
s = getenv("x86_cache");
- if (!s || (s && strcmp(s, "on")==0))
+ if (!s)
{
icache_enable();
dcache_enable();
}
+ else if (s)
+ {
+ if (strcmp(s, "dcache")==0)
+ {
+ dcache_enable();
+ }
+ else if (strcmp(s, "icache") == 0)
+ {
+ icache_enable();
+ }
+ else if (strcmp(s, "on")== 0 || strcmp(s, "both") == 0)
+ {
+ dcache_enable();
+ icache_enable();
+ }
+ }
+ /* show_bat_mapping();*/
}
diff --git a/board/MAI/bios_emulator/scitech/src/x86emu/makefile.uboot b/board/MAI/bios_emulator/scitech/src/x86emu/makefile.uboot
new file mode 100644
index 00000000000..d011cf5f673
--- /dev/null
+++ b/board/MAI/bios_emulator/scitech/src/x86emu/makefile.uboot
@@ -0,0 +1,80 @@
+#############################################################################
+#
+# Realmode X86 Emulator Library
+#
+# Copyright (C) 1996-1999 SciTech Software, Inc.
+#
+# ========================================================================
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee,
+# provided that the above copyright notice appear in all copies and that
+# both that copyright notice and this permission notice appear in
+# supporting documentation, and that the name of the authors not be used
+# in advertising or publicity pertaining to distribution of the software
+# without specific, written prior permission. The authors makes no
+# representations about the suitability of this software for any purpose.
+# It is provided "as is" without express or implied warranty.
+#
+# THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+# EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+#
+# ========================================================================
+#
+# Descripton: Linux specific makefile for the x86emu library.
+#
+#############################################################################
+CC = $(CROSS_COMPILE)gcc
+AR = $(CROSS_COMPILE)ar
+TARGETLIB = libx86emu.a
+TARGETDEBUGLIB =libx86emud.a
+
+OBJS=\
+decode.o \
+fpu.o \
+ops.o \
+ops2.o \
+prim_ops.o \
+sys.o
+
+DEBUGOBJS=debug.d \
+ decode.d \
+ fpu.d \
+ ops.d \
+ ops2.d \
+ prim_ops.d \
+ sys.d
+
+.SUFFIXES: .d
+
+all: $(TARGETLIB) $(TARGETDEBUGLIB)
+
+$(TARGETLIB): $(OBJS)
+ $(AR) rv $(TARGETLIB) $(OBJS)
+
+$(TARGETDEBUGLIB): $(DEBUGOBJS)
+ $(AR) rv $(TARGETDEBUGLIB) $(DEBUGOBJS)
+
+INCS = -I. -Ix86emu -I../../include
+CFLAGS = -D__DRIVER__ -DFORCE_POST -D_CEXPORT= -DNO_LONG_LONG -Dprintk=printf -fsigned-char -fomit-frame-pointer -mrelocatable -ffixed-r14 -meabi -mrelocatable -ffixed-r14 -meabi
+CDEBUGFLAGS = -DDEBUG
+
+.c.o:
+ $(CC) -g -O2 -Wall -c $(CFLAGS) $(INCS) $*.c
+
+.c.d:
+ $(CC) -g -O2 -Wall -c -o$*.d $(CFLAGS) $(CDEBUGFLAGS) $(INCS) $*.c
+
+.cpp.o:
+ $(CC) -c $(CFLAGS) $(INCS) $*.cpp
+
+clean:
+ rm -f *.a *.o *.d
+
+validate: validate.o libx86emu.a
+ $(CC) -o validate validate.o -lx86emu -L.
diff --git a/board/MAI/bios_emulator/x86interface.c b/board/MAI/bios_emulator/x86interface.c
index b1ad61a6a04..e90ec5a6729 100644
--- a/board/MAI/bios_emulator/x86interface.c
+++ b/board/MAI/bios_emulator/x86interface.c
@@ -398,9 +398,7 @@ int execute_bios(pci_dev_t gr_dev, void *reloc_addr)
u8 cfg;
int i;
char c;
-#ifdef DEBUG
char *s;
-#endif
#ifdef EASTEREGG
int easteregg_active = 0;
#endif
@@ -409,6 +407,7 @@ int execute_bios(pci_dev_t gr_dev, void *reloc_addr)
unsigned char *msg;
unsigned char current_attr;
+ PRINTF("Trying to remove init data\n");
remove_init_data();
PRINTF("Removed init data from cache, now in RAM\n");
@@ -438,7 +437,7 @@ int execute_bios(pci_dev_t gr_dev, void *reloc_addr)
return 0;
}
-#ifdef DEBUG
+#if 1 /*def DEBUG*/
s = getenv("x86_ask_start");
if (s)
{
@@ -646,7 +645,7 @@ int execute_bios(pci_dev_t gr_dev, void *reloc_addr)
if (getenv("x86_do_inout")) do_inout();
#endif
- dcache_disable();
+//FIXME: dcache_disable();
return 1;
}