From: Jon Smirl <jonsmirl@yahoo.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: dri-devel <dri-devel@lists.sourceforge.net>,
fb-devel <linux-fbdev-devel@lists.sourceforge.net>
Subject: Re: New kernel API for ROMs
Date: Sat, 7 Aug 2004 07:59:29 -0700 (PDT) [thread overview]
Message-ID: <20040807145929.77135.qmail@web14923.mail.yahoo.com> (raw)
In-Reply-To: <Pine.GSO.4.58.0408071515350.3475@waterleaf.sonytel.be>
Maximum size of a standard PCI ROM is 128KB. On non-x86 platforms the
code will pick the length up from the size of the PCI window. That
window has no limit.
On the other hand, map_rom_copy is only called by the device driver for
a board that has minimal PCI decoding. The PCI spec allows the address
decoding for something like the ROM and framebuffer to be shared. A few
vendors have implemented this and the result is that you can't read the
ROM and framebuffer at the same time. This is why you need to make the
copy. We only know of a couple PCI boards that have implemented this.
This memory is not performance critical and can be swapped, is there a
better way to allocate it?
--- Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Fri, 6 Aug 2004, Jon Smirl wrote:
>
> > This patch provides a new kernel API for access ROMs from device
> > drivers. If you're working on a driver that uses the ROM (most
> video
> > drivers) please give this patch a try and send some feedback/bugs.
> >
> > pci_map_rom() - map the rom and provide virtual address,
> transparently
> > return shadow/copy if needed. Normal drivers call this
> >
> > pci_map_rom_copy() - same as pci_map_rom except the ROM will
> copied,
> > future reads of ROM will use copy. Hardware with minimal decoding
> calls
> > use this
> >
> > pci_unmap_rom() - release the ioremap if there is one
> >
> > The ROMs also appear in sysfs and you can use hexdump to see them.
> >
> > If the Radeon ROM is all FFFF. Load a radeon device driver and it
> will
> > appear. Radeon cards have a bug that loading the driver will fix.
>
> > +unsigned char *
> > +pci_map_rom_copy(struct pci_dev *dev, size_t *size) {
> > + struct resource *res = &dev->resource[PCI_ROM_RESOURCE];
> > + unsigned char *rom;
> > +
> > + rom = pci_map_rom(dev, size);
> > + if (!rom)
> > + return NULL;
> > +
> > + if (res->flags & (PCI_ROM_COPY | PCI_ROM_SHADOW))
> > + return rom;
> > +
> > + res->start = (unsigned long)kmalloc(*size, GFP_KERNEL);
>
> What's the maximum size of a PCI ROM? Larger than kmalloc() can
> handle?
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 --
> geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a
> hacker. But
> when I'm talking to journalists I just say "programmer" or something
> like that.
> -- Linus Torvalds
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by OSTG. Have you noticed the changes
> on
> Linux.com, ITManagersJournal and NewsForge in the past few weeks?
> Now,
> one more big change to announce. We are now OSTG- Open Source
> Technology
> Group. Come see the changes on the new OSTG site. www.ostg.com
> --
> _______________________________________________
> Dri-devel mailing list
> Dri-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dri-devel
>
=====
Jon Smirl
jonsmirl@yahoo.com
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
next prev parent reply other threads:[~2004-08-07 14:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-06 21:21 New kernel API for ROMs Jon Smirl
2004-08-07 13:16 ` Geert Uytterhoeven
2004-08-07 14:59 ` Jon Smirl [this message]
2004-08-07 16:37 ` Kronos
2004-08-07 16:09 ` [Linux-fbdev-devel] " Alan Cox
2004-08-07 17:40 ` Jon Smirl
2004-08-07 18:51 ` Alan Cox
2004-08-07 16:54 ` [Linux-fbdev-devel] " Jon Smirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040807145929.77135.qmail@web14923.mail.yahoo.com \
--to=jonsmirl@yahoo.com \
--cc=dri-devel@lists.sourceforge.net \
--cc=geert@linux-m68k.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).