Skip to contentSkip to conversation

ebus & ioremap?

DISCUSSION Meelis Roos 3 participants 3 messages Mar 10, 2005 – Mar 11, 2005

lore
Share & tools
lore
#0 lore raw

While trying to see if I can cleanly fix the iomem warnings for sparc floppy, I came to stop ath this code at asm/floppy.5:653

                 /* XXX ioremap */
                 sun_pci_fd_ebus_dma.regs = edev->resource[1].start;

I can understand why someone did put a XXX there but why does it work this way?

Signature · 1 line
Meelis Roos ([email protected])
#1 lore raw
Quoted 8 lines · On Thu, 10 Mar 2005 14:42:56 +0200 (EET) Meelis Roos <[email protected]> wrote:

While trying to see if I can cleanly fix the iomem warnings for sparc floppy, I came to stop ath this code at asm/floppy.5:653

                 /* XXX ioremap */
                 sun_pci_fd_ebus_dma.regs = edev->resource[1].start;

I can understand why someone did put a XXX there but why does it work this way?

On sparc64, we store the physical I/O address in the resources, and that is what the I/O accessor routines take as well.

Therefore ioremap() just pass the address through unchanged, they are just a NOP.

#2 lore raw
In reply to Meelis Roos

From asm/io.h:

/* On sparc64 we have the whole physical IO address space accessible
* using physically addressed loads and stores, so this does nothing. */
static inline void __iomem *ioremap(unsigned long offset, unsigned long size)

{
    return (void __iomem *)offset;
}

It is nice to use ioremap to remain idiomatic with other architectures, though, esp. in drivers and the like.

E

Quoted 16 lines · Meelis Roos

While trying to see if I can cleanly fix the iomem warnings for sparc floppy, I came to stop ath this code at asm/floppy.5:653

                 /* XXX ioremap */
                 sun_pci_fd_ebus_dma.regs = edev->resource[1].start;

I can understand why someone did put a XXX there but why does it work this way?

--
Meelis Roos ([email protected])
-
To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 1 line
E