aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/lib/bios.h
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.h
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.h')
-rw-r--r--arch/x86/lib/bios.h201
1 files changed, 141 insertions, 60 deletions
diff --git a/arch/x86/lib/bios.h b/arch/x86/lib/bios.h
index 4a9cdb591b..a220983df1 100644
--- a/arch/x86/lib/bios.h
+++ b/arch/x86/lib/bios.h
@@ -24,69 +24,150 @@
#ifndef _BIOS_H_
#define _BIOS_H_
-#define OFFS_ES 0 /* 16bit */
-#define OFFS_GS 2 /* 16bit */
-#define OFFS_DS 4 /* 16bit */
-#define OFFS_EDI 6 /* 32bit */
-#define OFFS_DI 6 /* low 16 bits of EDI */
-#define OFFS_ESI 10 /* 32bit */
-#define OFFS_SI 10 /* low 16 bits of ESI */
-#define OFFS_EBP 14 /* 32bit */
-#define OFFS_BP 14 /* low 16 bits of EBP */
-#define OFFS_ESP 18 /* 32bit */
-#define OFFS_SP 18 /* low 16 bits of ESP */
-#define OFFS_EBX 22 /* 32bit */
-#define OFFS_BX 22 /* low 16 bits of EBX */
-#define OFFS_BL 22 /* low 8 bits of BX */
-#define OFFS_BH 23 /* high 8 bits of BX */
-#define OFFS_EDX 26 /* 32bit */
-#define OFFS_DX 26 /* low 16 bits of EBX */
-#define OFFS_DL 26 /* low 8 bits of BX */
-#define OFFS_DH 27 /* high 8 bits of BX */
-#define OFFS_ECX 30 /* 32bit */
-#define OFFS_CX 30 /* low 16 bits of EBX */
-#define OFFS_CL 30 /* low 8 bits of BX */
-#define OFFS_CH 31 /* high 8 bits of BX */
-#define OFFS_EAX 34 /* 32bit */
-#define OFFS_AX 34 /* low 16 bits of EBX */
-#define OFFS_AL 34 /* low 8 bits of BX */
-#define OFFS_AH 35 /* high 8 bits of BX */
-#define OFFS_VECTOR 38 /* 16bit */
-#define OFFS_IP 40 /* 16bit */
-#define OFFS_CS 42 /* 16bit */
-#define OFFS_FLAGS 44 /* 16bit */
+#define OFFS_ES 0 /* 16bit */
+#define OFFS_GS 2 /* 16bit */
+#define OFFS_DS 4 /* 16bit */
+#define OFFS_EDI 6 /* 32bit */
+#define OFFS_DI 6 /* low 16 bits of EDI */
+#define OFFS_ESI 10 /* 32bit */
+#define OFFS_SI 10 /* low 16 bits of ESI */
+#define OFFS_EBP 14 /* 32bit */
+#define OFFS_BP 14 /* low 16 bits of EBP */
+#define OFFS_ESP 18 /* 32bit */
+#define OFFS_SP 18 /* low 16 bits of ESP */
+#define OFFS_EBX 22 /* 32bit */
+#define OFFS_BX 22 /* low 16 bits of EBX */
+#define OFFS_BL 22 /* low 8 bits of BX */
+#define OFFS_BH 23 /* high 8 bits of BX */
+#define OFFS_EDX 26 /* 32bit */
+#define OFFS_DX 26 /* low 16 bits of EBX */
+#define OFFS_DL 26 /* low 8 bits of BX */
+#define OFFS_DH 27 /* high 8 bits of BX */
+#define OFFS_ECX 30 /* 32bit */
+#define OFFS_CX 30 /* low 16 bits of EBX */
+#define OFFS_CL 30 /* low 8 bits of BX */
+#define OFFS_CH 31 /* high 8 bits of BX */
+#define OFFS_EAX 34 /* 32bit */
+#define OFFS_AX 34 /* low 16 bits of EBX */
+#define OFFS_AL 34 /* low 8 bits of BX */
+#define OFFS_AH 35 /* high 8 bits of BX */
+#define OFFS_VECTOR 38 /* 16bit */
+#define OFFS_IP 40 /* 16bit */
+#define OFFS_CS 42 /* 16bit */
+#define OFFS_FLAGS 44 /* 16bit */
-#define SEGMENT 0x40
-#define STACK 0x800 /* stack at 0x40:0x800 -> 0x800 */
+/* stack at 0x40:0x800 -> 0x800 */
+#define SEGMENT 0x40
+#define STACK 0x800
-/* save general registers */
-/* save some segments */
-/* save callers stack segment .. */
-/* ... in gs */
- /* setup my segments */
- /* setup BIOS stackpointer */
-
-#define MAKE_BIOS_STACK \
- pushal; \
- pushw %ds; \
- pushw %gs; \
- pushw %es; \
- pushw %ss; \
- popw %gs; \
- movw $SEGMENT, %ax; \
- movw %ax, %ds; \
- movw %ax, %es; \
- movw %ax, %ss; \
- movw %sp, %bp; \
+/*
+ * save general registers
+ * save some segments
+ * save callers stack segment
+ * setup BIOS segments
+ * setup BIOS stackpointer
+ */
+#define MAKE_BIOS_STACK \
+ pushal; \
+ pushw %ds; \
+ pushw %gs; \
+ pushw %es; \
+ pushw %ss; \
+ popw %gs; \
+ movw $SEGMENT, %ax; \
+ movw %ax, %ds; \
+ movw %ax, %es; \
+ movw %ax, %ss; \
+ movw %sp, %bp; \
movw $STACK, %sp
-#define RESTORE_CALLERS_STACK \
- pushw %gs; /* restore callers stack segment */ \
- popw %ss; \
- movw %bp, %sp; /* restore stackpointer */ \
- popw %es; /* restore segment selectors */ \
- popw %gs; \
- popw %ds; \
- popal /* restore GP registers */
+/*
+ * restore callers stack segment
+ * restore some segments
+ * restore general registers
+ */
+#define RESTORE_CALLERS_STACK \
+ pushw %gs; \
+ popw %ss; \
+ movw %bp, %sp; \
+ popw %es; \
+ popw %gs; \
+ popw %ds; \
+ popal
+
+#ifndef __ASSEMBLY__
+#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;
+
+#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))
+
+#ifdef PCI_BIOS_DEBUG
+extern u32 num_pci_bios_present;
+extern u32 num_pci_bios_find_device;
+extern u32 num_pci_bios_find_class;
+extern u32 num_pci_bios_generate_special_cycle;
+extern u32 num_pci_bios_read_cfg_byte;
+extern u32 num_pci_bios_read_cfg_word;
+extern u32 num_pci_bios_read_cfg_dword;
+extern u32 num_pci_bios_write_cfg_byte;
+extern u32 num_pci_bios_write_cfg_word;
+extern u32 num_pci_bios_write_cfg_dword;
+extern u32 num_pci_bios_get_irq_routing;
+extern u32 num_pci_bios_set_irq;
+extern u32 num_pci_bios_unknown_function;
+#endif
+
+#endif
#endif