Re: S3 High Speed text font support in vgacon.c [patch 2.1.112]

Geert Uytterhoeven (
Fri, 31 Jul 1998 14:40:11 +0200 (CEST)

On Fri, 31 Jul 1998, Gabriel Paubert wrote:
> On Fri, 31 Jul 1998, Geert Uytterhoeven wrote:
> > On Fri, 31 Jul 1998, Jan Kratochvil wrote:
> > > On Fri, Jul 31, 1998 at 10:37:23AM +0000, Yaroslav Rosomakho wrote:
> > > > Look, if you nkow S3 cards, couldn't you write video frame buffer for S3?
> > >
> > > Please see "/usr/src/linux/drivers/video/S3triofb.c". This is probably
> > > what you want but unfortunately its not meant for i386 platform but for
> > > PowerPC one where the PowerPC init system (like i386 BIOS) initializes the
> > > graphical mode for you.
> >
> > Yes indeed. The Trio is initialized by Open Firmware in some machines. It isn't
> > in mine :-(
> On mine (PreP) it would not be initialized at all either, although later
> versions of the firmware finally allocate PCI resources. But the worst

I even have to allocate PCI resources for my S3.

I've been thinking about adding code for that to the kernel, but it's not
trivial: how do you find out which devices have been assigned PCI resources
already? Is this the correct way?

oldaddr = pci_read(PCI_BASE_ADDRESS_i);
pci_write(PCI_BASE_ADDRESS_i, -1);
newaddr = pci_read(PCI_BASE_ADDRESS_i);
if (oldaddr == newaddr) {
/* not assigned */
newaddr = pci_alloc(newaddr);
pci_write(PCI_BASE_ADDRESS_i, newaddr);
} else {
/* assigned */
pci_write(PCI_BASE_ADDRESS_i, oldaddr);

OK, this is a bit simplistic. I need two passes to prealloc the already
assigned stuff. I cannot reassign new adresses to already assigned stuff since
those adresses may be in the Open Firmware device tree properties, and thus
can't be changed.

And I have to enable PCI_COMMAND_IO and PCI_COMMAND_MEMORY, if necessary,

`lspci -v' gives for me (stripped irrelevant information):
| 00:03.0 VGA compatible controller: S3 Inc. Vision 968
| Flags: stepping, medium devsel, IRQ 28

i.e. nothing assigned for the Vision968.

| 00:05.0 VGA compatible controller: ATI Technologies Inc 215GT [Mach64 GT] (rev 9a)
| Flags: stepping, medium devsel, IRQ 30
| Memory at c2000000 (32-bit, non-prefetchable)
| Memory at fffff000 (32-bit, non-prefetchable)

The first memory block of the RAGE II+ is assigned, the second isn't.

> part was that the S3 specific initialization code in the PPC port of Linux
> would not work either.

Same for me.

> To solve the problem I have written a small (~24kB code+data) real mode
> 80486SX emulator which executes the x86 BIOS initialization routine on the
> PPC. It works well for me, but unfortunately AFAIK the few people who
> have tried it on their machines have not been successful :-(
> The code was written as an user mode utility but still needs some
> modifications to run under 2.1. Of course I'm using a serial console
> since the screen is unreadable until the utility runs.

If you port it to 2.1.112, I'm willing to try on my Vision968 ;-)



P.S. Changed CC list, included another PCI expert.

Geert Uytterhoeven           
Wavelets, Linux/{m68k~Amiga,PPC~CHRP}
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to Please read the FAQ at