[gPXE] [PATCH] [rtl818x] Remove broken mmio register support
Joshua Oreman
oremanj at rwcr.net
Mon Jan 25 04:28:35 EST 2010
On Mon, Jan 25, 2010 at 4:14 AM, Stefan Hajnoczi <stefanha at gmail.com> wrote:
> On Sat, Jan 23, 2010 at 8:34 AM, Joshua Oreman <oremanj at rwcr.net> wrote:
>> Is this patch based on theory or do you have a testcase for it?
>
> I don't have rtl818x hardware for testing, but the code in gPXE is not
> equivalent to that in Linux. I spotted this issue when grepping for
> membase and pci_bar_size() usage in gPXE.
>
> [ . . . ]
>
> The gPXE code is not equivalent since we don't have
> pci_iomap()/ioread*()/iowrite*(). The gPXE code always uses the programmed I/O
> functions:
> static inline u32 rtl818x_ioread32(struct rtl818x_priv *priv __unused,
> u32 *addr)
> {
> return inl(addr);
> }
>
> Passing a memory address to inl() does not work. It is like trying to use a
> MAC address as an IP address - they are different address spaces.
This much I know :-)
> The patch I posted simply removes the memory-mapped I/O fallback. We could
> make rtl818x_ioread*/rtl818x_iowrite* conditional or introduce the pci_iomap
> API into gPXE instead.
Thank you for spotting this; I didn't realize ioread* were different
from in*/out* in Linux. Since it hasn't caused issues yet, I'm
inclined to let the MMIO interface die according to your patch. We can
bring it back in the form you suggest if any cards actually use it.
Signed-off-by: Joshua Oreman <oremanj at rwcr.net>
-- Josh
More information about the gPXE
mailing list