diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2012-01-14 16:59:21 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2012-01-14 17:20:07 -0500 |
commit | 97cc354a0223ad4241e657f69dc13ffed2694ee8 (patch) | |
tree | e0f5be587fd9e0613e94e9dc6baf90456ffafb40 /vgasrc/bochsvga.c | |
parent | e91ec7c7735eda163efc6ece9ac95e12e8adf497 (diff) | |
download | seabios-97cc354a0223ad4241e657f69dc13ffed2694ee8.tar.gz |
vgabios: Add cirrus linear framebuffer detection; enable VBE in cirrus.
Extract Cirrus framebuffer address from PCI config space.
Enable VBE code for Cirrus cards.
Also, rework bochsvga code to use direct PCI accesses instead of
calling into the BIOS.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc/bochsvga.c')
-rw-r--r-- | vgasrc/bochsvga.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/vgasrc/bochsvga.c b/vgasrc/bochsvga.c index d9858c20..b7b1b058 100644 --- a/vgasrc/bochsvga.c +++ b/vgasrc/bochsvga.c @@ -5,6 +5,8 @@ #include "config.h" // CONFIG_* #include "biosvar.h" // SET_BDA #include "stdvga.h" // VGAREG_SEQU_ADDRESS +#include "pci.h" // pci_config_readl +#include "pci_regs.h" // PCI_BASE_ADDRESS_0 static struct bochsvga_mode { @@ -76,27 +78,6 @@ static struct bochsvga_mode { 0x18c, { MM_DIRECT, 2560, 1600, 32 } }, }; -static inline u32 pci_config_readl(u16 bdf, u16 addr) -{ - int status; - u32 val; - - addr &= ~3; - - asm volatile( - "int $0x1a\n" - "cli\n" - "cld" - : "=a"(status), "=c"(val) - : "a"(0xb10a), "b"(bdf), "D"(addr) - : "cc", "memory"); - - if ((status >> 16)) - return (u32)-1; - - return val; -} - static u16 dispi_get_max_xres(void) { u16 en; @@ -145,7 +126,8 @@ bochsvga_init(void) u32 lfb_addr; if (CONFIG_VGA_PCI) - lfb_addr = pci_config_readl(GET_GLOBAL(VgaBDF), 0x10) & ~0xf; + lfb_addr = (pci_config_readl(GET_GLOBAL(VgaBDF), PCI_BASE_ADDRESS_0) + & PCI_BASE_ADDRESS_MEM_MASK); else lfb_addr = VBE_DISPI_LFB_PHYSICAL_ADDRESS; |