aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/lib/bios_setup.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2011-12-02 00:17:49 +0100
committerWolfgang Denk <wd@denx.de>2011-12-02 00:17:49 +0100
commit7708d8b352e9e595f6f08afd3206af6495c7dc09 (patch)
treefb9811040b2b1f55c44fc7274473f2ef0847c19b /arch/x86/lib/bios_setup.c
parentd887ad54ca74063338bc3108beed0aa4f15d1f6b (diff)
parentf008b17f8c2995996b5d100b71f8851d6f74a136 (diff)
Merge branch 'master' of ssh://gemini/home/wd/git/u-boot/master
* 'master' of ssh://gemini/home/wd/git/u-boot/master: board/emk/top860/top860.c: Fix GCC 4.6 build warning board/sbc405/strataflash.c: Fix GCC 4.6 build warning arch/powerpc/cpu/mpc86xx/cpu.c: Fix GCC 4.6 build warning board/freescale/mpc8610hpcd/mpc8610hpcd.c: Fix GCC 4.6 build warning board/mpl/common/flash.c: Fix GCC 4.6 build warning post/board/lwmon5/gdc.c: Fix GCC 4.6 build warning drivers/usb/host/sl811-hcd.c: Fix GCC 4.6 build warning board/sandburst/common/flash.c: Fix GCC 4.6 build warning DB64460: Fix GCC 4.6 build warnings DB64360: Fix GCC 4.6 build warnings board/cray/L1/flash.c: Fix GCC 4.6 build warning drivers/block/sata_dwc.c: Fix GCC 4.6 build warning board/amirix/ap1000/flash.c: Fix GCC 4.6 build warning alpr board: Fix GCC 4.6 build warnings image: Don't detect XIP images as overlapping. image: Implement IH_TYPE_KERNEL_NOLOAD ppc4xx: Add Io64 board support ppc4xx: fix PMC440 painit command ppc4xx: remove invalid access to PCI_BRDGOPT2 register ppc4xx: use CONFIG_PCI_BOOTDELAY instead of private implementation mpc85xx: support for Freescale COM Express P2020 arch/powerpc/cpu/mpc8xxx/ddr/interactive.c: Fix GCC 4.6 build warning mpc85xx: support board-specific reset function powerpc/85xx: verify the localbus device tree address before booting the OS mpc8xxx: update module_type values from JEDEC DDR3 SPD Specification powerpc/p3060qds: Add board related support for P3060QDS platform powerpc/85xx: clean up and document the QE/FMAN microcode macros powerpc/85xx: always implement the work-around for Erratum SATA_A001 powerpc/85xx: CONFIG_FSL_SATA_V2 should be defined in config_mpc85xx.h powerpc/85xx: Add workaround for erratum A-003474 powerpc/85xx: fixup flexcan device tree clock-frequency powerpc/85xx: Add workaround for erratum CPU-A003999 x86: Fix some bugs in the i8402 driver when no controller is present x86: Make the i8042 driver checkpatch clean x86: Wrap small helper functions from libgcc to avoid an ABI mismatch x86: Import the glibc memset implementation x86: Fix a few recently added bugs x86: Don't relocate symbols which point to things that aren't relocated x86: Fix how the location of the realmode and bios blobs are calculated x86: Misc cleanups x86: Misc PCI touchups x86: Ensure IDT and GDT remain 16-byte aligned post relocation x86: Provide more configuration granularity x86: Add multiboot header sc520: Create arch asm-offsets x86: Punt cold- and warm-boot flags cosmetic: checkpatch cleanup of board/eNET/*.c cosmetic: checkpatch cleanup of arch/x86/lib/*.c cosmetic: checkpatch cleanup of arch/x86/cpu/sc520/*.c cosmetic: checkpatch cleanup of arch/x86/cpu/*.c x86: Call hang() on unrecoverable exception menu.c: use puts() instead of printf() where possible MAKEALL: drop obsolete mx31pdk_nand target dataflash: fix parameters order in write_dataflash() hawkboard: Replace HAWKBOARD_KICK{0, 1}_UNLOCK defines davinci_sonata: define CONFIG_MACH_TYPE for davinci_sonata board davinci_schmoogie: define CONFIG_MACH_TYPE for davinci_schmoogie board arm: a320evb: define mach-type in board config file OMAP3: Use sdelay from arch/arm/cpu/armv7/syslib.c instead of cloning that. Fix Stelian's email address DIU: 1080P and 720P support CFB: Fix font rendering on mx5 framebuffer
Diffstat (limited to 'arch/x86/lib/bios_setup.c')
-rw-r--r--arch/x86/lib/bios_setup.c96
1 files changed, 17 insertions, 79 deletions
diff --git a/arch/x86/lib/bios_setup.c b/arch/x86/lib/bios_setup.c
index 9bf7e5872f..265f7d671e 100644
--- a/arch/x86/lib/bios_setup.c
+++ b/arch/x86/lib/bios_setup.c
@@ -34,74 +34,22 @@
#include <pci.h>
#include <asm/realmode.h>
#include <asm/io.h>
+#include "bios.h"
DECLARE_GLOBAL_DATA_PTR;
#define NUMVECTS 256
-#define BIOS_DATA ((char*)0x400)
-#define BIOS_DATA_SIZE 256
-#define BIOS_BASE ((char*)0xf0000)
-#define BIOS_CS 0xf000
-
-extern ulong __bios_start;
-extern ulong __bios_size;
-
-/* these are defined in a 16bit segment and needs
- * to be accessed with the RELOC_16_xxxx() macros below
- */
-extern u16 ram_in_64kb_chunks;
-extern u16 bios_equipment;
-extern u8 pci_last_bus;
-
-extern void *rm_int00;
-extern void *rm_int01;
-extern void *rm_int02;
-extern void *rm_int03;
-extern void *rm_int04;
-extern void *rm_int05;
-extern void *rm_int06;
-extern void *rm_int07;
-extern void *rm_int08;
-extern void *rm_int09;
-extern void *rm_int0a;
-extern void *rm_int0b;
-extern void *rm_int0c;
-extern void *rm_int0d;
-extern void *rm_int0e;
-extern void *rm_int0f;
-extern void *rm_int10;
-extern void *rm_int11;
-extern void *rm_int12;
-extern void *rm_int13;
-extern void *rm_int14;
-extern void *rm_int15;
-extern void *rm_int16;
-extern void *rm_int17;
-extern void *rm_int18;
-extern void *rm_int19;
-extern void *rm_int1a;
-extern void *rm_int1b;
-extern void *rm_int1c;
-extern void *rm_int1d;
-extern void *rm_int1e;
-extern void *rm_int1f;
-extern void *rm_def_int;
-
-extern void *realmode_reset;
-extern void *realmode_pci_bios_call_entry;
-
static int set_jmp_vector(int entry_point, void *target)
{
- if (entry_point & ~0xffff) {
+ if (entry_point & ~0xffff)
return -1;
- }
- if (((u32)target-0xf0000) & ~0xffff) {
+ if (((u32)target - 0xf0000) & ~0xffff)
return -1;
- }
+
printf("set_jmp_vector: 0xf000:%04x -> %p\n",
- entry_point, target);
+ entry_point, target);
/* jmp opcode */
writeb(0xea, 0xf0000 + entry_point);
@@ -115,51 +63,42 @@ static int set_jmp_vector(int entry_point, void *target)
return 0;
}
-
-/*
- ************************************************************
- * Install an interrupt vector
- ************************************************************
- */
-
+/* Install an interrupt vector */
static void setvector(int vector, u16 segment, void *handler)
{
- u16 *ptr = (u16*)(vector*4);
- ptr[0] = ((u32)handler - (segment << 4))&0xffff;
+ u16 *ptr = (u16 *)(vector * 4);
+ ptr[0] = ((u32)handler - (segment << 4)) & 0xffff;
ptr[1] = segment;
#if 0
printf("setvector: int%02x -> %04x:%04x\n",
- vector, ptr[1], ptr[0]);
+ vector, ptr[1], ptr[0]);
#endif
}
-#define RELOC_16_LONG(seg, off) *(u32*)(seg << 4 | (u32)&off)
-#define RELOC_16_WORD(seg, off) *(u16*)(seg << 4 | (u32)&off)
-#define RELOC_16_BYTE(seg, off) *(u8*)(seg << 4 | (u32)&off)
-
int bios_setup(void)
{
- ulong bios_start = (ulong)&__bios_start + gd->reloc_off;
+ /* The BIOS section is not relocated and still in the ROM. */
+ ulong bios_start = (ulong)&__bios_start;
ulong bios_size = (ulong)&__bios_size;
- static int done=0;
+ static int done;
int vector;
#ifdef CONFIG_PCI
struct pci_controller *pri_hose;
#endif
- if (done) {
+ if (done)
return 0;
- }
+
done = 1;
if (bios_size > 65536) {
printf("BIOS too large (%ld bytes, max is 65536)\n",
- bios_size);
+ bios_size);
return -1;
}
- memcpy(BIOS_BASE, (void*)bios_start, bios_size);
+ memcpy(BIOS_BASE, (void *)bios_start, bios_size);
/* clear bda */
memset(BIOS_DATA, 0, BIOS_DATA_SIZE);
@@ -178,9 +117,8 @@ int bios_setup(void)
/* setup realmode interrupt vectors */
- for (vector = 0; vector < NUMVECTS; vector++) {
+ for (vector = 0; vector < NUMVECTS; vector++)
setvector(vector, BIOS_CS, &rm_def_int);
- }
setvector(0x00, BIOS_CS, &rm_int00);
setvector(0x01, BIOS_CS, &rm_int01);