On Tue, Jan 17, 2012 at 12:06:54AM +0100, Nils wrote:
Op maandag 16-01-2012 om 00:23 uur [tijdzone -0500], schreef Kevin O'Connor:
Oh - it was on top of the recent patches I sent to the mailing list.
OK sorry!
Now that i used that patch set also everything compiles.
First i used your instructions and named the vgarom: "pci100b,0030.rom" but then the vgabios is not run. (See attachment v475.log)
Make sure you have CONFIG_VGA_BRIDGE_SETUP set in coreboot. Otherwise, I don't understand why it wouldn't run. (Your logs seem to indicate that optionroms.c:is_pci_vga() is failing - which I think would only happen if CONFIG_VGA_BRIDGE_SETUP isn't set.)
Second i used vgaroms/vgabios.bin as the vgabios name. The vgabios gets run but i get no display output and SeaBIOS reboots over and over. (see attachment v475-2.log)
Yeah - it will break if it gets run via "vgaroms/" - I'll change the vgabios code to check for this.
This could have to do with vga region setup. I wil investigate in the next day's (when i find time) how to initialize MSR's to get pci access set up.
Should the E820 table also reflect the vga range? (I have no clue how to fix that)
The e820 shouldn't have anything to do with this.
-Kevin
On Mon, Jan 16, 2012 at 06:56:42PM -0500, Kevin O'Connor wrote:
On Tue, Jan 17, 2012 at 12:06:54AM +0100, Nils wrote:
Second i used vgaroms/vgabios.bin as the vgabios name. The vgabios gets run but i get no display output and SeaBIOS reboots over and over. (see attachment v475-2.log)
Yeah - it will break if it gets run via "vgaroms/" - I'll change the vgabios code to check for this.
The patch below (on top of previous patches) should catch this case. With this, it should be possible to run the geode rom even if it is set in "vgaroms/".
-Kevin
commit 8cf8f8e6ce971b16ee25309df7ebf32f7a04dc14 Author: Kevin O'Connor kevin@koconnor.net Date: Mon Jan 16 19:05:27 2012 -0500
vgabios: Check that the PCI BDF passed in is valid before using.
Signed-off-by: Kevin O'Connor kevin@koconnor.net
diff --git a/vgasrc/bochsvga.c b/vgasrc/bochsvga.c index 82629b9..cbd0b41 100644 --- a/vgasrc/bochsvga.c +++ b/vgasrc/bochsvga.c @@ -123,12 +123,11 @@ bochsvga_init(void)
dispi_write(VBE_DISPI_INDEX_ID, VBE_DISPI_ID5);
- u32 lfb_addr; - if (CONFIG_VGA_PCI) - lfb_addr = (pci_config_readl(GET_GLOBAL(VgaBDF), PCI_BASE_ADDRESS_0) + u32 lfb_addr = VBE_DISPI_LFB_PHYSICAL_ADDRESS; + int bdf = GET_GLOBAL(VgaBDF); + if (CONFIG_VGA_PCI && bdf >= 0) + lfb_addr = (pci_config_readl(bdf, PCI_BASE_ADDRESS_0) & PCI_BASE_ADDRESS_MEM_MASK); - else - lfb_addr = VBE_DISPI_LFB_PHYSICAL_ADDRESS;
SET_VGA(VBE_framebuffer, lfb_addr); u16 totalmem = dispi_read(VBE_DISPI_INDEX_VIDEO_MEMORY_64K); diff --git a/vgasrc/clext.c b/vgasrc/clext.c index f08294a..5468db3 100644 --- a/vgasrc/clext.c +++ b/vgasrc/clext.c @@ -737,8 +737,9 @@ clext_init(void) dprintf(1, "cirrus init 2\n");
u32 lfb_addr = 0; - if (CONFIG_VGA_PCI) - lfb_addr = (pci_config_readl(GET_GLOBAL(VgaBDF), PCI_BASE_ADDRESS_0) + int bdf = GET_GLOBAL(VgaBDF); + if (CONFIG_VGA_PCI && bdf >= 0) + lfb_addr = (pci_config_readl(bdf, PCI_BASE_ADDRESS_0) & PCI_BASE_ADDRESS_MEM_MASK); SET_VGA(VBE_framebuffer, lfb_addr); u16 totalmem = cirrus_get_memsize(); diff --git a/vgasrc/geodevga.c b/vgasrc/geodevga.c index ce754a5..5c6caf0 100644 --- a/vgasrc/geodevga.c +++ b/vgasrc/geodevga.c @@ -363,6 +363,9 @@ int geodevga_init(void) stdvga_override_crtc(i, crtc); }
+ if (GET_GLOBAL(VgaBDF) < 0) + // Device should be at 00:01.1 + SET_VGA(VgaBDF, pci_to_bdf(0, 1, 1)); ret |= vp_setup(); ret |= dc_setup();
diff --git a/vgasrc/vgabios.c b/vgasrc/vgabios.c index 449f3c4..5ce7c0c 100644 --- a/vgasrc/vgabios.c +++ b/vgasrc/vgabios.c @@ -20,6 +20,8 @@ #include "stdvga.h" // stdvga_set_cursor_shape #include "clext.h" // clext_1012 #include "vgahw.h" // vgahw_set_mode +#include "pci.h" // pci_config_readw +#include "pci_regs.h" // PCI_VENDOR_ID
// XXX #define DEBUG_VGA_POST 1 @@ -1226,14 +1228,19 @@ init_bios_area(void) SET_BDA(video_msr, 0x09); }
-u16 VgaBDF VAR16; +int VgaBDF VAR16 = -1;
void VISIBLE16 vga_post(struct bregs *regs) { debug_enter(regs, DEBUG_VGA_POST);
- SET_VGA(VgaBDF, regs->ax); + if (CONFIG_VGA_PCI) { + u16 bdf = regs->ax; + if (pci_config_readw(bdf, PCI_VENDOR_ID) == CONFIG_VGA_VID + && pci_config_readw(bdf, PCI_DEVICE_ID) == CONFIG_VGA_DID) + SET_VGA(VgaBDF, bdf); + }
int ret = vgahw_init(); if (ret) { diff --git a/vgasrc/vgabios.h b/vgasrc/vgabios.h index 403e7ce..6895a39 100644 --- a/vgasrc/vgabios.h +++ b/vgasrc/vgabios.h @@ -73,7 +73,7 @@ extern u8 vgafont14alt[]; extern u8 vgafont16alt[];
// vgabios.c -extern u16 VgaBDF; +extern int VgaBDF; #define SET_VGA(var, val) SET_FARVAR(get_global_seg(), (var), (val)) struct carattr { u8 car, attr, use_attr;
Op donderdag 19-01-2012 om 21:41 uur [tijdzone -0500], schreef Kevin O'Connor:
The patch below (on top of previous patches) should catch this case. With this, it should be possible to run the geode rom even if it is set in "vgaroms/".
After this patch geode vga is working again. :)
I don't know if this is a bug but when i use the name "pci100b,0030.rom" for the vgabios it is still not loading it. It would be nice to be able to add the vgabios to cbfs via the existing coreboot kconfig option.
Earlier this week i tried to load and run the vgarom via coreboot and CONFIG_OPTIONROMS_DEPLOYED=y in SeaBIOS and got an checksum error. I tested it again today and got the following error:
Searching CBFS for prefix etc/screen-and-debug Found CBFS file pci100b,0030.rom Found CBFS file fallback/romstage Found CBFS file fallback/coreboot_ram Found CBFS file fallback/payload Found CBFS file vsa Found CBFS file config Found CBFS file Checking rom 0x000c0000 (sig aa55 size 68) Found option rom with bad checksum: loc=0x000c0000 len=34816 sum=8 init usb
Is this checksum error caused by SeaBIOS or coreboot?
Thanks, Nils.
On Sat, Jan 21, 2012 at 12:18:28AM +0100, Nils wrote:
Op donderdag 19-01-2012 om 21:41 uur [tijdzone -0500], schreef Kevin O'Connor:
The patch below (on top of previous patches) should catch this case. With this, it should be possible to run the geode rom even if it is set in "vgaroms/".
After this patch geode vga is working again. :)
I don't know if this is a bug but when i use the name "pci100b,0030.rom" for the vgabios it is still not loading it. It would be nice to be able to add the vgabios to cbfs via the existing coreboot kconfig option.
Something's not right with the way the PCI device is configured. You could try putting debug statements in is_pci_vga() to find out what. In any case, if it works with the latest patch, I'll push my changes.
Earlier this week i tried to load and run the vgarom via coreboot and CONFIG_OPTIONROMS_DEPLOYED=y in SeaBIOS and got an checksum error. I tested it again today and got the following error:
CONFIG_OPTIONROMS_DEPLOYED is for old Bochs stuff - it wont work with coreboot. Having coreboot run the roms wont work with SeaBIOS.
-Kevin