accessing ROM on Rage 128 chips in aty128fb

accessing ROM on Rage 128 chips in aty128fb

Post by Martin Murra » Tue, 01 Apr 2003 02:10:10



I have a thinkpad A21p and am trying to use the aty128fb fbcon driver.
With 2.4.20 and 2.5.63, the lcd becomes garbled and erratic upon modprobe
of the module. I am trying to solve this problem.

I believe the aty128fb needs the correct pll values for my LCD which
stored in the Rage 128 ROM, however, the aty128fb does not find the ROM. I
compared the aty128fb initialization sequence to the ati driver from
X4.3.0, and found that the X driver maps the ROM through configuration
space.

I have been trying to implement this in the aty128fb driver, and have the
following questions:

How can I find a linear segment of address space [64k] to map the ROM to?

Why does the linux PCI code not set up a mapping for the ROM
automatically? pci_resource_start(pdev, PCI_ROM_RESOURCE) is 0, where
pdev is the Rage 128 chip.

Do I need to do anything further than write the base to the
PCI_ROM_ADDRESS register in the pci configuration space?
 - I tried this with the value 0xe8000001 without success. The last 1 is
the enable bit.

I noticed the AGP bridge had memory ranges mapped that encompassed those
required by the Rage 128 chip. Do I need to make another entry to properly
map the ROM?

I also noticed that the AGP bridge had mapped 64 megs of memory, and the
Rage 128 chip had also mapped 64 megs of memory, however, the chip has
only 16 megs of ram. There are seperate regions for the memory mapped
register and memory mapped I/O. Can I use the space above 16 megs to map
the ROM?

I inserted this code into aty128_pci_register() and it did not work:

unsigned char *ptr;
pci_write_config_dword(pdev, PCI_ROM_ADDRESS, 0xe8000001);
ptr = ioremap(0xe8000000, 0x10000);

if this were correct, ptr[0] would be 0x55 and ptr[1] would be 0xaa,
however, I read 0xff, 0xff respectively.

Any Suggestions?

Thank you, Martin Murray


- What is Industrial Music? It's the sound of angry
  Belgians having a fight with a washing machine.
Fear: Seeing B8:00:4C:CD:21, and knowing what it means.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

accessing ROM on Rage 128 chips in aty128fb

Post by Jon Burges » Tue, 01 Apr 2003 20:20:17



 > Why does the linux PCI code not set up a mapping for the ROM
 > automatically?

It expects the BIOS to do it. You can force it to try with the option
"pci=rom"

Assuming this is the active grahpics card, then you should be able to
access the rom via the legacy VGA address range 0xc0000...0xc7fff which
should be shown in /proc/iomem.

Try:
dd if=/dev/mem skip=768 bs=1k | od -x | more

In these days of integrated peripherals the graphics bios might not even
be attached to the VGA controller. The VGA device in my i810 system
doesn't even report an expansion rom.

 > and found that the X driver maps the ROM through configuration
 > space.

I'm fairly sure the XFree code falls back to the VGA region as well if
it can't find anything else. I think this is true on my machine, the X
log says:
... Primary V_BIOS Segment is 0xc000

        Jon

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

accessing ROM on Rage 128 chips in aty128fb

Post by Martin Murra » Thu, 03 Apr 2003 19:30:12


Jon, Thank you for your reply.

Quote:>  > Why does the linux PCI code not set up a mapping for the ROM
>  > automatically?

> It expects the BIOS to do it. You can force it to try with the option
> "pci=rom"

This worked and I was able to access the BIOS. Is there a method to ask
the pci code to do this from a driver, if pci=rom was not used?

Quote:> Assuming this is the active grahpics card, then you should be able to
> access the rom via the legacy VGA address range 0xc0000...0xc7fff which
> should be shown in /proc/iomem.

This worked, I realized that I was chasing the wrong bug - the code to
find the BIOS was looking for a "R128" signature, where my mobile Rage 128
has an "M3" signature. I patched the driver to search for "M3" as well as
"Rage 128" and it properly found the BIOS and loaded the pll information.
(The mobile version of the Rage 128 is called the Rage M3 Mobility, but it
is still a Rage 128.) Who do I submit this change to?

Unfortunately, the display is still garbage even after loading the correct
information from the BIOS. I have not been able to contact the aty128fb
author, does anyone have any suggestions? My next step is to compare how
the aty128fb driver initializes the display to the way the X4.3.0 server
does, however, this seems very tedious.

Thank you, Martin Murray
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

accessing ROM on Rage 128 chips in aty128fb

Post by Jon Burges » Thu, 03 Apr 2003 19:50:17



> the pci code to do this from a driver, if pci=rom was not used?

  - see below

Quote:> This worked, I realized that I was chasing the wrong bug - the code to
> find the BIOS was looking for a "R128" signature, where my mobile Rage 128
> has an "M3" signature. I patched the driver to search for "M3" as well as

Take a look at the latest code in linux-2.5.66/drivers/video/aty/aty128fb.c

It no longer looks specifically for "R128". Also see the function
aty128_map_ROM() for an example of how the ROM resource assigned
automatically in the latest code.

You could add this to the 2.4 code or try 2.5. I imagine the new driver
code will eventually get backported to 2.4 once it is considered stable.

        Jon

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. ATI Rage 128 Pro (aty128fb) acceleration fix

Hi Marcelo, Hi Ani,

this bug (marc.theaimsgroup.com/?l=linux-fbdev-devel&m=102977461504322&w=2) is
still not fixed in latest -BK 2.4.21.

I had the same errors as mentioned in that email. After that patch applied,
problems are gone and all is working very well.

Patch credits go to Sergey Vlasov.

This fix has been in WOLK for ages.

ciao, Marc

  aty128fb-fix.patch
6K Download

2. Does X assume bandwith is good?

3. 16MB ATI Rage 128 Ultra (Rage 128 Pro Ultra)

4. ToolTalk error ?

5. Rage 128 chip support from XFree86

6. setjmp/longjmp/kill weird problem

7. Echec using FBDev server with ati rage 128 chip...

8. KDM on Mandrake Question

9. ATI Rage 128 XPert 128

10. All-In-Wonder 128 Pro (Rage 128 Pro) X server?

11. Getting the ATI Rage 128 Xpert 128 to work

12. Xwindow for Rage 128 (ati all in wonder 128)

13. Xfree and ATI All-in-wonder 128 or ATI Rage fury 128