Re: [U-Boot] Integrator PCI base dilemma

On Fri, Mar 22, 2013 at 11:37 AM, Russell King - ARM Linux linux@arm.linux.org.uk wrote:
On Fri, Mar 22, 2013 at 09:48:27AM +0000, Arnd Bergmann wrote:
Yes, I was assuming that Linus would keep Integrator/AP working since that is what he uses.
It's entirely possible that Linus doesn't use a VGA card with Integrator/AP if Linus is not using MILO - because MILO was the only boot loader for that platform which had an x86 emulator built in to run the VGA BIOS to initialize the VGA card.
You are right, or, well, I have had an S3 VGA card plugged in and been scratching my head wondering how I should get the damned thing to work.
Now I *know* there is not really a way for me to make this work with the kernel only.
There are two boot loaders I'm aware of which are capable of doing this, and those are MILO and my boot loader for Footbridge platforms (which, incidentally, now runs ATA card BIOSes too complete with input support and can push out the VGA output via serial and accept keypresses via serial) - and that doesn't work on Integrator/AP.
I'm on U-boot for this thing, I wonder if that can do x86 emulation to initialize VGA card. I guess I'm about to learn.
Yours, Linus Walleij

On Friday 22 March 2013, Linus Walleij wrote:
There are two boot loaders I'm aware of which are capable of doing this, and those are MILO and my boot loader for Footbridge platforms (which, incidentally, now runs ATA card BIOSes too complete with input support and can push out the VGA output via serial and accept keypresses via serial) - and that doesn't work on Integrator/AP.
I'm on U-boot for this thing, I wonder if that can do x86 emulation to initialize VGA card. I guess I'm about to learn.
You should be able to do it from user space using Matthew Garrett's vbetool[1]. If I understood it right, you can initialize the VGA card with this, and then load vga16fb or vgacon.
If the card is VESA 2.0 compatible, you should also be able to use it with uvesafb, which calls /sbin/v86d for x86 emulation.
Arnd

Dear Linus Walleij,
In message CACRpkdb5Q+EtM0GGaLFNUj1A12zVrcyUxzRvfEOpcH4-pVuasA@mail.gmail.com you wrote:
I'm on U-boot for this thing, I wonder if that can do x86 emulation to initialize VGA card. I guess I'm about to learn.
Guess what the code in drivers/bios_emulator might be good for...
Best regards,
Wolfgang Denk

On Fri, Mar 22, 2013 at 10:13 PM, Wolfgang Denk wd@denx.de wrote:
Dear Linus Walleij,
In message CACRpkdb5Q+EtM0GGaLFNUj1A12zVrcyUxzRvfEOpcH4-pVuasA@mail.gmail.com you wrote:
I'm on U-boot for this thing, I wonder if that can do x86 emulation to initialize VGA card. I guess I'm about to learn.
Guess what the code in drivers/bios_emulator might be good for...
Thanks Wolfgang!
I hacked around a bit and actually got it to compile for ARM.
Now I just need to write an S3 driver or find an ATI Radeon card since that seems to be supported already.
Yours, Linus Walleij

On Fri, Mar 22, 2013 at 11:35:54PM +0100, Linus Walleij wrote:
On Fri, Mar 22, 2013 at 10:13 PM, Wolfgang Denk wd@denx.de wrote:
Dear Linus Walleij,
In message CACRpkdb5Q+EtM0GGaLFNUj1A12zVrcyUxzRvfEOpcH4-pVuasA@mail.gmail.com you wrote:
I'm on U-boot for this thing, I wonder if that can do x86 emulation to initialize VGA card. I guess I'm about to learn.
Guess what the code in drivers/bios_emulator might be good for...
Thanks Wolfgang!
I hacked around a bit and actually got it to compile for ARM.
Now I just need to write an S3 driver or find an ATI Radeon card since that seems to be supported already.
Okay, what follows is based on my latest version of the Footbridge "bios" boot loader - which is tested to run the VGA BIOS on several VGA cards, and the ATA RAID BIOS on an IT8212 card - including the config stuff on that ATA RAID BIOS card.
You shouldn't need an "S3" driver. The way I do it on Footbridge, and the way I made the Integrator Milo do it was to basically setup the PCI bus, find if there was a VGA card there, load the VGA BIOS into the x86 emulation address 0xc0000 - where it would be loaded on a PC.
Beware though - the S3 BIOS will try to access the i8253 timer which needs to be emulated, address 0x61 which can be simply discarded, maybe the PCI config IO addresses 0xcf8..0xcff (which need to generate real PCI config cycles), read from IO port 0x80 (which can simply return 0).
It will also want to access PCI IO addresses in addition to the normal VGA IO address range of 0x3b0..0x3e0: 0x8180-0x8200 (Streams processor), 0xff00-0xff44 (LPB bus), 0x100, 0x[489abe][268ae]e8
And it will want PCI memory addresses 0xa0000-0xbffff to be accessible at that x86 emulation offset.
As I said previously, different VGA BIOS prod different bits of PC hardware in random ways, so I don't guarantee that the above will work for your S3 BIOS. Mine is a S3 Trio64 V2 card:
00:09.0 VGA compatible controller: S3 Inc. 86c775/86c785 [Trio 64V2/DX or /GX] (rev 16) (prog-if 00 [VGA]) which has IDs 5333:8901.

Dear Linus,
In message CACRpkdY_qj7VBKBSCsK3mnx=V5DURY-g1fHGVwDBz2WUheB=Nw@mail.gmail.com you wrote:
I'm on U-boot for this thing, I wonder if that can do x86 emulation to initialize VGA card. I guess I'm about to learn.
Guess what the code in drivers/bios_emulator might be good for...
Thanks Wolfgang!
I hacked around a bit and actually got it to compile for ARM.
If you have any patches, I'd appreciate if you could share these with us.
Thanks in advance.
Best regards,
Wolfgang Denk
participants (4)
-
Arnd Bergmann
-
Linus Walleij
-
Russell King - ARM Linux
-
Wolfgang Denk