Commit 2f03b375 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] pmac iomem annotations

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9103e0b4
...@@ -117,10 +117,10 @@ static const char* macio_names[] __pmacdata = ...@@ -117,10 +117,10 @@ static const char* macio_names[] __pmacdata =
#define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v))) #define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v)))
static struct device_node* uninorth_node __pmacdata; static struct device_node* uninorth_node __pmacdata;
static u32* uninorth_base __pmacdata; static u32 __iomem * uninorth_base __pmacdata;
static u32 uninorth_rev __pmacdata; static u32 uninorth_rev __pmacdata;
static int uninorth_u3 __pmacdata; static int uninorth_u3 __pmacdata;
static void *u3_ht; static void __iomem *u3_ht;
/* /*
* For each motherboard family, we have a table of functions pointers * For each motherboard family, we have a table of functions pointers
...@@ -517,7 +517,7 @@ dbdma_save(struct macio_chip* macio, struct dbdma_regs* save) ...@@ -517,7 +517,7 @@ dbdma_save(struct macio_chip* macio, struct dbdma_regs* save)
/* Save state & config of DBDMA channels */ /* Save state & config of DBDMA channels */
for (i=0; i<13; i++) { for (i=0; i<13; i++) {
volatile struct dbdma_regs* chan = (volatile struct dbdma_regs*) volatile struct dbdma_regs __iomem * chan = (void __iomem *)
(macio->base + ((0x8000+i*0x100)>>2)); (macio->base + ((0x8000+i*0x100)>>2));
save[i].cmdptr_hi = in_le32(&chan->cmdptr_hi); save[i].cmdptr_hi = in_le32(&chan->cmdptr_hi);
save[i].cmdptr = in_le32(&chan->cmdptr); save[i].cmdptr = in_le32(&chan->cmdptr);
...@@ -534,7 +534,7 @@ dbdma_restore(struct macio_chip* macio, struct dbdma_regs* save) ...@@ -534,7 +534,7 @@ dbdma_restore(struct macio_chip* macio, struct dbdma_regs* save)
/* Save state & config of DBDMA channels */ /* Save state & config of DBDMA channels */
for (i=0; i<13; i++) { for (i=0; i<13; i++) {
volatile struct dbdma_regs* chan = (volatile struct dbdma_regs*) volatile struct dbdma_regs __iomem * chan = (void __iomem *)
(macio->base + ((0x8000+i*0x100)>>2)); (macio->base + ((0x8000+i*0x100)>>2));
out_le32(&chan->control, (ACTIVE|DEAD|WAKE|FLUSH|PAUSE|RUN)<<16); out_le32(&chan->control, (ACTIVE|DEAD|WAKE|FLUSH|PAUSE|RUN)<<16);
while (in_le32(&chan->status) & ACTIVE) while (in_le32(&chan->status) & ACTIVE)
...@@ -2286,14 +2286,14 @@ probe_motherboard(void) ...@@ -2286,14 +2286,14 @@ probe_motherboard(void)
#ifndef CONFIG_POWER4 #ifndef CONFIG_POWER4
/* Fixup Hooper vs. Comet */ /* Fixup Hooper vs. Comet */
if (pmac_mb.model_id == PMAC_TYPE_HOOPER) { if (pmac_mb.model_id == PMAC_TYPE_HOOPER) {
u32* mach_id_ptr = (u32*)ioremap(0xf3000034, 4); u32 __iomem * mach_id_ptr = ioremap(0xf3000034, 4);
if (!mach_id_ptr) if (!mach_id_ptr)
return -ENODEV; return -ENODEV;
/* Here, I used to disable the media-bay on comet. It /* Here, I used to disable the media-bay on comet. It
* appears this is wrong, the floppy connector is actually * appears this is wrong, the floppy connector is actually
* a kind of media-bay and works with the current driver. * a kind of media-bay and works with the current driver.
*/ */
if ((*mach_id_ptr) & 0x20000000UL) if (__raw_readl(mach_id_ptr) & 0x20000000UL)
pmac_mb.model_id = PMAC_TYPE_COMET; pmac_mb.model_id = PMAC_TYPE_COMET;
iounmap(mach_id_ptr); iounmap(mach_id_ptr);
} }
...@@ -2394,7 +2394,7 @@ probe_one_macio(const char* name, const char* compat, int type) ...@@ -2394,7 +2394,7 @@ probe_one_macio(const char* name, const char* compat, int type)
{ {
struct device_node* node; struct device_node* node;
int i; int i;
volatile u32* base; volatile u32 __iomem * base;
u32* revp; u32* revp;
node = find_devices(name); node = find_devices(name);
...@@ -2419,7 +2419,7 @@ probe_one_macio(const char* name, const char* compat, int type) ...@@ -2419,7 +2419,7 @@ probe_one_macio(const char* name, const char* compat, int type)
printk(KERN_ERR "pmac_feature: %s skipped\n", node->full_name); printk(KERN_ERR "pmac_feature: %s skipped\n", node->full_name);
return; return;
} }
base = (volatile u32*)ioremap(node->addrs[0].address, node->addrs[0].size); base = ioremap(node->addrs[0].address, node->addrs[0].size);
if (!base) { if (!base) {
printk(KERN_ERR "pmac_feature: Can't map mac-io chip !\n"); printk(KERN_ERR "pmac_feature: Can't map mac-io chip !\n");
return; return;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
static unsigned long anslcd_short_delay = 80; static unsigned long anslcd_short_delay = 80;
static unsigned long anslcd_long_delay = 3280; static unsigned long anslcd_long_delay = 3280;
static volatile unsigned char* anslcd_ptr; static volatile unsigned char __iomem *anslcd_ptr;
#undef DEBUG #undef DEBUG
...@@ -151,12 +151,12 @@ anslcd_init(void) ...@@ -151,12 +151,12 @@ anslcd_init(void)
if (strcmp(node->parent->name, "gc")) if (strcmp(node->parent->name, "gc"))
return -ENODEV; return -ENODEV;
anslcd_ptr = (volatile unsigned char*)ioremap(ANSLCD_ADDR, 0x20); anslcd_ptr = ioremap(ANSLCD_ADDR, 0x20);
retval = misc_register(&anslcd_dev); retval = misc_register(&anslcd_dev);
if(retval < 0){ if(retval < 0){
printk(KERN_INFO "LCD: misc_register failed\n"); printk(KERN_INFO "LCD: misc_register failed\n");
iounmap((void *)anslcd_ptr); iounmap(anslcd_ptr);
return retval; return retval;
} }
...@@ -179,7 +179,7 @@ static void __exit ...@@ -179,7 +179,7 @@ static void __exit
anslcd_exit(void) anslcd_exit(void)
{ {
misc_deregister(&anslcd_dev); misc_deregister(&anslcd_dev);
iounmap((void *)anslcd_ptr); iounmap(anslcd_ptr);
} }
module_init(anslcd_init); module_init(anslcd_init);
......
...@@ -57,7 +57,7 @@ struct adb_regs { ...@@ -57,7 +57,7 @@ struct adb_regs {
/* Bits in autopoll register */ /* Bits in autopoll register */
#define APE 1 /* autopoll enable */ #define APE 1 /* autopoll enable */
static volatile struct adb_regs *adb; static volatile struct adb_regs __iomem *adb;
static struct adb_request *current_req, *last_req; static struct adb_request *current_req, *last_req;
static spinlock_t macio_lock = SPIN_LOCK_UNLOCKED; static spinlock_t macio_lock = SPIN_LOCK_UNLOCKED;
...@@ -105,8 +105,7 @@ int macio_init(void) ...@@ -105,8 +105,7 @@ int macio_init(void)
printk("\n"); } printk("\n"); }
#endif #endif
adb = (volatile struct adb_regs *) adb = ioremap(adbs->addrs->address, sizeof(struct adb_regs));
ioremap(adbs->addrs->address, sizeof(struct adb_regs));
out_8(&adb->ctrl.r, 0); out_8(&adb->ctrl.r, 0);
out_8(&adb->intr.r, 0); out_8(&adb->intr.r, 0);
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#endif #endif
#define MB_FCR32(bay, r) ((bay)->base + ((r) >> 2)) #define MB_FCR32(bay, r) ((bay)->base + ((r) >> 2))
#define MB_FCR8(bay, r) (((volatile __iomem u8*)((bay)->base)) + (r)) #define MB_FCR8(bay, r) (((volatile u8 __iomem *)((bay)->base)) + (r))
#define MB_IN32(bay,r) (in_le32(MB_FCR32(bay,r))) #define MB_IN32(bay,r) (in_le32(MB_FCR32(bay,r)))
#define MB_OUT32(bay,r,v) (out_le32(MB_FCR32(bay,r), (v))) #define MB_OUT32(bay,r,v) (out_le32(MB_FCR32(bay,r), (v)))
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <asm/system.h> #include <asm/system.h>
#include <linux/init.h> #include <linux/init.h>
static volatile unsigned char *via; static volatile unsigned char __iomem *via;
static spinlock_t cuda_lock = SPIN_LOCK_UNLOCKED; static spinlock_t cuda_lock = SPIN_LOCK_UNLOCKED;
#ifdef CONFIG_MAC #ifdef CONFIG_MAC
...@@ -160,7 +160,7 @@ find_via_cuda(void) ...@@ -160,7 +160,7 @@ find_via_cuda(void)
if (vias->n_addrs < 1 || vias->n_intrs < 1) if (vias->n_addrs < 1 || vias->n_intrs < 1)
return 0; return 0;
} }
via = (volatile unsigned char *) ioremap(vias->addrs->address, 0x2000); via = ioremap(vias->addrs->address, 0x2000);
cuda_state = idle; cuda_state = idle;
sys_ctrler = SYS_CTRLER_CUDA; sys_ctrler = SYS_CTRLER_CUDA;
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
/* How many iterations between battery polls */ /* How many iterations between battery polls */
#define BATTERY_POLLING_COUNT 2 #define BATTERY_POLLING_COUNT 2
static volatile unsigned char *via; static volatile unsigned char __iomem *via;
/* VIA registers - spaced 0x200 bytes apart */ /* VIA registers - spaced 0x200 bytes apart */
#define RS 0x200 /* skip between registers */ #define RS 0x200 /* skip between registers */
...@@ -141,7 +141,7 @@ static struct device_node *vias; ...@@ -141,7 +141,7 @@ static struct device_node *vias;
static int pmu_kind = PMU_UNKNOWN; static int pmu_kind = PMU_UNKNOWN;
static int pmu_fully_inited = 0; static int pmu_fully_inited = 0;
static int pmu_has_adb; static int pmu_has_adb;
static unsigned char *gpio_reg = NULL; static unsigned char __iomem *gpio_reg = NULL;
static int gpio_irq = -1; static int gpio_irq = -1;
static int gpio_irq_enabled = -1; static int gpio_irq_enabled = -1;
static volatile int pmu_suspended = 0; static volatile int pmu_suspended = 0;
...@@ -352,7 +352,7 @@ find_via_pmu(void) ...@@ -352,7 +352,7 @@ find_via_pmu(void)
} else } else
pmu_kind = PMU_UNKNOWN; pmu_kind = PMU_UNKNOWN;
via = (volatile unsigned char *) ioremap(vias->addrs->address, 0x2000); via = ioremap(vias->addrs->address, 0x2000);
out_8(&via[IER], IER_CLR | 0x7f); /* disable all intrs */ out_8(&via[IER], IER_CLR | 0x7f); /* disable all intrs */
out_8(&via[IFR], 0x7f); /* clear IFR */ out_8(&via[IFR], 0x7f); /* clear IFR */
...@@ -1164,7 +1164,7 @@ wait_for_ack(void) ...@@ -1164,7 +1164,7 @@ wait_for_ack(void)
static inline void static inline void
send_byte(int x) send_byte(int x)
{ {
volatile unsigned char *v = via; volatile unsigned char __iomem *v = via;
out_8(&v[ACR], in_8(&v[ACR]) | SR_OUT | SR_EXT); out_8(&v[ACR], in_8(&v[ACR]) | SR_OUT | SR_EXT);
out_8(&v[SR], x); out_8(&v[SR], x);
...@@ -1175,7 +1175,7 @@ send_byte(int x) ...@@ -1175,7 +1175,7 @@ send_byte(int x)
static inline void static inline void
recv_byte(void) recv_byte(void)
{ {
volatile unsigned char *v = via; volatile unsigned char __iomem *v = via;
out_8(&v[ACR], (in_8(&v[ACR]) & ~SR_OUT) | SR_EXT); out_8(&v[ACR], (in_8(&v[ACR]) & ~SR_OUT) | SR_EXT);
in_8(&v[SR]); /* resets SR */ in_8(&v[SR]); /* resets SR */
...@@ -2630,8 +2630,8 @@ powerbook_sleep_3400(void) ...@@ -2630,8 +2630,8 @@ powerbook_sleep_3400(void)
unsigned int hid0; unsigned int hid0;
unsigned long p; unsigned long p;
struct adb_request sleep_req; struct adb_request sleep_req;
char *mem_ctrl; void __iomem *mem_ctrl;
unsigned int *mem_ctrl_sleep; unsigned int __iomem *mem_ctrl_sleep;
/* first map in the memory controller registers */ /* first map in the memory controller registers */
mem_ctrl = ioremap(PB3400_MEM_CTRL, 0x100); mem_ctrl = ioremap(PB3400_MEM_CTRL, 0x100);
...@@ -2639,7 +2639,7 @@ powerbook_sleep_3400(void) ...@@ -2639,7 +2639,7 @@ powerbook_sleep_3400(void)
printk("powerbook_sleep_3400: ioremap failed\n"); printk("powerbook_sleep_3400: ioremap failed\n");
return -ENOMEM; return -ENOMEM;
} }
mem_ctrl_sleep = (unsigned int *) (mem_ctrl + PB3400_MEM_CTRL_SLEEP); mem_ctrl_sleep = mem_ctrl + PB3400_MEM_CTRL_SLEEP;
/* Allocate room for PCI save */ /* Allocate room for PCI save */
pbook_alloc_pci_save(); pbook_alloc_pci_save();
...@@ -2977,7 +2977,7 @@ void pmu_device_init(void) ...@@ -2977,7 +2977,7 @@ void pmu_device_init(void)
#ifdef DEBUG_SLEEP #ifdef DEBUG_SLEEP
static inline void __pmac static inline void __pmac
polled_handshake(volatile unsigned char *via) polled_handshake(volatile unsigned char __iomem *via)
{ {
via[B] &= ~TREQ; eieio(); via[B] &= ~TREQ; eieio();
while ((via[B] & TACK) != 0) while ((via[B] & TACK) != 0)
...@@ -2988,7 +2988,7 @@ polled_handshake(volatile unsigned char *via) ...@@ -2988,7 +2988,7 @@ polled_handshake(volatile unsigned char *via)
} }
static inline void __pmac static inline void __pmac
polled_send_byte(volatile unsigned char *via, int x) polled_send_byte(volatile unsigned char __iomem *via, int x)
{ {
via[ACR] |= SR_OUT | SR_EXT; eieio(); via[ACR] |= SR_OUT | SR_EXT; eieio();
via[SR] = x; eieio(); via[SR] = x; eieio();
...@@ -2996,7 +2996,7 @@ polled_send_byte(volatile unsigned char *via, int x) ...@@ -2996,7 +2996,7 @@ polled_send_byte(volatile unsigned char *via, int x)
} }
static inline int __pmac static inline int __pmac
polled_recv_byte(volatile unsigned char *via) polled_recv_byte(volatile unsigned char __iomem *via)
{ {
int x; int x;
...@@ -3012,7 +3012,7 @@ pmu_polled_request(struct adb_request *req) ...@@ -3012,7 +3012,7 @@ pmu_polled_request(struct adb_request *req)
{ {
unsigned long flags; unsigned long flags;
int i, l, c; int i, l, c;
volatile unsigned char *v = via; volatile unsigned char __iomem *v = via;
req->complete = 1; req->complete = 1;
c = req->data[0]; c = req->data[0];
......
...@@ -315,7 +315,7 @@ struct macio_chip ...@@ -315,7 +315,7 @@ struct macio_chip
int type; int type;
const char *name; const char *name;
int rev; int rev;
volatile u32 *base; volatile u32 __iomem *base;
unsigned long flags; unsigned long flags;
/* For use by macio_asic PCI driver */ /* For use by macio_asic PCI driver */
...@@ -333,7 +333,7 @@ extern struct macio_chip macio_chips[MAX_MACIO_CHIPS]; ...@@ -333,7 +333,7 @@ extern struct macio_chip macio_chips[MAX_MACIO_CHIPS];
extern struct macio_chip* macio_find(struct device_node* child, int type); extern struct macio_chip* macio_find(struct device_node* child, int type);
#define MACIO_FCR32(macio, r) ((macio)->base + ((r) >> 2)) #define MACIO_FCR32(macio, r) ((macio)->base + ((r) >> 2))
#define MACIO_FCR8(macio, r) (((volatile u8*)((macio)->base)) + (r)) #define MACIO_FCR8(macio, r) (((volatile u8 __iomem *)((macio)->base)) + (r))
#define MACIO_IN32(r) (in_le32(MACIO_FCR32(macio,r))) #define MACIO_IN32(r) (in_le32(MACIO_FCR32(macio,r)))
#define MACIO_OUT32(r,v) (out_le32(MACIO_FCR32(macio,r), (v))) #define MACIO_OUT32(r,v) (out_le32(MACIO_FCR32(macio,r), (v)))
......
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