Commit 38150012 authored by David S. Miller's avatar David S. Miller

[SPARC64]: __iomem annotations and iomap implementation.

parent 0490a31f
......@@ -17,7 +17,7 @@
#include <asm/auxio.h>
/* This cannot be static, as it is referenced in entry.S */
unsigned long auxio_register = 0UL;
void __iomem *auxio_register = 0UL;
enum auxio_type {
AUXIO_TYPE_NODEV,
......@@ -30,7 +30,7 @@ static spinlock_t auxio_lock = SPIN_LOCK_UNLOCKED;
static void __auxio_sbus_set(u8 bits_on, u8 bits_off)
{
if(auxio_register) {
if (auxio_register) {
unsigned char regval;
unsigned long flags;
unsigned char newval;
......@@ -49,7 +49,7 @@ static void __auxio_sbus_set(u8 bits_on, u8 bits_off)
static void __auxio_ebus_set(u8 bits_on, u8 bits_off)
{
if(auxio_register) {
if (auxio_register) {
unsigned char regval;
unsigned long flags;
unsigned char newval;
......@@ -126,7 +126,8 @@ void __init auxio_probe(void)
if (sdev) {
auxio_devtype = AUXIO_TYPE_SBUS;
auxio_register = sbus_ioremap(&sdev->resource[0], 0,
sdev->reg_addrs[0].reg_size, "auxiliaryIO");
sdev->reg_addrs[0].reg_size,
"auxiliaryIO");
}
#ifdef CONFIG_PCI
else {
......@@ -142,7 +143,7 @@ void __init auxio_probe(void)
ebus_done:
if (edev) {
auxio_devtype = AUXIO_TYPE_EBUS;
auxio_register = (unsigned long)
auxio_register =
ioremap(edev->resource[0].start, sizeof(u32));
}
}
......
......@@ -1171,7 +1171,7 @@ static void __init tomatillo_register_error_handlers(struct pci_controller_info
prom_halt();
}
bucket = __bucket(irq);
tmp = readl(bucket->imap);
tmp = upa_readl(bucket->imap);
upa_writel(tmp, (pbm->pbm_regs +
schizo_imap_offset(SCHIZO_UE_INO) + 4));
......@@ -1309,7 +1309,7 @@ static void __init schizo_register_error_handlers(struct pci_controller_info *p)
prom_halt();
}
bucket = __bucket(irq);
tmp = readl(bucket->imap);
tmp = upa_readl(bucket->imap);
upa_writel(tmp, (pbm->pbm_regs + schizo_imap_offset(SCHIZO_UE_INO) + 4));
pbm = pbm_for_ino(p, SCHIZO_CE_INO);
......
......@@ -27,7 +27,7 @@
int scons_pwroff = 1;
#ifdef CONFIG_PCI
static unsigned long power_reg = 0UL;
static void __iomem *power_reg;
static DECLARE_WAIT_QUEUE_HEAD(powerd_wait);
static int button_pressed;
......@@ -52,7 +52,7 @@ void machine_power_off(void)
{
if (!serial_console || scons_pwroff) {
#ifdef CONFIG_PCI
if (power_reg != 0UL) {
if (power_reg) {
/* Both register bits seem to have the
* same effect, so until I figure out
* what the difference is...
......@@ -130,8 +130,8 @@ void __init power_init(void)
return;
found:
power_reg = (unsigned long)ioremap(edev->resource[0].start, 0x4);
printk("power: Control reg at %016lx ... ", power_reg);
power_reg = ioremap(edev->resource[0].start, 0x4);
printk("power: Control reg at %p ... ", power_reg);
poweroff_method = machine_halt; /* able to use the standard halt */
if (has_button_interrupt(edev)) {
if (kernel_thread(powerd, NULL, CLONE_FS) < 0) {
......
......@@ -12,7 +12,7 @@ lib-y := PeeCeeI.o copy_page.o clear_page.o strlen.o strncmp.o \
U1memcpy.o U1copy_from_user.o U1copy_to_user.o \
U3memcpy.o U3copy_from_user.o U3copy_to_user.o U3patch.o \
copy_in_user.o user_fixup.o memmove.o \
mcount.o ipcsum.o rwsem.o xor.o find_bit.o delay.o
mcount.o ipcsum.o rwsem.o xor.o find_bit.o delay.o iomap.o
lib-$(CONFIG_DEBUG_SPINLOCK) += debuglocks.o
lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o
/*
* Implement the sparc64 iomap interfaces
*/
#include <linux/pci.h>
#include <linux/module.h>
#include <asm/io.h>
/* Create a virtual mapping cookie for an IO port range */
void __iomem *ioport_map(unsigned long port, unsigned int nr)
{
return (void __iomem *) (unsigned long) port;
}
void ioport_unmap(void __iomem *addr)
{
/* Nothing to do */
}
EXPORT_SYMBOL(ioport_map);
EXPORT_SYMBOL(ioport_unmap);
/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
{
unsigned long start = pci_resource_start(dev, bar);
unsigned long len = pci_resource_len(dev, bar);
unsigned long flags = pci_resource_flags(dev, bar);
if (!len || !start)
return NULL;
if (maxlen && len > maxlen)
len = maxlen;
if (flags & IORESOURCE_IO)
return ioport_map(start, len);
if (flags & IORESOURCE_MEM) {
if (flags & IORESOURCE_CACHEABLE)
return ioremap(start, len);
return ioremap_nocache(start, len);
}
/* What? */
return NULL;
}
void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
{
/* nothing to do */
}
EXPORT_SYMBOL(pci_iomap);
EXPORT_SYMBOL(pci_iounmap);
......@@ -53,7 +53,7 @@ struct linux_ebus {
struct ebus_dma_info {
spinlock_t lock;
unsigned long regs;
void __iomem *regs;
unsigned int flags;
#define EBUS_DMA_FLAG_USE_EBDMA_HANDLER 0x00000001
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment