Commit 0a32241d authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau: pass address to object accessor functions as u64

Will be required by future work.  Make the API change now to catch any
(but hopefully none) unexpected fallout.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 66bb7e1d
......@@ -183,7 +183,7 @@ _nouveau_gpuobj_fini(struct nouveau_object *object, bool suspend)
}
u32
_nouveau_gpuobj_rd32(struct nouveau_object *object, u32 addr)
_nouveau_gpuobj_rd32(struct nouveau_object *object, u64 addr)
{
struct nouveau_gpuobj *gpuobj = nv_gpuobj(object);
struct nouveau_ofuncs *pfuncs = nv_ofuncs(gpuobj->parent);
......@@ -193,7 +193,7 @@ _nouveau_gpuobj_rd32(struct nouveau_object *object, u32 addr)
}
void
_nouveau_gpuobj_wr32(struct nouveau_object *object, u32 addr, u32 data)
_nouveau_gpuobj_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
struct nouveau_gpuobj *gpuobj = nv_gpuobj(object);
struct nouveau_ofuncs *pfuncs = nv_ofuncs(gpuobj->parent);
......
......@@ -119,14 +119,14 @@ _nouveau_fifo_channel_dtor(struct nouveau_object *object)
}
u32
_nouveau_fifo_channel_rd32(struct nouveau_object *object, u32 addr)
_nouveau_fifo_channel_rd32(struct nouveau_object *object, u64 addr)
{
struct nouveau_fifo_chan *chan = (void *)object;
return ioread32_native(chan->user + addr);
}
void
_nouveau_fifo_channel_wr32(struct nouveau_object *object, u32 addr, u32 data)
_nouveau_fifo_channel_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
struct nouveau_fifo_chan *chan = (void *)object;
iowrite32_native(data, chan->user + addr);
......
......@@ -65,7 +65,7 @@ nouveau_gpuobj_ref(struct nouveau_gpuobj *obj, struct nouveau_gpuobj **ref)
void _nouveau_gpuobj_dtor(struct nouveau_object *);
int _nouveau_gpuobj_init(struct nouveau_object *);
int _nouveau_gpuobj_fini(struct nouveau_object *, bool);
u32 _nouveau_gpuobj_rd32(struct nouveau_object *, u32);
void _nouveau_gpuobj_wr32(struct nouveau_object *, u32, u32);
u32 _nouveau_gpuobj_rd32(struct nouveau_object *, u64);
void _nouveau_gpuobj_wr32(struct nouveau_object *, u64, u32);
#endif
......@@ -81,12 +81,12 @@ struct nouveau_ofuncs {
void (*dtor)(struct nouveau_object *);
int (*init)(struct nouveau_object *);
int (*fini)(struct nouveau_object *, bool suspend);
u8 (*rd08)(struct nouveau_object *, u32 offset);
u16 (*rd16)(struct nouveau_object *, u32 offset);
u32 (*rd32)(struct nouveau_object *, u32 offset);
void (*wr08)(struct nouveau_object *, u32 offset, u8 data);
void (*wr16)(struct nouveau_object *, u32 offset, u16 data);
void (*wr32)(struct nouveau_object *, u32 offset, u32 data);
u8 (*rd08)(struct nouveau_object *, u64 offset);
u16 (*rd16)(struct nouveau_object *, u64 offset);
u32 (*rd32)(struct nouveau_object *, u64 offset);
void (*wr08)(struct nouveau_object *, u64 offset, u8 data);
void (*wr16)(struct nouveau_object *, u64 offset, u16 data);
void (*wr32)(struct nouveau_object *, u64 offset, u32 data);
};
static inline struct nouveau_ofuncs *
......@@ -123,7 +123,7 @@ nv_call(void *obj, u32 mthd, u32 data)
}
static inline u8
nv_ro08(void *obj, u32 addr)
nv_ro08(void *obj, u64 addr)
{
u8 data = nv_ofuncs(obj)->rd08(obj, addr);
nv_spam(obj, "nv_ro08 0x%08x 0x%02x\n", addr, data);
......@@ -131,7 +131,7 @@ nv_ro08(void *obj, u32 addr)
}
static inline u16
nv_ro16(void *obj, u32 addr)
nv_ro16(void *obj, u64 addr)
{
u16 data = nv_ofuncs(obj)->rd16(obj, addr);
nv_spam(obj, "nv_ro16 0x%08x 0x%04x\n", addr, data);
......@@ -139,7 +139,7 @@ nv_ro16(void *obj, u32 addr)
}
static inline u32
nv_ro32(void *obj, u32 addr)
nv_ro32(void *obj, u64 addr)
{
u32 data = nv_ofuncs(obj)->rd32(obj, addr);
nv_spam(obj, "nv_ro32 0x%08x 0x%08x\n", addr, data);
......@@ -147,28 +147,28 @@ nv_ro32(void *obj, u32 addr)
}
static inline void
nv_wo08(void *obj, u32 addr, u8 data)
nv_wo08(void *obj, u64 addr, u8 data)
{
nv_spam(obj, "nv_wo08 0x%08x 0x%02x\n", addr, data);
nv_ofuncs(obj)->wr08(obj, addr, data);
}
static inline void
nv_wo16(void *obj, u32 addr, u16 data)
nv_wo16(void *obj, u64 addr, u16 data)
{
nv_spam(obj, "nv_wo16 0x%08x 0x%04x\n", addr, data);
nv_ofuncs(obj)->wr16(obj, addr, data);
}
static inline void
nv_wo32(void *obj, u32 addr, u32 data)
nv_wo32(void *obj, u64 addr, u32 data)
{
nv_spam(obj, "nv_wo32 0x%08x 0x%08x\n", addr, data);
nv_ofuncs(obj)->wr32(obj, addr, data);
}
static inline u32
nv_mo32(void *obj, u32 addr, u32 mask, u32 data)
nv_mo32(void *obj, u64 addr, u32 mask, u32 data)
{
u32 temp = nv_ro32(obj, addr);
nv_wo32(obj, addr, (temp & ~mask) | data);
......
......@@ -40,8 +40,8 @@ void nouveau_fifo_channel_destroy(struct nouveau_fifo_chan *);
#define _nouveau_fifo_channel_fini _nouveau_namedb_fini
void _nouveau_fifo_channel_dtor(struct nouveau_object *);
u32 _nouveau_fifo_channel_rd32(struct nouveau_object *, u32);
void _nouveau_fifo_channel_wr32(struct nouveau_object *, u32, u32);
u32 _nouveau_fifo_channel_rd32(struct nouveau_object *, u64);
void _nouveau_fifo_channel_wr32(struct nouveau_object *, u64, u32);
struct nouveau_fifo_base {
struct nouveau_gpuobj base;
......
......@@ -65,14 +65,14 @@ nouveau_barobj_dtor(struct nouveau_object *object)
}
static u32
nouveau_barobj_rd32(struct nouveau_object *object, u32 addr)
nouveau_barobj_rd32(struct nouveau_object *object, u64 addr)
{
struct nouveau_barobj *barobj = (void *)object;
return ioread32_native(barobj->iomem + addr);
}
static void
nouveau_barobj_wr32(struct nouveau_object *object, u32 addr, u32 data)
nouveau_barobj_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
struct nouveau_barobj *barobj = (void *)object;
iowrite32_native(data, barobj->iomem + addr);
......
......@@ -366,42 +366,42 @@ nouveau_bios_shadow(struct nouveau_bios *bios)
}
static u8
nouveau_bios_rd08(struct nouveau_object *object, u32 addr)
nouveau_bios_rd08(struct nouveau_object *object, u64 addr)
{
struct nouveau_bios *bios = (void *)object;
return bios->data[addr];
}
static u16
nouveau_bios_rd16(struct nouveau_object *object, u32 addr)
nouveau_bios_rd16(struct nouveau_object *object, u64 addr)
{
struct nouveau_bios *bios = (void *)object;
return get_unaligned_le16(&bios->data[addr]);
}
static u32
nouveau_bios_rd32(struct nouveau_object *object, u32 addr)
nouveau_bios_rd32(struct nouveau_object *object, u64 addr)
{
struct nouveau_bios *bios = (void *)object;
return get_unaligned_le32(&bios->data[addr]);
}
static void
nouveau_bios_wr08(struct nouveau_object *object, u32 addr, u8 data)
nouveau_bios_wr08(struct nouveau_object *object, u64 addr, u8 data)
{
struct nouveau_bios *bios = (void *)object;
bios->data[addr] = data;
}
static void
nouveau_bios_wr16(struct nouveau_object *object, u32 addr, u16 data)
nouveau_bios_wr16(struct nouveau_object *object, u64 addr, u16 data)
{
struct nouveau_bios *bios = (void *)object;
put_unaligned_le16(data, &bios->data[addr]);
}
static void
nouveau_bios_wr32(struct nouveau_object *object, u32 addr, u32 data)
nouveau_bios_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
struct nouveau_bios *bios = (void *)object;
put_unaligned_le32(data, &bios->data[addr]);
......
......@@ -356,37 +356,37 @@ nouveau_devobj_fini(struct nouveau_object *object, bool suspend)
}
static u8
nouveau_devobj_rd08(struct nouveau_object *object, u32 addr)
nouveau_devobj_rd08(struct nouveau_object *object, u64 addr)
{
return nv_rd08(object->engine, addr);
}
static u16
nouveau_devobj_rd16(struct nouveau_object *object, u32 addr)
nouveau_devobj_rd16(struct nouveau_object *object, u64 addr)
{
return nv_rd16(object->engine, addr);
}
static u32
nouveau_devobj_rd32(struct nouveau_object *object, u32 addr)
nouveau_devobj_rd32(struct nouveau_object *object, u64 addr)
{
return nv_rd32(object->engine, addr);
}
static void
nouveau_devobj_wr08(struct nouveau_object *object, u32 addr, u8 data)
nouveau_devobj_wr08(struct nouveau_object *object, u64 addr, u8 data)
{
nv_wr08(object->engine, addr, data);
}
static void
nouveau_devobj_wr16(struct nouveau_object *object, u32 addr, u16 data)
nouveau_devobj_wr16(struct nouveau_object *object, u64 addr, u16 data)
{
nv_wr16(object->engine, addr, data);
}
static void
nouveau_devobj_wr32(struct nouveau_object *object, u32 addr, u32 data)
nouveau_devobj_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
nv_wr32(object->engine, addr, data);
}
......
......@@ -63,14 +63,14 @@ nv04_instobj_dtor(struct nouveau_object *object)
}
static u32
nv04_instobj_rd32(struct nouveau_object *object, u32 addr)
nv04_instobj_rd32(struct nouveau_object *object, u64 addr)
{
struct nv04_instobj_priv *node = (void *)object;
return nv_ro32(object->engine, node->mem->offset + addr);
}
static void
nv04_instobj_wr32(struct nouveau_object *object, u32 addr, u32 data)
nv04_instobj_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
struct nv04_instobj_priv *node = (void *)object;
nv_wo32(object->engine, node->mem->offset + addr, data);
......@@ -173,13 +173,13 @@ nv04_instmem_dtor(struct nouveau_object *object)
}
static u32
nv04_instmem_rd32(struct nouveau_object *object, u32 addr)
nv04_instmem_rd32(struct nouveau_object *object, u64 addr)
{
return nv_rd32(object, 0x700000 + addr);
}
static void
nv04_instmem_wr32(struct nouveau_object *object, u32 addr, u32 data)
nv04_instmem_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
return nv_wr32(object, 0x700000 + addr, data);
}
......
......@@ -111,14 +111,14 @@ nv40_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
}
static u32
nv40_instmem_rd32(struct nouveau_object *object, u32 addr)
nv40_instmem_rd32(struct nouveau_object *object, u64 addr)
{
struct nv04_instmem_priv *priv = (void *)object;
return ioread32_native(priv->iomem + addr);
}
static void
nv40_instmem_wr32(struct nouveau_object *object, u32 addr, u32 data)
nv40_instmem_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
struct nv04_instmem_priv *priv = (void *)object;
iowrite32_native(data, priv->iomem + addr);
......
......@@ -76,7 +76,7 @@ nv50_instobj_dtor(struct nouveau_object *object)
}
static u32
nv50_instobj_rd32(struct nouveau_object *object, u32 offset)
nv50_instobj_rd32(struct nouveau_object *object, u64 offset)
{
struct nv50_instmem_priv *priv = (void *)object->engine;
struct nv50_instobj_priv *node = (void *)object;
......@@ -96,7 +96,7 @@ nv50_instobj_rd32(struct nouveau_object *object, u32 offset)
}
static void
nv50_instobj_wr32(struct nouveau_object *object, u32 offset, u32 data)
nv50_instobj_wr32(struct nouveau_object *object, u64 offset, u32 data)
{
struct nv50_instmem_priv *priv = (void *)object->engine;
struct nv50_instobj_priv *node = (void *)object;
......
......@@ -34,14 +34,14 @@
#include <subdev/fb.h>
static u32
nv50_evo_rd32(struct nouveau_object *object, u32 addr)
nv50_evo_rd32(struct nouveau_object *object, u64 addr)
{
void __iomem *iomem = object->oclass->ofuncs->rd08;
return ioread32_native(iomem + addr);
}
static void
nv50_evo_wr32(struct nouveau_object *object, u32 addr, u32 data)
nv50_evo_wr32(struct nouveau_object *object, u64 addr, u32 data)
{
void __iomem *iomem = object->oclass->ofuncs->rd08;
iowrite32_native(data, iomem + addr);
......
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