* accessing ROM on Rage 128 chips in aty128fb
@ 2003-03-30 23:59 Martin Murray
0 siblings, 0 replies; 4+ messages in thread
From: Martin Murray @ 2003-03-30 23:59 UTC (permalink / raw)
To: linux-kernel
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
Martin Murray, <mmurray@deepthought.org>, :\\//\\//:
- 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: accessing ROM on Rage 128 chips in aty128fb
@ 2003-03-31 18:17 Jon Burgess
2003-04-02 17:21 ` Martin Murray
0 siblings, 1 reply; 4+ messages in thread
From: Jon Burgess @ 2003-03-31 18:17 UTC (permalink / raw)
To: mmurray; +Cc: linux-kernel
Martin Murray (mmurray@deepthought.org) wrote:
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: accessing ROM on Rage 128 chips in aty128fb
2003-03-31 18:17 accessing ROM on Rage 128 chips in aty128fb Jon Burgess
@ 2003-04-02 17:21 ` Martin Murray
2003-04-02 17:42 ` Jon Burgess
0 siblings, 1 reply; 4+ messages in thread
From: Martin Murray @ 2003-04-02 17:21 UTC (permalink / raw)
To: Jon Burgess; +Cc: linux-kernel
Jon, Thank you for your reply.
> > 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?
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: accessing ROM on Rage 128 chips in aty128fb
2003-04-02 17:21 ` Martin Murray
@ 2003-04-02 17:42 ` Jon Burgess
0 siblings, 0 replies; 4+ messages in thread
From: Jon Burgess @ 2003-04-02 17:42 UTC (permalink / raw)
To: Martin Murray; +Cc: linux-kernel
Martin Murray wrote:
> the pci code to do this from a driver, if pci=rom was not used?
- see below
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-04-02 17:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-31 18:17 accessing ROM on Rage 128 chips in aty128fb Jon Burgess
2003-04-02 17:21 ` Martin Murray
2003-04-02 17:42 ` Jon Burgess
-- strict thread matches above, loose matches on Subject: below --
2003-03-30 23:59 Martin Murray
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox