Commit d390b480 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/bios: namespace + nvidia gpu names (no binary change)

The namespace of NVKM is being changed to nvkm_ instead of nouveau_,
which will be used for the DRM part of the driver.  This is being
done in order to make it very clear as to what part of the driver a
given symbol belongs to, and as a minor step towards splitting the
DRM driver out to be able to stand on its own (for virt).

Because there's already a large amount of churn here anyway, this is
as good a time as any to also switch to NVIDIA's device and chipset
naming to ease collaboration with them.

A comparison of objdump disassemblies proves no code changes.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 245dcfe9
...@@ -193,5 +193,13 @@ ...@@ -193,5 +193,13 @@
#define _nouveau_xtensa_context_rd32 _nvkm_xtensa_context_rd32 #define _nouveau_xtensa_context_rd32 _nvkm_xtensa_context_rd32
#define _nouveau_xtensa_context_wr32 _nvkm_xtensa_context_wr32 #define _nouveau_xtensa_context_wr32 _nvkm_xtensa_context_wr32
#define nouveau_xtensa_intr nvkm_xtensa_intr #define nouveau_xtensa_intr nvkm_xtensa_intr
#define nouveau_gpio nvkm_gpio
#define nouveau_i2c nvkm_i2c
#define nouveau_i2c_port nvkm_i2c_port
#define nouveau_devinit nvkm_devinit
#define nouveau_bios nvkm_bios
#define nouveau_bios_oclass nvkm_bios_oclass
#define nouveau_pll_vals nvkm_pll_vals
#define nouveau_therm_trip_point nvkm_therm_trip_point
#endif #endif
#ifndef __NOUVEAU_BIOS_H__ #ifndef __NVKM_BIOS_H__
#define __NOUVEAU_BIOS_H__ #define __NVKM_BIOS_H__
#include <core/subdev.h> #include <core/subdev.h>
#include <core/device.h>
struct nouveau_bios { struct nvkm_bios {
struct nouveau_subdev base; struct nvkm_subdev base;
u32 size; u32 size;
u8 *data; u8 *data;
...@@ -21,15 +19,14 @@ struct nouveau_bios { ...@@ -21,15 +19,14 @@ struct nouveau_bios {
} version; } version;
}; };
static inline struct nouveau_bios * static inline struct nvkm_bios *
nouveau_bios(void *obj) nvkm_bios(void *obj)
{ {
return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_VBIOS); return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_VBIOS);
} }
u8 nvbios_checksum(const u8 *data, int size); u8 nvbios_checksum(const u8 *data, int size);
u16 nvbios_findstr(const u8 *data, int size, const char *str, int len); u16 nvbios_findstr(const u8 *data, int size, const char *str, int len);
extern struct nouveau_oclass nouveau_bios_oclass; extern struct nvkm_oclass nvkm_bios_oclass;
#endif #endif
#ifndef __NVBIOS_M0203_H__ #ifndef __NVBIOS_M0203_H__
#define __NVBIOS_M0203_H__ #define __NVBIOS_M0203_H__
struct nvbios_M0203T { struct nvbios_M0203T {
#define M0203T_TYPE_RAMCFG 0x00 #define M0203T_TYPE_RAMCFG 0x00
u8 type; u8 type;
u16 pointer; u16 pointer;
}; };
u32 nvbios_M0203Te(struct nouveau_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u32 nvbios_M0203Te(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u32 nvbios_M0203Tp(struct nouveau_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u32 nvbios_M0203Tp(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_M0203T *); struct nvbios_M0203T *);
struct nvbios_M0203E { struct nvbios_M0203E {
...@@ -22,10 +21,9 @@ struct nvbios_M0203E { ...@@ -22,10 +21,9 @@ struct nvbios_M0203E {
u8 group; u8 group;
}; };
u32 nvbios_M0203Ee(struct nouveau_bios *, int idx, u8 *ver, u8 *hdr); u32 nvbios_M0203Ee(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr);
u32 nvbios_M0203Ep(struct nouveau_bios *, int idx, u8 *ver, u8 *hdr, u32 nvbios_M0203Ep(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr,
struct nvbios_M0203E *); struct nvbios_M0203E *);
u32 nvbios_M0203Em(struct nouveau_bios *, u8 ramcfg, u8 *ver, u8 *hdr, u32 nvbios_M0203Em(struct nvkm_bios *, u8 ramcfg, u8 *ver, u8 *hdr,
struct nvbios_M0203E *); struct nvbios_M0203E *);
#endif #endif
#ifndef __NVBIOS_M0205_H__ #ifndef __NVBIOS_M0205_H__
#define __NVBIOS_M0205_H__ #define __NVBIOS_M0205_H__
struct nvbios_M0205T { struct nvbios_M0205T {
u16 freq; u16 freq;
}; };
u32 nvbios_M0205Te(struct nouveau_bios *, u32 nvbios_M0205Te(struct nvkm_bios *,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz); u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz);
u32 nvbios_M0205Tp(struct nouveau_bios *, u32 nvbios_M0205Tp(struct nvkm_bios *,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz,
struct nvbios_M0205T *); struct nvbios_M0205T *);
...@@ -15,18 +14,16 @@ struct nvbios_M0205E { ...@@ -15,18 +14,16 @@ struct nvbios_M0205E {
u8 type; u8 type;
}; };
u32 nvbios_M0205Ee(struct nouveau_bios *, int idx, u32 nvbios_M0205Ee(struct nvkm_bios *, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u32 nvbios_M0205Ep(struct nouveau_bios *, int idx, u32 nvbios_M0205Ep(struct nvkm_bios *, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_M0205E *);
struct nvbios_M0205E *);
struct nvbios_M0205S { struct nvbios_M0205S {
u8 data; u8 data;
}; };
u32 nvbios_M0205Se(struct nouveau_bios *, int ent, int idx, u8 *ver, u8 *hdr); u32 nvbios_M0205Se(struct nvkm_bios *, int ent, int idx, u8 *ver, u8 *hdr);
u32 nvbios_M0205Sp(struct nouveau_bios *, int ent, int idx, u8 *ver, u8 *hdr, u32 nvbios_M0205Sp(struct nvkm_bios *, int ent, int idx, u8 *ver, u8 *hdr,
struct nvbios_M0205S *); struct nvbios_M0205S *);
#endif #endif
#ifndef __NVBIOS_M0209_H__ #ifndef __NVBIOS_M0209_H__
#define __NVBIOS_M0209_H__ #define __NVBIOS_M0209_H__
u32 nvbios_M0209Te(struct nvkm_bios *,
u32 nvbios_M0209Te(struct nouveau_bios *,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz); u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz);
struct nvbios_M0209E { struct nvbios_M0209E {
...@@ -13,18 +12,16 @@ struct nvbios_M0209E { ...@@ -13,18 +12,16 @@ struct nvbios_M0209E {
u8 v03; u8 v03;
}; };
u32 nvbios_M0209Ee(struct nouveau_bios *, int idx, u32 nvbios_M0209Ee(struct nvkm_bios *, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u32 nvbios_M0209Ep(struct nouveau_bios *, int idx, u32 nvbios_M0209Ep(struct nvkm_bios *, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_M0209E *);
struct nvbios_M0209E *);
struct nvbios_M0209S { struct nvbios_M0209S {
u32 data[0x200]; u32 data[0x200];
}; };
u32 nvbios_M0209Se(struct nouveau_bios *, int ent, int idx, u8 *ver, u8 *hdr); u32 nvbios_M0209Se(struct nvkm_bios *, int ent, int idx, u8 *ver, u8 *hdr);
u32 nvbios_M0209Sp(struct nouveau_bios *, int ent, int idx, u8 *ver, u8 *hdr, u32 nvbios_M0209Sp(struct nvkm_bios *, int ent, int idx, u8 *ver, u8 *hdr,
struct nvbios_M0209S *); struct nvbios_M0209S *);
#endif #endif
#ifndef __NVBIOS_P0260_H__ #ifndef __NVBIOS_P0260_H__
#define __NVBIOS_P0260_H__ #define __NVBIOS_P0260_H__
u32 nvbios_P0260Te(struct nvkm_bios *,
u32 nvbios_P0260Te(struct nouveau_bios *,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *xnr, u8 *xsz); u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *xnr, u8 *xsz);
struct nvbios_P0260E { struct nvbios_P0260E {
u32 data; u32 data;
}; };
u32 nvbios_P0260Ee(struct nouveau_bios *, int idx, u8 *ver, u8 *hdr); u32 nvbios_P0260Ee(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr);
u32 nvbios_P0260Ep(struct nouveau_bios *, int idx, u8 *ver, u8 *hdr, u32 nvbios_P0260Ep(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr,
struct nvbios_P0260E *); struct nvbios_P0260E *);
struct nvbios_P0260X { struct nvbios_P0260X {
u32 data; u32 data;
}; };
u32 nvbios_P0260Xe(struct nouveau_bios *, int idx, u8 *ver, u8 *hdr); u32 nvbios_P0260Xe(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr);
u32 nvbios_P0260Xp(struct nouveau_bios *, int idx, u8 *ver, u8 *hdr, u32 nvbios_P0260Xp(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr,
struct nvbios_P0260X *); struct nvbios_P0260X *);
#endif #endif
#ifndef __NVBIOS_BIT_H__ #ifndef __NVBIOS_BIT_H__
#define __NVBIOS_BIT_H__ #define __NVBIOS_BIT_H__
struct bit_entry { struct bit_entry {
u8 id; u8 id;
u8 version; u8 version;
...@@ -8,6 +7,5 @@ struct bit_entry { ...@@ -8,6 +7,5 @@ struct bit_entry {
u16 offset; u16 offset;
}; };
int bit_entry(struct nouveau_bios *, u8 id, struct bit_entry *); int bit_entry(struct nvkm_bios *, u8 id, struct bit_entry *);
#endif #endif
#ifndef __NVBIOS_BMP_H__ #ifndef __NVBIOS_BMP_H__
#define __NVBIOS_BMP_H__ #define __NVBIOS_BMP_H__
static inline u16 static inline u16
bmp_version(struct nouveau_bios *bios) bmp_version(struct nvkm_bios *bios)
{ {
if (bios->bmp_offset) { if (bios->bmp_offset) {
return nv_ro08(bios, bios->bmp_offset + 5) << 8 | return nv_ro08(bios, bios->bmp_offset + 5) << 8 |
...@@ -13,7 +12,7 @@ bmp_version(struct nouveau_bios *bios) ...@@ -13,7 +12,7 @@ bmp_version(struct nouveau_bios *bios)
} }
static inline u16 static inline u16
bmp_mem_init_table(struct nouveau_bios *bios) bmp_mem_init_table(struct nvkm_bios *bios)
{ {
if (bmp_version(bios) >= 0x0300) if (bmp_version(bios) >= 0x0300)
return nv_ro16(bios, bios->bmp_offset + 24); return nv_ro16(bios, bios->bmp_offset + 24);
...@@ -21,7 +20,7 @@ bmp_mem_init_table(struct nouveau_bios *bios) ...@@ -21,7 +20,7 @@ bmp_mem_init_table(struct nouveau_bios *bios)
} }
static inline u16 static inline u16
bmp_sdr_seq_table(struct nouveau_bios *bios) bmp_sdr_seq_table(struct nvkm_bios *bios)
{ {
if (bmp_version(bios) >= 0x0300) if (bmp_version(bios) >= 0x0300)
return nv_ro16(bios, bios->bmp_offset + 26); return nv_ro16(bios, bios->bmp_offset + 26);
...@@ -29,11 +28,10 @@ bmp_sdr_seq_table(struct nouveau_bios *bios) ...@@ -29,11 +28,10 @@ bmp_sdr_seq_table(struct nouveau_bios *bios)
} }
static inline u16 static inline u16
bmp_ddr_seq_table(struct nouveau_bios *bios) bmp_ddr_seq_table(struct nvkm_bios *bios)
{ {
if (bmp_version(bios) >= 0x0300) if (bmp_version(bios) >= 0x0300)
return nv_ro16(bios, bios->bmp_offset + 28); return nv_ro16(bios, bios->bmp_offset + 28);
return 0x0000; return 0x0000;
} }
#endif #endif
#ifndef __NVBIOS_BOOST_H__ #ifndef __NVBIOS_BOOST_H__
#define __NVBIOS_BOOST_H__ #define __NVBIOS_BOOST_H__
u16 nvbios_boostTe(struct nvkm_bios *, u8 *, u8 *, u8 *, u8 *, u8 *, u8 *);
u16 nvbios_boostTe(struct nouveau_bios *, u8 *, u8 *, u8 *, u8 *, u8 *, u8 *);
struct nvbios_boostE { struct nvbios_boostE {
u8 pstate; u8 pstate;
...@@ -9,10 +8,10 @@ struct nvbios_boostE { ...@@ -9,10 +8,10 @@ struct nvbios_boostE {
u32 max; u32 max;
}; };
u16 nvbios_boostEe(struct nouveau_bios *, int idx, u8 *, u8 *, u8 *, u8 *); u16 nvbios_boostEe(struct nvkm_bios *, int idx, u8 *, u8 *, u8 *, u8 *);
u16 nvbios_boostEp(struct nouveau_bios *, int idx, u8 *, u8 *, u8 *, u8 *, u16 nvbios_boostEp(struct nvkm_bios *, int idx, u8 *, u8 *, u8 *, u8 *,
struct nvbios_boostE *); struct nvbios_boostE *);
u16 nvbios_boostEm(struct nouveau_bios *, u8, u8 *, u8 *, u8 *, u8 *, u16 nvbios_boostEm(struct nvkm_bios *, u8, u8 *, u8 *, u8 *, u8 *,
struct nvbios_boostE *); struct nvbios_boostE *);
struct nvbios_boostS { struct nvbios_boostS {
...@@ -22,8 +21,7 @@ struct nvbios_boostS { ...@@ -22,8 +21,7 @@ struct nvbios_boostS {
u32 max; u32 max;
}; };
u16 nvbios_boostSe(struct nouveau_bios *, int, u16, u8 *, u8 *, u8, u8); u16 nvbios_boostSe(struct nvkm_bios *, int, u16, u8 *, u8 *, u8, u8);
u16 nvbios_boostSp(struct nouveau_bios *, int, u16, u8 *, u8 *, u8, u8, u16 nvbios_boostSp(struct nvkm_bios *, int, u16, u8 *, u8 *, u8, u8,
struct nvbios_boostS *); struct nvbios_boostS *);
#endif #endif
#ifndef __NVBIOS_CONN_H__ #ifndef __NVBIOS_CONN_H__
#define __NVBIOS_CONN_H__ #define __NVBIOS_CONN_H__
enum dcb_connector_type { enum dcb_connector_type {
DCB_CONNECTOR_VGA = 0x00, DCB_CONNECTOR_VGA = 0x00,
DCB_CONNECTOR_TV_0 = 0x10, DCB_CONNECTOR_TV_0 = 0x10,
...@@ -25,8 +24,8 @@ enum dcb_connector_type { ...@@ -25,8 +24,8 @@ enum dcb_connector_type {
struct nvbios_connT { struct nvbios_connT {
}; };
u32 nvbios_connTe(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u32 nvbios_connTe(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u32 nvbios_connTp(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u32 nvbios_connTp(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_connT *info); struct nvbios_connT *info);
struct nvbios_connE { struct nvbios_connE {
...@@ -39,8 +38,7 @@ struct nvbios_connE { ...@@ -39,8 +38,7 @@ struct nvbios_connE {
u8 lcdid; u8 lcdid;
}; };
u32 nvbios_connEe(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *hdr); u32 nvbios_connEe(struct nvkm_bios *bios, u8 idx, u8 *ver, u8 *hdr);
u32 nvbios_connEp(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *hdr, u32 nvbios_connEp(struct nvkm_bios *bios, u8 idx, u8 *ver, u8 *hdr,
struct nvbios_connE *info); struct nvbios_connE *info);
#endif #endif
#ifndef __NVBIOS_CSTEP_H__ #ifndef __NVBIOS_CSTEP_H__
#define __NVBIOS_CSTEP_H__ #define __NVBIOS_CSTEP_H__
u16 nvbios_cstepTe(struct nvkm_bios *,
u16 nvbios_cstepTe(struct nouveau_bios *,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *xnr, u8 *xsz); u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *xnr, u8 *xsz);
struct nvbios_cstepE { struct nvbios_cstepE {
...@@ -9,10 +8,10 @@ struct nvbios_cstepE { ...@@ -9,10 +8,10 @@ struct nvbios_cstepE {
u8 index; u8 index;
}; };
u16 nvbios_cstepEe(struct nouveau_bios *, int idx, u8 *ver, u8 *hdr); u16 nvbios_cstepEe(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr);
u16 nvbios_cstepEp(struct nouveau_bios *, int idx, u8 *ver, u8 *hdr, u16 nvbios_cstepEp(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr,
struct nvbios_cstepE *); struct nvbios_cstepE *);
u16 nvbios_cstepEm(struct nouveau_bios *, u8 pstate, u8 *ver, u8 *hdr, u16 nvbios_cstepEm(struct nvkm_bios *, u8 pstate, u8 *ver, u8 *hdr,
struct nvbios_cstepE *); struct nvbios_cstepE *);
struct nvbios_cstepX { struct nvbios_cstepX {
...@@ -21,8 +20,7 @@ struct nvbios_cstepX { ...@@ -21,8 +20,7 @@ struct nvbios_cstepX {
u8 voltage; u8 voltage;
}; };
u16 nvbios_cstepXe(struct nouveau_bios *, int idx, u8 *ver, u8 *hdr); u16 nvbios_cstepXe(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr);
u16 nvbios_cstepXp(struct nouveau_bios *, int idx, u8 *ver, u8 *hdr, u16 nvbios_cstepXp(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr,
struct nvbios_cstepX *); struct nvbios_cstepX *);
#endif #endif
#ifndef __NVBIOS_DCB_H__ #ifndef __NVBIOS_DCB_H__
#define __NVBIOS_DCB_H__ #define __NVBIOS_DCB_H__
struct nouveau_bios;
enum dcb_output_type { enum dcb_output_type {
DCB_OUTPUT_ANALOG = 0x0, DCB_OUTPUT_ANALOG = 0x0,
DCB_OUTPUT_TV = 0x1, DCB_OUTPUT_TV = 0x1,
...@@ -57,13 +54,12 @@ struct dcb_output { ...@@ -57,13 +54,12 @@ struct dcb_output {
bool i2c_upper_default; bool i2c_upper_default;
}; };
u16 dcb_table(struct nouveau_bios *, u8 *ver, u8 *hdr, u8 *ent, u8 *len); u16 dcb_table(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *ent, u8 *len);
u16 dcb_outp(struct nouveau_bios *, u8 idx, u8 *ver, u8 *len); u16 dcb_outp(struct nvkm_bios *, u8 idx, u8 *ver, u8 *len);
u16 dcb_outp_parse(struct nouveau_bios *, u8 idx, u8 *, u8 *, u16 dcb_outp_parse(struct nvkm_bios *, u8 idx, u8 *, u8 *,
struct dcb_output *); struct dcb_output *);
u16 dcb_outp_match(struct nouveau_bios *, u16 type, u16 mask, u8 *, u8 *, u16 dcb_outp_match(struct nvkm_bios *, u16 type, u16 mask, u8 *, u8 *,
struct dcb_output *); struct dcb_output *);
int dcb_outp_foreach(struct nouveau_bios *, void *data, int (*exec) int dcb_outp_foreach(struct nvkm_bios *, void *data, int (*exec)
(struct nouveau_bios *, void *, int index, u16 entry)); (struct nvkm_bios *, void *, int index, u16 entry));
#endif #endif
#ifndef __NVBIOS_DISP_H__ #ifndef __NVBIOS_DISP_H__
#define __NVBIOS_DISP_H__ #define __NVBIOS_DISP_H__
u16 nvbios_disp_table(struct nvkm_bios *,
u16 nvbios_disp_table(struct nouveau_bios *,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *sub); u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *sub);
struct nvbios_disp { struct nvbios_disp {
u16 data; u16 data;
}; };
u16 nvbios_disp_entry(struct nouveau_bios *, u8 idx, u16 nvbios_disp_entry(struct nvkm_bios *, u8 idx, u8 *ver, u8 *hdr, u8 *sub);
u8 *ver, u8 *hdr__, u8 *sub); u16 nvbios_disp_parse(struct nvkm_bios *, u8 idx, u8 *ver, u8 *hdr, u8 *sub,
u16 nvbios_disp_parse(struct nouveau_bios *, u8 idx,
u8 *ver, u8 *hdr__, u8 *sub,
struct nvbios_disp *); struct nvbios_disp *);
struct nvbios_outp { struct nvbios_outp {
...@@ -20,29 +17,23 @@ struct nvbios_outp { ...@@ -20,29 +17,23 @@ struct nvbios_outp {
u16 script[3]; u16 script[3];
}; };
u16 nvbios_outp_entry(struct nouveau_bios *, u8 idx, u16 nvbios_outp_entry(struct nvkm_bios *, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u16 nvbios_outp_parse(struct nouveau_bios *, u8 idx, u16 nvbios_outp_parse(struct nvkm_bios *, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_outp *);
struct nvbios_outp *); u16 nvbios_outp_match(struct nvkm_bios *, u16 type, u16 mask,
u16 nvbios_outp_match(struct nouveau_bios *, u16 type, u16 mask, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_outp *);
u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_outp *);
struct nvbios_ocfg { struct nvbios_ocfg {
u16 match; u16 match;
u16 clkcmp[2]; u16 clkcmp[2];
}; };
u16 nvbios_ocfg_entry(struct nouveau_bios *, u16 outp, u8 idx, u16 nvbios_ocfg_entry(struct nvkm_bios *, u16 outp, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u16 nvbios_ocfg_parse(struct nouveau_bios *, u16 outp, u8 idx, u16 nvbios_ocfg_parse(struct nvkm_bios *, u16 outp, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_ocfg *);
struct nvbios_ocfg *); u16 nvbios_ocfg_match(struct nvkm_bios *, u16 outp, u16 type,
u16 nvbios_ocfg_match(struct nouveau_bios *, u16 outp, u16 type, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_ocfg *);
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u16 nvbios_oclk_match(struct nvkm_bios *, u16 cmp, u32 khz);
struct nvbios_ocfg *);
u16 nvbios_oclk_match(struct nouveau_bios *, u16 cmp, u32 khz);
#endif #endif
#ifndef __NVBIOS_DP_H__ #ifndef __NVBIOS_DP_H__
#define __NVBIOS_DP_H__ #define __NVBIOS_DP_H__
struct nvbios_dpout { struct nvbios_dpout {
u16 type; u16 type;
u16 mask; u16 mask;
...@@ -9,10 +8,10 @@ struct nvbios_dpout { ...@@ -9,10 +8,10 @@ struct nvbios_dpout {
u32 lnkcmp; u32 lnkcmp;
}; };
u16 nvbios_dpout_parse(struct nouveau_bios *, u8 idx, u16 nvbios_dpout_parse(struct nvkm_bios *, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_dpout *); struct nvbios_dpout *);
u16 nvbios_dpout_match(struct nouveau_bios *, u16 type, u16 mask, u16 nvbios_dpout_match(struct nvkm_bios *, u16 type, u16 mask,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_dpout *); struct nvbios_dpout *);
...@@ -24,12 +23,9 @@ struct nvbios_dpcfg { ...@@ -24,12 +23,9 @@ struct nvbios_dpcfg {
}; };
u16 u16
nvbios_dpcfg_parse(struct nouveau_bios *, u16 outp, u8 idx, nvbios_dpcfg_parse(struct nvkm_bios *, u16 outp, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_dpcfg *);
struct nvbios_dpcfg *);
u16 u16
nvbios_dpcfg_match(struct nouveau_bios *, u16 outp, u8 pc, u8 vs, u8 pe, nvbios_dpcfg_match(struct nvkm_bios *, u16 outp, u8 pc, u8 vs, u8 pe,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_dpcfg *);
struct nvbios_dpcfg *);
#endif #endif
#ifndef __NVBIOS_EXTDEV_H__ #ifndef __NVBIOS_EXTDEV_H__
#define __NVBIOS_EXTDEV_H__ #define __NVBIOS_EXTDEV_H__
struct nouveau_bios;
enum nvbios_extdev_type { enum nvbios_extdev_type {
NVBIOS_EXTDEV_LM89 = 0x02, NVBIOS_EXTDEV_LM89 = 0x02,
NVBIOS_EXTDEV_VT1103M = 0x40, NVBIOS_EXTDEV_VT1103M = 0x40,
...@@ -20,11 +17,9 @@ struct nvbios_extdev_func { ...@@ -20,11 +17,9 @@ struct nvbios_extdev_func {
}; };
int int
nvbios_extdev_parse(struct nouveau_bios *, int, struct nvbios_extdev_func *); nvbios_extdev_parse(struct nvkm_bios *, int, struct nvbios_extdev_func *);
int int
nvbios_extdev_find(struct nouveau_bios *, enum nvbios_extdev_type, nvbios_extdev_find(struct nvkm_bios *, enum nvbios_extdev_type,
struct nvbios_extdev_func *); struct nvbios_extdev_func *);
#endif #endif
#ifndef __NVBIOS_FAN_H__ #ifndef __NVBIOS_FAN_H__
#define __NVBIOS_FAN_H__ #define __NVBIOS_FAN_H__
#include <subdev/bios/therm.h> #include <subdev/bios/therm.h>
u16 nvbios_fan_parse(struct nouveau_bios *bios, struct nvbios_therm_fan *fan); u16 nvbios_fan_parse(struct nvkm_bios *bios, struct nvbios_therm_fan *fan);
#endif #endif
#ifndef __NVBIOS_GPIO_H__ #ifndef __NVBIOS_GPIO_H__
#define __NVBIOS_GPIO_H__ #define __NVBIOS_GPIO_H__
enum dcb_gpio_func_name { enum dcb_gpio_func_name {
DCB_GPIO_PANEL_POWER = 0x01, DCB_GPIO_PANEL_POWER = 0x01,
DCB_GPIO_TVDAC0 = 0x0c, DCB_GPIO_TVDAC0 = 0x0c,
...@@ -38,11 +37,10 @@ struct dcb_gpio_func { ...@@ -38,11 +37,10 @@ struct dcb_gpio_func {
u8 param; u8 param;
}; };
u16 dcb_gpio_table(struct nouveau_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u16 dcb_gpio_table(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u16 dcb_gpio_entry(struct nouveau_bios *, int idx, int ent, u8 *ver, u8 *len); u16 dcb_gpio_entry(struct nvkm_bios *, int idx, int ent, u8 *ver, u8 *len);
u16 dcb_gpio_parse(struct nouveau_bios *, int idx, int ent, u8 *ver, u8 *len, u16 dcb_gpio_parse(struct nvkm_bios *, int idx, int ent, u8 *ver, u8 *len,
struct dcb_gpio_func *); struct dcb_gpio_func *);
u16 dcb_gpio_match(struct nouveau_bios *, int idx, u8 func, u8 line, u16 dcb_gpio_match(struct nvkm_bios *, int idx, u8 func, u8 line,
u8 *ver, u8 *len, struct dcb_gpio_func *); u8 *ver, u8 *len, struct dcb_gpio_func *);
#endif #endif
#ifndef __NVBIOS_I2C_H__ #ifndef __NVBIOS_I2C_H__
#define __NVBIOS_I2C_H__ #define __NVBIOS_I2C_H__
struct nouveau_bios;
enum dcb_i2c_type { enum dcb_i2c_type {
/* matches bios type field prior to ccb 4.1 */ /* matches bios type field prior to ccb 4.1 */
DCB_I2C_NV04_BIT = 0x00, DCB_I2C_NV04_BIT = 0x00,
...@@ -22,8 +19,7 @@ struct dcb_i2c_entry { ...@@ -22,8 +19,7 @@ struct dcb_i2c_entry {
u8 auxch; u8 auxch;
}; };
u16 dcb_i2c_table(struct nouveau_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u16 dcb_i2c_table(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u16 dcb_i2c_entry(struct nouveau_bios *, u8 index, u8 *ver, u8 *len); u16 dcb_i2c_entry(struct nvkm_bios *, u8 index, u8 *ver, u8 *len);
int dcb_i2c_parse(struct nouveau_bios *, u8 index, struct dcb_i2c_entry *); int dcb_i2c_parse(struct nvkm_bios *, u8 index, struct dcb_i2c_entry *);
#endif #endif
#ifndef __NVBIOS_IMAGE_H__ #ifndef __NVBIOS_IMAGE_H__
#define __NVBIOS_IMAGE_H__ #define __NVBIOS_IMAGE_H__
struct nvbios_image { struct nvbios_image {
u32 base; u32 base;
u32 size; u32 size;
...@@ -8,6 +7,5 @@ struct nvbios_image { ...@@ -8,6 +7,5 @@ struct nvbios_image {
bool last; bool last;
}; };
bool nvbios_image(struct nouveau_bios *, int, struct nvbios_image *); bool nvbios_image(struct nvkm_bios *, int, struct nvbios_image *);
#endif #endif
#ifndef __NVBIOS_INIT_H__ #ifndef __NVBIOS_INIT_H__
#define __NVBIOS_INIT_H__ #define __NVBIOS_INIT_H__
struct nvbios_init { struct nvbios_init {
struct nouveau_subdev *subdev; struct nvkm_subdev *subdev;
struct nouveau_bios *bios; struct nvkm_bios *bios;
u16 offset; u16 offset;
struct dcb_output *outp; struct dcb_output *outp;
int crtc; int crtc;
...@@ -17,6 +16,5 @@ struct nvbios_init { ...@@ -17,6 +16,5 @@ struct nvbios_init {
}; };
int nvbios_exec(struct nvbios_init *); int nvbios_exec(struct nvbios_init *);
int nvbios_init(struct nouveau_subdev *, bool execute); int nvbios_init(struct nvkm_subdev *, bool execute);
#endif #endif
#ifndef __NVBIOS_MXM_H__ #ifndef __NVBIOS_MXM_H__
#define __NVBIOS_MXM_H__ #define __NVBIOS_MXM_H__
u16 mxm_table(struct nvkm_bios *, u8 *ver, u8 *hdr);
u16 mxm_table(struct nouveau_bios *, u8 *ver, u8 *hdr); u8 mxm_sor_map(struct nvkm_bios *, u8 conn);
u8 mxm_ddc_map(struct nvkm_bios *, u8 port);
u8 mxm_sor_map(struct nouveau_bios *, u8 conn);
u8 mxm_ddc_map(struct nouveau_bios *, u8 port);
#endif #endif
#ifndef __NVBIOS_NPDE_H__ #ifndef __NVBIOS_NPDE_H__
#define __NVBIOS_NPDE_H__ #define __NVBIOS_NPDE_H__
struct nvbios_npdeT { struct nvbios_npdeT {
u32 image_size; u32 image_size;
bool last; bool last;
}; };
u32 nvbios_npdeTe(struct nouveau_bios *, u32); u32 nvbios_npdeTe(struct nvkm_bios *, u32);
u32 nvbios_npdeTp(struct nouveau_bios *, u32, struct nvbios_npdeT *); u32 nvbios_npdeTp(struct nvkm_bios *, u32, struct nvbios_npdeT *);
#endif #endif
#ifndef __NVBIOS_PCIR_H__ #ifndef __NVBIOS_PCIR_H__
#define __NVBIOS_PCIR_H__ #define __NVBIOS_PCIR_H__
struct nvbios_pcirT { struct nvbios_pcirT {
u16 vendor_id; u16 vendor_id;
u16 device_id; u16 device_id;
...@@ -11,8 +10,7 @@ struct nvbios_pcirT { ...@@ -11,8 +10,7 @@ struct nvbios_pcirT {
bool last; bool last;
}; };
u32 nvbios_pcirTe(struct nouveau_bios *, u32, u8 *ver, u16 *hdr); u32 nvbios_pcirTe(struct nvkm_bios *, u32, u8 *ver, u16 *hdr);
u32 nvbios_pcirTp(struct nouveau_bios *, u32, u8 *ver, u16 *hdr, u32 nvbios_pcirTp(struct nvkm_bios *, u32, u8 *ver, u16 *hdr,
struct nvbios_pcirT *); struct nvbios_pcirT *);
#endif #endif
#ifndef __NVBIOS_PERF_H__ #ifndef __NVBIOS_PERF_H__
#define __NVBIOS_PERF_H__ #define __NVBIOS_PERF_H__
u16 nvbios_perf_table(struct nvkm_bios *, u8 *ver, u8 *hdr,
struct nouveau_bios;
u16 nvbios_perf_table(struct nouveau_bios *, u8 *ver, u8 *hdr,
u8 *cnt, u8 *len, u8 *snr, u8 *ssz); u8 *cnt, u8 *len, u8 *snr, u8 *ssz);
struct nvbios_perfE { struct nvbios_perfE {
...@@ -18,9 +15,9 @@ struct nvbios_perfE { ...@@ -18,9 +15,9 @@ struct nvbios_perfE {
u32 script; u32 script;
}; };
u16 nvbios_perf_entry(struct nouveau_bios *, int idx, u16 nvbios_perf_entry(struct nvkm_bios *, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u16 nvbios_perfEp(struct nouveau_bios *, int idx, u16 nvbios_perfEp(struct nvkm_bios *, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_perfE *); u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_perfE *);
struct nvbios_perfS { struct nvbios_perfS {
...@@ -31,17 +28,14 @@ struct nvbios_perfS { ...@@ -31,17 +28,14 @@ struct nvbios_perfS {
}; };
}; };
u32 nvbios_perfSe(struct nouveau_bios *, u32 data, int idx, u32 nvbios_perfSe(struct nvkm_bios *, u32 data, int idx,
u8 *ver, u8 *hdr, u8 cnt, u8 len); u8 *ver, u8 *hdr, u8 cnt, u8 len);
u32 nvbios_perfSp(struct nouveau_bios *, u32 data, int idx, u32 nvbios_perfSp(struct nvkm_bios *, u32 data, int idx,
u8 *ver, u8 *hdr, u8 cnt, u8 len, struct nvbios_perfS *); u8 *ver, u8 *hdr, u8 cnt, u8 len, struct nvbios_perfS *);
struct nvbios_perf_fan { struct nvbios_perf_fan {
u32 pwm_divisor; u32 pwm_divisor;
}; };
int int nvbios_perf_fan_parse(struct nvkm_bios *, struct nvbios_perf_fan *);
nvbios_perf_fan_parse(struct nouveau_bios *, struct nvbios_perf_fan *);
#endif #endif
#ifndef __NVBIOS_PLL_H__ #ifndef __NVBIOS_PLL_H__
#define __NVBIOS_PLL_H__ #define __NVBIOS_PLL_H__
/*XXX: kill me */ /*XXX: kill me */
struct nouveau_pll_vals { struct nvkm_pll_vals {
union { union {
struct { struct {
#ifdef __BIG_ENDIAN #ifdef __BIG_ENDIAN
...@@ -20,10 +19,8 @@ struct nouveau_pll_vals { ...@@ -20,10 +19,8 @@ struct nouveau_pll_vals {
int refclk; int refclk;
}; };
struct nouveau_bios;
/* these match types in pll limits table version 0x40, /* these match types in pll limits table version 0x40,
* nouveau uses them on all chipsets internally where a * nvkm uses them on all chipsets internally where a
* specific pll needs to be referenced, but the exact * specific pll needs to be referenced, but the exact
* register isn't known. * register isn't known.
*/ */
...@@ -74,6 +71,5 @@ struct nvbios_pll { ...@@ -74,6 +71,5 @@ struct nvbios_pll {
} vco1, vco2; } vco1, vco2;
}; };
int nvbios_pll_parse(struct nouveau_bios *, u32 type, struct nvbios_pll *); int nvbios_pll_parse(struct nvkm_bios *, u32 type, struct nvbios_pll *);
#endif #endif
#ifndef __NVBIOS_PMU_H__ #ifndef __NVBIOS_PMU_H__
#define __NVBIOS_PMU_H__ #define __NVBIOS_PMU_H__
struct nvbios_pmuT { struct nvbios_pmuT {
}; };
u32 nvbios_pmuTe(struct nouveau_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u32 nvbios_pmuTe(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u32 nvbios_pmuTp(struct nouveau_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u32 nvbios_pmuTp(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_pmuT *); struct nvbios_pmuT *);
struct nvbios_pmuE { struct nvbios_pmuE {
...@@ -13,8 +12,8 @@ struct nvbios_pmuE { ...@@ -13,8 +12,8 @@ struct nvbios_pmuE {
u32 data; u32 data;
}; };
u32 nvbios_pmuEe(struct nouveau_bios *, int idx, u8 *ver, u8 *hdr); u32 nvbios_pmuEe(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr);
u32 nvbios_pmuEp(struct nouveau_bios *, int idx, u8 *ver, u8 *hdr, u32 nvbios_pmuEp(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr,
struct nvbios_pmuE *); struct nvbios_pmuE *);
struct nvbios_pmuR { struct nvbios_pmuR {
...@@ -32,6 +31,5 @@ struct nvbios_pmuR { ...@@ -32,6 +31,5 @@ struct nvbios_pmuR {
u32 args_addr_pmu; u32 args_addr_pmu;
}; };
bool nvbios_pmuRm(struct nouveau_bios *, u8 type, struct nvbios_pmuR *); bool nvbios_pmuRm(struct nvkm_bios *, u8 type, struct nvbios_pmuR *);
#endif #endif
#ifndef __NVBIOS_RAMCFG_H__ #ifndef __NVBIOS_RAMCFG_H__
#define __NVBIOS_RAMCFG_H__ #define __NVBIOS_RAMCFG_H__
struct nouveau_bios;
struct nvbios_ramcfg { struct nvbios_ramcfg {
unsigned rammap_ver; unsigned rammap_ver;
unsigned rammap_hdr; unsigned rammap_hdr;
...@@ -139,7 +136,6 @@ struct nvbios_ramcfg { ...@@ -139,7 +136,6 @@ struct nvbios_ramcfg {
}; };
}; };
u8 nvbios_ramcfg_count(struct nouveau_bios *); u8 nvbios_ramcfg_count(struct nvkm_bios *);
u8 nvbios_ramcfg_index(struct nouveau_subdev *); u8 nvbios_ramcfg_index(struct nvkm_subdev *);
#endif #endif
#ifndef __NVBIOS_RAMMAP_H__ #ifndef __NVBIOS_RAMMAP_H__
#define __NVBIOS_RAMMAP_H__ #define __NVBIOS_RAMMAP_H__
#include <subdev/bios/ramcfg.h>
struct nvbios_ramcfg; u32 nvbios_rammapTe(struct nvkm_bios *, u8 *ver, u8 *hdr,
u32 nvbios_rammapTe(struct nouveau_bios *, u8 *ver, u8 *hdr,
u8 *cnt, u8 *len, u8 *snr, u8 *ssz); u8 *cnt, u8 *len, u8 *snr, u8 *ssz);
u32 nvbios_rammapEe(struct nouveau_bios *, int idx, u32 nvbios_rammapEe(struct nvkm_bios *, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u32 nvbios_rammapEp(struct nouveau_bios *, int idx, u32 nvbios_rammapEp(struct nvkm_bios *, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_ramcfg *);
struct nvbios_ramcfg *); u32 nvbios_rammapEm(struct nvkm_bios *, u16 mhz,
u32 nvbios_rammapEm(struct nouveau_bios *, u16 mhz, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_ramcfg *);
u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_ramcfg *);
u32 nvbios_rammapSe(struct nouveau_bios *, u32 data, u32 nvbios_rammapSe(struct nvkm_bios *, u32 data,
u8 ever, u8 ehdr, u8 ecnt, u8 elen, int idx, u8 ever, u8 ehdr, u8 ecnt, u8 elen, int idx,
u8 *ver, u8 *hdr); u8 *ver, u8 *hdr);
u32 nvbios_rammapSp(struct nouveau_bios *, u32 data, u32 nvbios_rammapSp(struct nvkm_bios *, u32 data,
u8 ever, u8 ehdr, u8 ecnt, u8 elen, int idx, u8 ever, u8 ehdr, u8 ecnt, u8 elen, int idx,
u8 *ver, u8 *hdr, u8 *ver, u8 *hdr, struct nvbios_ramcfg *);
struct nvbios_ramcfg *);
#endif #endif
#ifndef __NVBIOS_THERM_H__ #ifndef __NVBIOS_THERM_H__
#define __NVBIOS_THERM_H__ #define __NVBIOS_THERM_H__
struct nouveau_bios;
struct nvbios_therm_threshold { struct nvbios_therm_threshold {
u8 temp; u8 temp;
u8 hysteresis; u8 hysteresis;
...@@ -30,8 +27,8 @@ enum nvbios_therm_fan_type { ...@@ -30,8 +27,8 @@ enum nvbios_therm_fan_type {
}; };
/* no vbios have more than 6 */ /* no vbios have more than 6 */
#define NOUVEAU_TEMP_FAN_TRIP_MAX 10 #define NVKM_TEMP_FAN_TRIP_MAX 10
struct nouveau_therm_trip_point { struct nvbios_therm_trip_point {
int fan_duty; int fan_duty;
int temp; int temp;
int hysteresis; int hysteresis;
...@@ -55,7 +52,7 @@ struct nvbios_therm_fan { ...@@ -55,7 +52,7 @@ struct nvbios_therm_fan {
u16 slow_down_period; u16 slow_down_period;
enum nvbios_therm_fan_mode fan_mode; enum nvbios_therm_fan_mode fan_mode;
struct nouveau_therm_trip_point trip[NOUVEAU_TEMP_FAN_TRIP_MAX]; struct nvbios_therm_trip_point trip[NVKM_TEMP_FAN_TRIP_MAX];
u8 nr_fan_trip; u8 nr_fan_trip;
u8 linear_min_temp; u8 linear_min_temp;
u8 linear_max_temp; u8 linear_max_temp;
...@@ -67,11 +64,9 @@ enum nvbios_therm_domain { ...@@ -67,11 +64,9 @@ enum nvbios_therm_domain {
}; };
int int
nvbios_therm_sensor_parse(struct nouveau_bios *, enum nvbios_therm_domain, nvbios_therm_sensor_parse(struct nvkm_bios *, enum nvbios_therm_domain,
struct nvbios_therm_sensor *); struct nvbios_therm_sensor *);
int int
nvbios_therm_fan_parse(struct nouveau_bios *, struct nvbios_therm_fan *); nvbios_therm_fan_parse(struct nvkm_bios *, struct nvbios_therm_fan *);
#endif #endif
#ifndef __NVBIOS_TIMING_H__ #ifndef __NVBIOS_TIMING_H__
#define __NVBIOS_TIMING_H__ #define __NVBIOS_TIMING_H__
#include <subdev/bios/ramcfg.h>
struct nvbios_ramcfg; u16 nvbios_timingTe(struct nvkm_bios *,
u16 nvbios_timingTe(struct nouveau_bios *,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz); u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz);
u16 nvbios_timingEe(struct nouveau_bios *, int idx, u16 nvbios_timingEe(struct nvkm_bios *, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u16 nvbios_timingEp(struct nouveau_bios *, int idx, u16 nvbios_timingEp(struct nvkm_bios *, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_ramcfg *);
struct nvbios_ramcfg *);
#endif #endif
#ifndef __NVBIOS_VMAP_H__ #ifndef __NVBIOS_VMAP_H__
#define __NVBIOS_VMAP_H__ #define __NVBIOS_VMAP_H__
struct nouveau_bios;
struct nvbios_vmap { struct nvbios_vmap {
}; };
u16 nvbios_vmap_table(struct nouveau_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u16 nvbios_vmap_table(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u16 nvbios_vmap_parse(struct nouveau_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u16 nvbios_vmap_parse(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_vmap *); struct nvbios_vmap *);
struct nvbios_vmap_entry { struct nvbios_vmap_entry {
...@@ -18,8 +15,7 @@ struct nvbios_vmap_entry { ...@@ -18,8 +15,7 @@ struct nvbios_vmap_entry {
s32 arg[6]; s32 arg[6];
}; };
u16 nvbios_vmap_entry(struct nouveau_bios *, int idx, u8 *ver, u8 *len); u16 nvbios_vmap_entry(struct nvkm_bios *, int idx, u8 *ver, u8 *len);
u16 nvbios_vmap_entry_parse(struct nouveau_bios *, int idx, u8 *ver, u8 *len, u16 nvbios_vmap_entry_parse(struct nvkm_bios *, int idx, u8 *ver, u8 *len,
struct nvbios_vmap_entry *); struct nvbios_vmap_entry *);
#endif #endif
#ifndef __NVBIOS_VOLT_H__ #ifndef __NVBIOS_VOLT_H__
#define __NVBIOS_VOLT_H__ #define __NVBIOS_VOLT_H__
struct nouveau_bios;
struct nvbios_volt { struct nvbios_volt {
u8 vidmask; u8 vidmask;
u32 min; u32 min;
...@@ -11,8 +8,8 @@ struct nvbios_volt { ...@@ -11,8 +8,8 @@ struct nvbios_volt {
s16 step; s16 step;
}; };
u16 nvbios_volt_table(struct nouveau_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u16 nvbios_volt_table(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u16 nvbios_volt_parse(struct nouveau_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u16 nvbios_volt_parse(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_volt *); struct nvbios_volt *);
struct nvbios_volt_entry { struct nvbios_volt_entry {
...@@ -20,8 +17,7 @@ struct nvbios_volt_entry { ...@@ -20,8 +17,7 @@ struct nvbios_volt_entry {
u8 vid; u8 vid;
}; };
u16 nvbios_volt_entry(struct nouveau_bios *, int idx, u8 *ver, u8 *len); u16 nvbios_volt_entry(struct nvkm_bios *, int idx, u8 *ver, u8 *len);
u16 nvbios_volt_entry_parse(struct nouveau_bios *, int idx, u8 *ver, u8 *len, u16 nvbios_volt_entry_parse(struct nvkm_bios *, int idx, u8 *ver, u8 *len,
struct nvbios_volt_entry *); struct nvbios_volt_entry *);
#endif #endif
...@@ -11,9 +11,8 @@ struct nvbios_xpio { ...@@ -11,9 +11,8 @@ struct nvbios_xpio {
u8 flags; u8 flags;
}; };
u16 dcb_xpio_table(struct nouveau_bios *, u8 idx, u16 dcb_xpio_table(struct nvkm_bios *, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len); u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
u16 dcb_xpio_parse(struct nouveau_bios *, u8 idx, u16 dcb_xpio_parse(struct nvkm_bios *, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_xpio *); u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_xpio *);
#endif #endif
...@@ -108,6 +108,7 @@ extern struct nouveau_oclass *nve0_fb_oclass; ...@@ -108,6 +108,7 @@ extern struct nouveau_oclass *nve0_fb_oclass;
extern struct nouveau_oclass *gk20a_fb_oclass; extern struct nouveau_oclass *gk20a_fb_oclass;
extern struct nouveau_oclass *gm107_fb_oclass; extern struct nouveau_oclass *gm107_fb_oclass;
#include <subdev/bios.h>
#include <subdev/bios/ramcfg.h> #include <subdev/bios/ramcfg.h>
struct nouveau_ram_data { struct nouveau_ram_data {
......
...@@ -21,13 +21,12 @@ ...@@ -21,13 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/M0203.h> #include <subdev/bios/M0203.h>
u32 u32
nvbios_M0203Te(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) nvbios_M0203Te(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
struct bit_entry bit_M; struct bit_entry bit_M;
u32 data = 0x00000000; u32 data = 0x00000000;
...@@ -53,7 +52,7 @@ nvbios_M0203Te(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) ...@@ -53,7 +52,7 @@ nvbios_M0203Te(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
} }
u32 u32
nvbios_M0203Tp(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, nvbios_M0203Tp(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_M0203T *info) struct nvbios_M0203T *info)
{ {
u32 data = nvbios_M0203Te(bios, ver, hdr, cnt, len); u32 data = nvbios_M0203Te(bios, ver, hdr, cnt, len);
...@@ -70,7 +69,7 @@ nvbios_M0203Tp(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, ...@@ -70,7 +69,7 @@ nvbios_M0203Tp(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
} }
u32 u32
nvbios_M0203Ee(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr) nvbios_M0203Ee(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr)
{ {
u8 cnt, len; u8 cnt, len;
u32 data = nvbios_M0203Te(bios, ver, hdr, &cnt, &len); u32 data = nvbios_M0203Te(bios, ver, hdr, &cnt, &len);
...@@ -83,7 +82,7 @@ nvbios_M0203Ee(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr) ...@@ -83,7 +82,7 @@ nvbios_M0203Ee(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr)
} }
u32 u32
nvbios_M0203Ep(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr, nvbios_M0203Ep(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr,
struct nvbios_M0203E *info) struct nvbios_M0203E *info)
{ {
u32 data = nvbios_M0203Ee(bios, idx, ver, hdr); u32 data = nvbios_M0203Ee(bios, idx, ver, hdr);
...@@ -101,7 +100,7 @@ nvbios_M0203Ep(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr, ...@@ -101,7 +100,7 @@ nvbios_M0203Ep(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr,
} }
u32 u32
nvbios_M0203Em(struct nouveau_bios *bios, u8 ramcfg, u8 *ver, u8 *hdr, nvbios_M0203Em(struct nvkm_bios *bios, u8 ramcfg, u8 *ver, u8 *hdr,
struct nvbios_M0203E *info) struct nvbios_M0203E *info)
{ {
struct nvbios_M0203T M0203T; struct nvbios_M0203T M0203T;
......
...@@ -21,13 +21,12 @@ ...@@ -21,13 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/M0205.h> #include <subdev/bios/M0205.h>
u32 u32
nvbios_M0205Te(struct nouveau_bios *bios, nvbios_M0205Te(struct nvkm_bios *bios,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz) u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz)
{ {
struct bit_entry bit_M; struct bit_entry bit_M;
...@@ -56,7 +55,7 @@ nvbios_M0205Te(struct nouveau_bios *bios, ...@@ -56,7 +55,7 @@ nvbios_M0205Te(struct nouveau_bios *bios,
} }
u32 u32
nvbios_M0205Tp(struct nouveau_bios *bios, nvbios_M0205Tp(struct nvkm_bios *bios,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz,
struct nvbios_M0205T *info) struct nvbios_M0205T *info)
{ {
...@@ -73,7 +72,7 @@ nvbios_M0205Tp(struct nouveau_bios *bios, ...@@ -73,7 +72,7 @@ nvbios_M0205Tp(struct nouveau_bios *bios,
} }
u32 u32
nvbios_M0205Ee(struct nouveau_bios *bios, int idx, nvbios_M0205Ee(struct nvkm_bios *bios, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len) u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
u8 snr, ssz; u8 snr, ssz;
...@@ -89,7 +88,7 @@ nvbios_M0205Ee(struct nouveau_bios *bios, int idx, ...@@ -89,7 +88,7 @@ nvbios_M0205Ee(struct nouveau_bios *bios, int idx,
} }
u32 u32
nvbios_M0205Ep(struct nouveau_bios *bios, int idx, nvbios_M0205Ep(struct nvkm_bios *bios, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_M0205E *info) struct nvbios_M0205E *info)
{ {
...@@ -106,7 +105,7 @@ nvbios_M0205Ep(struct nouveau_bios *bios, int idx, ...@@ -106,7 +105,7 @@ nvbios_M0205Ep(struct nouveau_bios *bios, int idx,
} }
u32 u32
nvbios_M0205Se(struct nouveau_bios *bios, int ent, int idx, u8 *ver, u8 *hdr) nvbios_M0205Se(struct nvkm_bios *bios, int ent, int idx, u8 *ver, u8 *hdr)
{ {
u8 cnt, len; u8 cnt, len;
...@@ -120,7 +119,7 @@ nvbios_M0205Se(struct nouveau_bios *bios, int ent, int idx, u8 *ver, u8 *hdr) ...@@ -120,7 +119,7 @@ nvbios_M0205Se(struct nouveau_bios *bios, int ent, int idx, u8 *ver, u8 *hdr)
} }
u32 u32
nvbios_M0205Sp(struct nouveau_bios *bios, int ent, int idx, u8 *ver, u8 *hdr, nvbios_M0205Sp(struct nvkm_bios *bios, int ent, int idx, u8 *ver, u8 *hdr,
struct nvbios_M0205S *info) struct nvbios_M0205S *info)
{ {
u32 data = nvbios_M0205Se(bios, ent, idx, ver, hdr); u32 data = nvbios_M0205Se(bios, ent, idx, ver, hdr);
......
...@@ -21,13 +21,12 @@ ...@@ -21,13 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/M0209.h> #include <subdev/bios/M0209.h>
u32 u32
nvbios_M0209Te(struct nouveau_bios *bios, nvbios_M0209Te(struct nvkm_bios *bios,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz) u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz)
{ {
struct bit_entry bit_M; struct bit_entry bit_M;
...@@ -56,7 +55,7 @@ nvbios_M0209Te(struct nouveau_bios *bios, ...@@ -56,7 +55,7 @@ nvbios_M0209Te(struct nouveau_bios *bios,
} }
u32 u32
nvbios_M0209Ee(struct nouveau_bios *bios, int idx, nvbios_M0209Ee(struct nvkm_bios *bios, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len) u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
u8 snr, ssz; u8 snr, ssz;
...@@ -72,9 +71,8 @@ nvbios_M0209Ee(struct nouveau_bios *bios, int idx, ...@@ -72,9 +71,8 @@ nvbios_M0209Ee(struct nouveau_bios *bios, int idx,
} }
u32 u32
nvbios_M0209Ep(struct nouveau_bios *bios, int idx, nvbios_M0209Ep(struct nvkm_bios *bios, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_M0209E *info)
struct nvbios_M0209E *info)
{ {
u32 data = nvbios_M0209Ee(bios, idx, ver, hdr, cnt, len); u32 data = nvbios_M0209Ee(bios, idx, ver, hdr, cnt, len);
memset(info, 0x00, sizeof(*info)); memset(info, 0x00, sizeof(*info));
...@@ -94,7 +92,7 @@ nvbios_M0209Ep(struct nouveau_bios *bios, int idx, ...@@ -94,7 +92,7 @@ nvbios_M0209Ep(struct nouveau_bios *bios, int idx,
} }
u32 u32
nvbios_M0209Se(struct nouveau_bios *bios, int ent, int idx, u8 *ver, u8 *hdr) nvbios_M0209Se(struct nvkm_bios *bios, int ent, int idx, u8 *ver, u8 *hdr)
{ {
u8 cnt, len; u8 cnt, len;
...@@ -108,7 +106,7 @@ nvbios_M0209Se(struct nouveau_bios *bios, int ent, int idx, u8 *ver, u8 *hdr) ...@@ -108,7 +106,7 @@ nvbios_M0209Se(struct nouveau_bios *bios, int ent, int idx, u8 *ver, u8 *hdr)
} }
u32 u32
nvbios_M0209Sp(struct nouveau_bios *bios, int ent, int idx, u8 *ver, u8 *hdr, nvbios_M0209Sp(struct nvkm_bios *bios, int ent, int idx, u8 *ver, u8 *hdr,
struct nvbios_M0209S *info) struct nvbios_M0209S *info)
{ {
struct nvbios_M0209E M0209E; struct nvbios_M0209E M0209E;
......
...@@ -21,14 +21,12 @@ ...@@ -21,14 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/ramcfg.h>
#include <subdev/bios/P0260.h> #include <subdev/bios/P0260.h>
u32 u32
nvbios_P0260Te(struct nouveau_bios *bios, nvbios_P0260Te(struct nvkm_bios *bios,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *xnr, u8 *xsz) u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *xnr, u8 *xsz)
{ {
struct bit_entry bit_P; struct bit_entry bit_P;
...@@ -57,7 +55,7 @@ nvbios_P0260Te(struct nouveau_bios *bios, ...@@ -57,7 +55,7 @@ nvbios_P0260Te(struct nouveau_bios *bios,
} }
u32 u32
nvbios_P0260Ee(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len) nvbios_P0260Ee(struct nvkm_bios *bios, int idx, u8 *ver, u8 *len)
{ {
u8 hdr, cnt, xnr, xsz; u8 hdr, cnt, xnr, xsz;
u32 data = nvbios_P0260Te(bios, ver, &hdr, &cnt, len, &xnr, &xsz); u32 data = nvbios_P0260Te(bios, ver, &hdr, &cnt, len, &xnr, &xsz);
...@@ -67,7 +65,7 @@ nvbios_P0260Ee(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len) ...@@ -67,7 +65,7 @@ nvbios_P0260Ee(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len)
} }
u32 u32
nvbios_P0260Ep(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len, nvbios_P0260Ep(struct nvkm_bios *bios, int idx, u8 *ver, u8 *len,
struct nvbios_P0260E *info) struct nvbios_P0260E *info)
{ {
u32 data = nvbios_P0260Ee(bios, idx, ver, len); u32 data = nvbios_P0260Ee(bios, idx, ver, len);
...@@ -83,7 +81,7 @@ nvbios_P0260Ep(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len, ...@@ -83,7 +81,7 @@ nvbios_P0260Ep(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len,
} }
u32 u32
nvbios_P0260Xe(struct nouveau_bios *bios, int idx, u8 *ver, u8 *xsz) nvbios_P0260Xe(struct nvkm_bios *bios, int idx, u8 *ver, u8 *xsz)
{ {
u8 hdr, cnt, len, xnr; u8 hdr, cnt, len, xnr;
u32 data = nvbios_P0260Te(bios, ver, &hdr, &cnt, &len, &xnr, xsz); u32 data = nvbios_P0260Te(bios, ver, &hdr, &cnt, &len, &xnr, xsz);
...@@ -93,7 +91,7 @@ nvbios_P0260Xe(struct nouveau_bios *bios, int idx, u8 *ver, u8 *xsz) ...@@ -93,7 +91,7 @@ nvbios_P0260Xe(struct nouveau_bios *bios, int idx, u8 *ver, u8 *xsz)
} }
u32 u32
nvbios_P0260Xp(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr, nvbios_P0260Xp(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr,
struct nvbios_P0260X *info) struct nvbios_P0260X *info)
{ {
u32 data = nvbios_P0260Xe(bios, idx, ver, hdr); u32 data = nvbios_P0260Xe(bios, idx, ver, hdr);
......
...@@ -21,18 +21,12 @@ ...@@ -21,18 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "priv.h"
#include <core/object.h>
#include <core/device.h>
#include <core/subdev.h>
#include <core/option.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bmp.h> #include <subdev/bios/bmp.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include "priv.h"
u8 u8
nvbios_checksum(const u8 *data, int size) nvbios_checksum(const u8 *data, int size)
{ {
...@@ -59,7 +53,7 @@ nvbios_findstr(const u8 *data, int size, const char *str, int len) ...@@ -59,7 +53,7 @@ nvbios_findstr(const u8 *data, int size, const char *str, int len)
} }
int int
nvbios_extend(struct nouveau_bios *bios, u32 length) nvbios_extend(struct nvkm_bios *bios, u32 length)
{ {
if (bios->size < length) { if (bios->size < length) {
u8 *prev = bios->data; u8 *prev = bios->data;
...@@ -76,59 +70,58 @@ nvbios_extend(struct nouveau_bios *bios, u32 length) ...@@ -76,59 +70,58 @@ nvbios_extend(struct nouveau_bios *bios, u32 length)
} }
static u8 static u8
nouveau_bios_rd08(struct nouveau_object *object, u64 addr) nvkm_bios_rd08(struct nvkm_object *object, u64 addr)
{ {
struct nouveau_bios *bios = (void *)object; struct nvkm_bios *bios = (void *)object;
return bios->data[addr]; return bios->data[addr];
} }
static u16 static u16
nouveau_bios_rd16(struct nouveau_object *object, u64 addr) nvkm_bios_rd16(struct nvkm_object *object, u64 addr)
{ {
struct nouveau_bios *bios = (void *)object; struct nvkm_bios *bios = (void *)object;
return get_unaligned_le16(&bios->data[addr]); return get_unaligned_le16(&bios->data[addr]);
} }
static u32 static u32
nouveau_bios_rd32(struct nouveau_object *object, u64 addr) nvkm_bios_rd32(struct nvkm_object *object, u64 addr)
{ {
struct nouveau_bios *bios = (void *)object; struct nvkm_bios *bios = (void *)object;
return get_unaligned_le32(&bios->data[addr]); return get_unaligned_le32(&bios->data[addr]);
} }
static void static void
nouveau_bios_wr08(struct nouveau_object *object, u64 addr, u8 data) nvkm_bios_wr08(struct nvkm_object *object, u64 addr, u8 data)
{ {
struct nouveau_bios *bios = (void *)object; struct nvkm_bios *bios = (void *)object;
bios->data[addr] = data; bios->data[addr] = data;
} }
static void static void
nouveau_bios_wr16(struct nouveau_object *object, u64 addr, u16 data) nvkm_bios_wr16(struct nvkm_object *object, u64 addr, u16 data)
{ {
struct nouveau_bios *bios = (void *)object; struct nvkm_bios *bios = (void *)object;
put_unaligned_le16(data, &bios->data[addr]); put_unaligned_le16(data, &bios->data[addr]);
} }
static void static void
nouveau_bios_wr32(struct nouveau_object *object, u64 addr, u32 data) nvkm_bios_wr32(struct nvkm_object *object, u64 addr, u32 data)
{ {
struct nouveau_bios *bios = (void *)object; struct nvkm_bios *bios = (void *)object;
put_unaligned_le32(data, &bios->data[addr]); put_unaligned_le32(data, &bios->data[addr]);
} }
static int static int
nouveau_bios_ctor(struct nouveau_object *parent, nvkm_bios_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_object *engine, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_object **pobject)
struct nouveau_object **pobject)
{ {
struct nouveau_bios *bios; struct nvkm_bios *bios;
struct bit_entry bit_i; struct bit_entry bit_i;
int ret; int ret;
ret = nouveau_subdev_create(parent, engine, oclass, 0, ret = nvkm_subdev_create(parent, engine, oclass, 0,
"VBIOS", "bios", &bios); "VBIOS", "bios", &bios);
*pobject = nv_object(bios); *pobject = nv_object(bios);
if (ret) if (ret)
return ret; return ret;
...@@ -174,40 +167,40 @@ nouveau_bios_ctor(struct nouveau_object *parent, ...@@ -174,40 +167,40 @@ nouveau_bios_ctor(struct nouveau_object *parent,
} }
static void static void
nouveau_bios_dtor(struct nouveau_object *object) nvkm_bios_dtor(struct nvkm_object *object)
{ {
struct nouveau_bios *bios = (void *)object; struct nvkm_bios *bios = (void *)object;
kfree(bios->data); kfree(bios->data);
nouveau_subdev_destroy(&bios->base); nvkm_subdev_destroy(&bios->base);
} }
static int static int
nouveau_bios_init(struct nouveau_object *object) nvkm_bios_init(struct nvkm_object *object)
{ {
struct nouveau_bios *bios = (void *)object; struct nvkm_bios *bios = (void *)object;
return nouveau_subdev_init(&bios->base); return nvkm_subdev_init(&bios->base);
} }
static int static int
nouveau_bios_fini(struct nouveau_object *object, bool suspend) nvkm_bios_fini(struct nvkm_object *object, bool suspend)
{ {
struct nouveau_bios *bios = (void *)object; struct nvkm_bios *bios = (void *)object;
return nouveau_subdev_fini(&bios->base, suspend); return nvkm_subdev_fini(&bios->base, suspend);
} }
struct nouveau_oclass struct nvkm_oclass
nouveau_bios_oclass = { nvkm_bios_oclass = {
.handle = NV_SUBDEV(VBIOS, 0x00), .handle = NV_SUBDEV(VBIOS, 0x00),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nouveau_bios_ctor, .ctor = nvkm_bios_ctor,
.dtor = nouveau_bios_dtor, .dtor = nvkm_bios_dtor,
.init = nouveau_bios_init, .init = nvkm_bios_init,
.fini = nouveau_bios_fini, .fini = nvkm_bios_fini,
.rd08 = nouveau_bios_rd08, .rd08 = nvkm_bios_rd08,
.rd16 = nouveau_bios_rd16, .rd16 = nvkm_bios_rd16,
.rd32 = nouveau_bios_rd32, .rd32 = nvkm_bios_rd32,
.wr08 = nouveau_bios_wr08, .wr08 = nvkm_bios_wr08,
.wr16 = nouveau_bios_wr16, .wr16 = nvkm_bios_wr16,
.wr32 = nouveau_bios_wr32, .wr32 = nvkm_bios_wr32,
}, },
}; };
...@@ -21,14 +21,11 @@ ...@@ -21,14 +21,11 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h>
#include "core/object.h" #include <subdev/bios/bit.h>
#include "subdev/bios.h"
#include "subdev/bios/bit.h"
int int
bit_entry(struct nouveau_bios *bios, u8 id, struct bit_entry *bit) bit_entry(struct nvkm_bios *bios, u8 id, struct bit_entry *bit)
{ {
if (likely(bios->bit_offset)) { if (likely(bios->bit_offset)) {
u8 entries = nv_ro08(bios, bios->bit_offset + 10); u8 entries = nv_ro08(bios, bios->bit_offset + 10);
......
...@@ -21,13 +21,12 @@ ...@@ -21,13 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/boost.h> #include <subdev/bios/boost.h>
u16 u16
nvbios_boostTe(struct nouveau_bios *bios, nvbios_boostTe(struct nvkm_bios *bios,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz) u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz)
{ {
struct bit_entry bit_P; struct bit_entry bit_P;
...@@ -57,7 +56,7 @@ nvbios_boostTe(struct nouveau_bios *bios, ...@@ -57,7 +56,7 @@ nvbios_boostTe(struct nouveau_bios *bios,
} }
u16 u16
nvbios_boostEe(struct nouveau_bios *bios, int idx, nvbios_boostEe(struct nvkm_bios *bios, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len) u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
u8 snr, ssz; u8 snr, ssz;
...@@ -73,7 +72,7 @@ nvbios_boostEe(struct nouveau_bios *bios, int idx, ...@@ -73,7 +72,7 @@ nvbios_boostEe(struct nouveau_bios *bios, int idx,
} }
u16 u16
nvbios_boostEp(struct nouveau_bios *bios, int idx, nvbios_boostEp(struct nvkm_bios *bios, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_boostE *info) u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_boostE *info)
{ {
u16 data = nvbios_boostEe(bios, idx, ver, hdr, cnt, len); u16 data = nvbios_boostEe(bios, idx, ver, hdr, cnt, len);
...@@ -87,7 +86,7 @@ nvbios_boostEp(struct nouveau_bios *bios, int idx, ...@@ -87,7 +86,7 @@ nvbios_boostEp(struct nouveau_bios *bios, int idx,
} }
u16 u16
nvbios_boostEm(struct nouveau_bios *bios, u8 pstate, nvbios_boostEm(struct nvkm_bios *bios, u8 pstate,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_boostE *info) u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_boostE *info)
{ {
u32 data, idx = 0; u32 data, idx = 0;
...@@ -99,7 +98,7 @@ nvbios_boostEm(struct nouveau_bios *bios, u8 pstate, ...@@ -99,7 +98,7 @@ nvbios_boostEm(struct nouveau_bios *bios, u8 pstate,
} }
u16 u16
nvbios_boostSe(struct nouveau_bios *bios, int idx, nvbios_boostSe(struct nvkm_bios *bios, int idx,
u16 data, u8 *ver, u8 *hdr, u8 cnt, u8 len) u16 data, u8 *ver, u8 *hdr, u8 cnt, u8 len)
{ {
if (data && idx < cnt) { if (data && idx < cnt) {
...@@ -111,7 +110,7 @@ nvbios_boostSe(struct nouveau_bios *bios, int idx, ...@@ -111,7 +110,7 @@ nvbios_boostSe(struct nouveau_bios *bios, int idx,
} }
u16 u16
nvbios_boostSp(struct nouveau_bios *bios, int idx, nvbios_boostSp(struct nvkm_bios *bios, int idx,
u16 data, u8 *ver, u8 *hdr, u8 cnt, u8 len, u16 data, u8 *ver, u8 *hdr, u8 cnt, u8 len,
struct nvbios_boostS *info) struct nvbios_boostS *info)
{ {
......
...@@ -21,15 +21,12 @@ ...@@ -21,15 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <core/device.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/dcb.h> #include <subdev/bios/dcb.h>
#include <subdev/bios/conn.h> #include <subdev/bios/conn.h>
u32 u32
nvbios_connTe(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) nvbios_connTe(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
u32 dcb = dcb_table(bios, ver, hdr, cnt, len); u32 dcb = dcb_table(bios, ver, hdr, cnt, len);
if (dcb && *ver >= 0x30 && *hdr >= 0x16) { if (dcb && *ver >= 0x30 && *hdr >= 0x16) {
...@@ -46,7 +43,7 @@ nvbios_connTe(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) ...@@ -46,7 +43,7 @@ nvbios_connTe(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
} }
u32 u32
nvbios_connTp(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, nvbios_connTp(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_connT *info) struct nvbios_connT *info)
{ {
u32 data = nvbios_connTe(bios, ver, hdr, cnt, len); u32 data = nvbios_connTe(bios, ver, hdr, cnt, len);
...@@ -62,7 +59,7 @@ nvbios_connTp(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, ...@@ -62,7 +59,7 @@ nvbios_connTp(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
} }
u32 u32
nvbios_connEe(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len) nvbios_connEe(struct nvkm_bios *bios, u8 idx, u8 *ver, u8 *len)
{ {
u8 hdr, cnt; u8 hdr, cnt;
u32 data = nvbios_connTe(bios, ver, &hdr, &cnt, len); u32 data = nvbios_connTe(bios, ver, &hdr, &cnt, len);
...@@ -72,7 +69,7 @@ nvbios_connEe(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len) ...@@ -72,7 +69,7 @@ nvbios_connEe(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len)
} }
u32 u32
nvbios_connEp(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len, nvbios_connEp(struct nvkm_bios *bios, u8 idx, u8 *ver, u8 *len,
struct nvbios_connE *info) struct nvbios_connE *info)
{ {
u32 data = nvbios_connEe(bios, idx, ver, len); u32 data = nvbios_connEe(bios, idx, ver, len);
......
...@@ -21,13 +21,12 @@ ...@@ -21,13 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/cstep.h> #include <subdev/bios/cstep.h>
u16 u16
nvbios_cstepTe(struct nouveau_bios *bios, nvbios_cstepTe(struct nvkm_bios *bios,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *xnr, u8 *xsz) u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *xnr, u8 *xsz)
{ {
struct bit_entry bit_P; struct bit_entry bit_P;
...@@ -57,7 +56,7 @@ nvbios_cstepTe(struct nouveau_bios *bios, ...@@ -57,7 +56,7 @@ nvbios_cstepTe(struct nouveau_bios *bios,
} }
u16 u16
nvbios_cstepEe(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr) nvbios_cstepEe(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr)
{ {
u8 cnt, len, xnr, xsz; u8 cnt, len, xnr, xsz;
u16 data = nvbios_cstepTe(bios, ver, hdr, &cnt, &len, &xnr, &xsz); u16 data = nvbios_cstepTe(bios, ver, hdr, &cnt, &len, &xnr, &xsz);
...@@ -70,7 +69,7 @@ nvbios_cstepEe(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr) ...@@ -70,7 +69,7 @@ nvbios_cstepEe(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr)
} }
u16 u16
nvbios_cstepEp(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr, nvbios_cstepEp(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr,
struct nvbios_cstepE *info) struct nvbios_cstepE *info)
{ {
u16 data = nvbios_cstepEe(bios, idx, ver, hdr); u16 data = nvbios_cstepEe(bios, idx, ver, hdr);
...@@ -83,7 +82,7 @@ nvbios_cstepEp(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr, ...@@ -83,7 +82,7 @@ nvbios_cstepEp(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr,
} }
u16 u16
nvbios_cstepEm(struct nouveau_bios *bios, u8 pstate, u8 *ver, u8 *hdr, nvbios_cstepEm(struct nvkm_bios *bios, u8 pstate, u8 *ver, u8 *hdr,
struct nvbios_cstepE *info) struct nvbios_cstepE *info)
{ {
u32 data, idx = 0; u32 data, idx = 0;
...@@ -95,7 +94,7 @@ nvbios_cstepEm(struct nouveau_bios *bios, u8 pstate, u8 *ver, u8 *hdr, ...@@ -95,7 +94,7 @@ nvbios_cstepEm(struct nouveau_bios *bios, u8 pstate, u8 *ver, u8 *hdr,
} }
u16 u16
nvbios_cstepXe(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr) nvbios_cstepXe(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr)
{ {
u8 cnt, len, xnr, xsz; u8 cnt, len, xnr, xsz;
u16 data = nvbios_cstepTe(bios, ver, hdr, &cnt, &len, &xnr, &xsz); u16 data = nvbios_cstepTe(bios, ver, hdr, &cnt, &len, &xnr, &xsz);
...@@ -108,7 +107,7 @@ nvbios_cstepXe(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr) ...@@ -108,7 +107,7 @@ nvbios_cstepXe(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr)
} }
u16 u16
nvbios_cstepXp(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr, nvbios_cstepXp(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr,
struct nvbios_cstepX *info) struct nvbios_cstepX *info)
{ {
u16 data = nvbios_cstepXe(bios, idx, ver, hdr); u16 data = nvbios_cstepXe(bios, idx, ver, hdr);
......
...@@ -21,16 +21,15 @@ ...@@ -21,16 +21,15 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h>
#include <subdev/bios/dcb.h>
#include "core/device.h" #include <core/device.h>
#include "subdev/bios.h"
#include "subdev/bios/dcb.h"
u16 u16
dcb_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) dcb_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
struct nouveau_device *device = nv_device(bios); struct nvkm_device *device = nv_device(bios);
u16 dcb = 0x0000; u16 dcb = 0x0000;
if (device->card_type > NV_04) if (device->card_type > NV_04)
...@@ -98,7 +97,7 @@ dcb_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) ...@@ -98,7 +97,7 @@ dcb_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
} }
u16 u16
dcb_outp(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len) dcb_outp(struct nvkm_bios *bios, u8 idx, u8 *ver, u8 *len)
{ {
u8 hdr, cnt; u8 hdr, cnt;
u16 dcb = dcb_table(bios, ver, &hdr, &cnt, len); u16 dcb = dcb_table(bios, ver, &hdr, &cnt, len);
...@@ -120,7 +119,7 @@ dcb_outp_hashm(struct dcb_output *outp) ...@@ -120,7 +119,7 @@ dcb_outp_hashm(struct dcb_output *outp)
} }
u16 u16
dcb_outp_parse(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len, dcb_outp_parse(struct nvkm_bios *bios, u8 idx, u8 *ver, u8 *len,
struct dcb_output *outp) struct dcb_output *outp)
{ {
u16 dcb = dcb_outp(bios, idx, ver, len); u16 dcb = dcb_outp(bios, idx, ver, len);
...@@ -194,7 +193,7 @@ dcb_outp_parse(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len, ...@@ -194,7 +193,7 @@ dcb_outp_parse(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len,
} }
u16 u16
dcb_outp_match(struct nouveau_bios *bios, u16 type, u16 mask, dcb_outp_match(struct nvkm_bios *bios, u16 type, u16 mask,
u8 *ver, u8 *len, struct dcb_output *outp) u8 *ver, u8 *len, struct dcb_output *outp)
{ {
u16 dcb, idx = 0; u16 dcb, idx = 0;
...@@ -208,8 +207,8 @@ dcb_outp_match(struct nouveau_bios *bios, u16 type, u16 mask, ...@@ -208,8 +207,8 @@ dcb_outp_match(struct nouveau_bios *bios, u16 type, u16 mask,
} }
int int
dcb_outp_foreach(struct nouveau_bios *bios, void *data, dcb_outp_foreach(struct nvkm_bios *bios, void *data,
int (*exec)(struct nouveau_bios *, void *, int, u16)) int (*exec)(struct nvkm_bios *, void *, int, u16))
{ {
int ret, idx = -1; int ret, idx = -1;
u8 ver, len; u8 ver, len;
......
...@@ -21,13 +21,12 @@ ...@@ -21,13 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/disp.h> #include <subdev/bios/disp.h>
u16 u16
nvbios_disp_table(struct nouveau_bios *bios, nvbios_disp_table(struct nvkm_bios *bios,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *sub) u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *sub)
{ {
struct bit_entry U; struct bit_entry U;
...@@ -57,8 +56,7 @@ nvbios_disp_table(struct nouveau_bios *bios, ...@@ -57,8 +56,7 @@ nvbios_disp_table(struct nouveau_bios *bios,
} }
u16 u16
nvbios_disp_entry(struct nouveau_bios *bios, u8 idx, nvbios_disp_entry(struct nvkm_bios *bios, u8 idx, u8 *ver, u8 *len, u8 *sub)
u8 *ver, u8 *len, u8 *sub)
{ {
u8 hdr, cnt; u8 hdr, cnt;
u16 data = nvbios_disp_table(bios, ver, &hdr, &cnt, len, sub); u16 data = nvbios_disp_table(bios, ver, &hdr, &cnt, len, sub);
...@@ -69,8 +67,7 @@ nvbios_disp_entry(struct nouveau_bios *bios, u8 idx, ...@@ -69,8 +67,7 @@ nvbios_disp_entry(struct nouveau_bios *bios, u8 idx,
} }
u16 u16
nvbios_disp_parse(struct nouveau_bios *bios, u8 idx, nvbios_disp_parse(struct nvkm_bios *bios, u8 idx, u8 *ver, u8 *len, u8 *sub,
u8 *ver, u8 *len, u8 *sub,
struct nvbios_disp *info) struct nvbios_disp *info)
{ {
u16 data = nvbios_disp_entry(bios, idx, ver, len, sub); u16 data = nvbios_disp_entry(bios, idx, ver, len, sub);
...@@ -82,7 +79,7 @@ nvbios_disp_parse(struct nouveau_bios *bios, u8 idx, ...@@ -82,7 +79,7 @@ nvbios_disp_parse(struct nouveau_bios *bios, u8 idx,
} }
u16 u16
nvbios_outp_entry(struct nouveau_bios *bios, u8 idx, nvbios_outp_entry(struct nvkm_bios *bios, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len) u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
struct nvbios_disp info; struct nvbios_disp info;
...@@ -96,9 +93,8 @@ nvbios_outp_entry(struct nouveau_bios *bios, u8 idx, ...@@ -96,9 +93,8 @@ nvbios_outp_entry(struct nouveau_bios *bios, u8 idx,
} }
u16 u16
nvbios_outp_parse(struct nouveau_bios *bios, u8 idx, nvbios_outp_parse(struct nvkm_bios *bios, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_outp *info)
struct nvbios_outp *info)
{ {
u16 data = nvbios_outp_entry(bios, idx, ver, hdr, cnt, len); u16 data = nvbios_outp_entry(bios, idx, ver, hdr, cnt, len);
if (data && *hdr >= 0x0a) { if (data && *hdr >= 0x0a) {
...@@ -117,9 +113,8 @@ nvbios_outp_parse(struct nouveau_bios *bios, u8 idx, ...@@ -117,9 +113,8 @@ nvbios_outp_parse(struct nouveau_bios *bios, u8 idx,
} }
u16 u16
nvbios_outp_match(struct nouveau_bios *bios, u16 type, u16 mask, nvbios_outp_match(struct nvkm_bios *bios, u16 type, u16 mask,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_outp *info)
struct nvbios_outp *info)
{ {
u16 data, idx = 0; u16 data, idx = 0;
while ((data = nvbios_outp_parse(bios, idx++, ver, hdr, cnt, len, info)) || *ver) { while ((data = nvbios_outp_parse(bios, idx++, ver, hdr, cnt, len, info)) || *ver) {
...@@ -132,7 +127,7 @@ nvbios_outp_match(struct nouveau_bios *bios, u16 type, u16 mask, ...@@ -132,7 +127,7 @@ nvbios_outp_match(struct nouveau_bios *bios, u16 type, u16 mask,
} }
u16 u16
nvbios_ocfg_entry(struct nouveau_bios *bios, u16 outp, u8 idx, nvbios_ocfg_entry(struct nvkm_bios *bios, u16 outp, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len) u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
if (idx < *cnt) if (idx < *cnt)
...@@ -141,9 +136,8 @@ nvbios_ocfg_entry(struct nouveau_bios *bios, u16 outp, u8 idx, ...@@ -141,9 +136,8 @@ nvbios_ocfg_entry(struct nouveau_bios *bios, u16 outp, u8 idx,
} }
u16 u16
nvbios_ocfg_parse(struct nouveau_bios *bios, u16 outp, u8 idx, nvbios_ocfg_parse(struct nvkm_bios *bios, u16 outp, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_ocfg *info)
struct nvbios_ocfg *info)
{ {
u16 data = nvbios_ocfg_entry(bios, outp, idx, ver, hdr, cnt, len); u16 data = nvbios_ocfg_entry(bios, outp, idx, ver, hdr, cnt, len);
if (data) { if (data) {
...@@ -155,9 +149,8 @@ nvbios_ocfg_parse(struct nouveau_bios *bios, u16 outp, u8 idx, ...@@ -155,9 +149,8 @@ nvbios_ocfg_parse(struct nouveau_bios *bios, u16 outp, u8 idx,
} }
u16 u16
nvbios_ocfg_match(struct nouveau_bios *bios, u16 outp, u16 type, nvbios_ocfg_match(struct nvkm_bios *bios, u16 outp, u16 type,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_ocfg *info)
struct nvbios_ocfg *info)
{ {
u16 data, idx = 0; u16 data, idx = 0;
while ((data = nvbios_ocfg_parse(bios, outp, idx++, ver, hdr, cnt, len, info))) { while ((data = nvbios_ocfg_parse(bios, outp, idx++, ver, hdr, cnt, len, info))) {
...@@ -168,7 +161,7 @@ nvbios_ocfg_match(struct nouveau_bios *bios, u16 outp, u16 type, ...@@ -168,7 +161,7 @@ nvbios_ocfg_match(struct nouveau_bios *bios, u16 outp, u16 type,
} }
u16 u16
nvbios_oclk_match(struct nouveau_bios *bios, u16 cmp, u32 khz) nvbios_oclk_match(struct nvkm_bios *bios, u16 cmp, u32 khz)
{ {
while (cmp) { while (cmp) {
if (khz / 10 >= nv_ro16(bios, cmp + 0x00)) if (khz / 10 >= nv_ro16(bios, cmp + 0x00))
......
...@@ -21,14 +21,12 @@ ...@@ -21,14 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h>
#include <subdev/bios/bit.h>
#include "subdev/bios.h" #include <subdev/bios/dp.h>
#include "subdev/bios/bit.h"
#include "subdev/bios/dp.h"
static u16 static u16
nvbios_dp_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) nvbios_dp_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
struct bit_entry d; struct bit_entry d;
...@@ -57,7 +55,7 @@ nvbios_dp_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) ...@@ -57,7 +55,7 @@ nvbios_dp_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
} }
static u16 static u16
nvbios_dpout_entry(struct nouveau_bios *bios, u8 idx, nvbios_dpout_entry(struct nvkm_bios *bios, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len) u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
u16 data = nvbios_dp_table(bios, ver, hdr, cnt, len); u16 data = nvbios_dp_table(bios, ver, hdr, cnt, len);
...@@ -86,7 +84,7 @@ nvbios_dpout_entry(struct nouveau_bios *bios, u8 idx, ...@@ -86,7 +84,7 @@ nvbios_dpout_entry(struct nouveau_bios *bios, u8 idx,
} }
u16 u16
nvbios_dpout_parse(struct nouveau_bios *bios, u8 idx, nvbios_dpout_parse(struct nvkm_bios *bios, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_dpout *info) struct nvbios_dpout *info)
{ {
...@@ -128,7 +126,7 @@ nvbios_dpout_parse(struct nouveau_bios *bios, u8 idx, ...@@ -128,7 +126,7 @@ nvbios_dpout_parse(struct nouveau_bios *bios, u8 idx,
} }
u16 u16
nvbios_dpout_match(struct nouveau_bios *bios, u16 type, u16 mask, nvbios_dpout_match(struct nvkm_bios *bios, u16 type, u16 mask,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_dpout *info) struct nvbios_dpout *info)
{ {
...@@ -143,7 +141,7 @@ nvbios_dpout_match(struct nouveau_bios *bios, u16 type, u16 mask, ...@@ -143,7 +141,7 @@ nvbios_dpout_match(struct nouveau_bios *bios, u16 type, u16 mask,
} }
static u16 static u16
nvbios_dpcfg_entry(struct nouveau_bios *bios, u16 outp, u8 idx, nvbios_dpcfg_entry(struct nvkm_bios *bios, u16 outp, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len) u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
if (*ver >= 0x40) { if (*ver >= 0x40) {
...@@ -160,7 +158,7 @@ nvbios_dpcfg_entry(struct nouveau_bios *bios, u16 outp, u8 idx, ...@@ -160,7 +158,7 @@ nvbios_dpcfg_entry(struct nouveau_bios *bios, u16 outp, u8 idx,
} }
u16 u16
nvbios_dpcfg_parse(struct nouveau_bios *bios, u16 outp, u8 idx, nvbios_dpcfg_parse(struct nvkm_bios *bios, u16 outp, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_dpcfg *info) struct nvbios_dpcfg *info)
{ {
...@@ -190,7 +188,7 @@ nvbios_dpcfg_parse(struct nouveau_bios *bios, u16 outp, u8 idx, ...@@ -190,7 +188,7 @@ nvbios_dpcfg_parse(struct nouveau_bios *bios, u16 outp, u8 idx,
} }
u16 u16
nvbios_dpcfg_match(struct nouveau_bios *bios, u16 outp, u8 pc, u8 vs, u8 pe, nvbios_dpcfg_match(struct nvkm_bios *bios, u16 outp, u8 pc, u8 vs, u8 pe,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_dpcfg *info) struct nvbios_dpcfg *info)
{ {
......
...@@ -21,13 +21,12 @@ ...@@ -21,13 +21,12 @@
* *
* Authors: Martin Peres * Authors: Martin Peres
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/dcb.h> #include <subdev/bios/dcb.h>
#include <subdev/bios/extdev.h> #include <subdev/bios/extdev.h>
static u16 static u16
extdev_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *len, u8 *cnt) extdev_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *len, u8 *cnt)
{ {
u8 dcb_ver, dcb_hdr, dcb_cnt, dcb_len; u8 dcb_ver, dcb_hdr, dcb_cnt, dcb_len;
u16 dcb, extdev = 0; u16 dcb, extdev = 0;
...@@ -44,12 +43,11 @@ extdev_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *len, u8 *cnt) ...@@ -44,12 +43,11 @@ extdev_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *len, u8 *cnt)
*hdr = nv_ro08(bios, extdev + 1); *hdr = nv_ro08(bios, extdev + 1);
*cnt = nv_ro08(bios, extdev + 2); *cnt = nv_ro08(bios, extdev + 2);
*len = nv_ro08(bios, extdev + 3); *len = nv_ro08(bios, extdev + 3);
return extdev + *hdr; return extdev + *hdr;
} }
static u16 static u16
nvbios_extdev_entry(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len) nvbios_extdev_entry(struct nvkm_bios *bios, int idx, u8 *ver, u8 *len)
{ {
u8 hdr, cnt; u8 hdr, cnt;
u16 extdev = extdev_table(bios, ver, &hdr, len, &cnt); u16 extdev = extdev_table(bios, ver, &hdr, len, &cnt);
...@@ -59,8 +57,8 @@ nvbios_extdev_entry(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len) ...@@ -59,8 +57,8 @@ nvbios_extdev_entry(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len)
} }
static void static void
extdev_parse_entry(struct nouveau_bios *bios, u16 offset, extdev_parse_entry(struct nvkm_bios *bios, u16 offset,
struct nvbios_extdev_func *entry) struct nvbios_extdev_func *entry)
{ {
entry->type = nv_ro08(bios, offset + 0); entry->type = nv_ro08(bios, offset + 0);
entry->addr = nv_ro08(bios, offset + 1); entry->addr = nv_ro08(bios, offset + 1);
...@@ -68,7 +66,7 @@ extdev_parse_entry(struct nouveau_bios *bios, u16 offset, ...@@ -68,7 +66,7 @@ extdev_parse_entry(struct nouveau_bios *bios, u16 offset,
} }
int int
nvbios_extdev_parse(struct nouveau_bios *bios, int idx, nvbios_extdev_parse(struct nvkm_bios *bios, int idx,
struct nvbios_extdev_func *func) struct nvbios_extdev_func *func)
{ {
u8 ver, len; u8 ver, len;
...@@ -78,12 +76,11 @@ nvbios_extdev_parse(struct nouveau_bios *bios, int idx, ...@@ -78,12 +76,11 @@ nvbios_extdev_parse(struct nouveau_bios *bios, int idx,
return -EINVAL; return -EINVAL;
extdev_parse_entry(bios, entry, func); extdev_parse_entry(bios, entry, func);
return 0; return 0;
} }
int int
nvbios_extdev_find(struct nouveau_bios *bios, enum nvbios_extdev_type type, nvbios_extdev_find(struct nvkm_bios *bios, enum nvbios_extdev_type type,
struct nvbios_extdev_func *func) struct nvbios_extdev_func *func)
{ {
u8 ver, len, i; u8 ver, len, i;
......
...@@ -21,13 +21,12 @@ ...@@ -21,13 +21,12 @@
* *
* Authors: Martin Peres * Authors: Martin Peres
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/fan.h> #include <subdev/bios/fan.h>
u16 u16
nvbios_fan_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) nvbios_fan_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
struct bit_entry bit_P; struct bit_entry bit_P;
u16 fan = 0x0000; u16 fan = 0x0000;
...@@ -54,7 +53,7 @@ nvbios_fan_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) ...@@ -54,7 +53,7 @@ nvbios_fan_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
} }
u16 u16
nvbios_fan_entry(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr, nvbios_fan_entry(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr,
u8 *cnt, u8 *len) u8 *cnt, u8 *len)
{ {
u16 data = nvbios_fan_table(bios, ver, hdr, cnt, len); u16 data = nvbios_fan_table(bios, ver, hdr, cnt, len);
...@@ -64,7 +63,7 @@ nvbios_fan_entry(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr, ...@@ -64,7 +63,7 @@ nvbios_fan_entry(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr,
} }
u16 u16
nvbios_fan_parse(struct nouveau_bios *bios, struct nvbios_therm_fan *fan) nvbios_fan_parse(struct nvkm_bios *bios, struct nvbios_therm_fan *fan)
{ {
u8 ver, hdr, cnt, len; u8 ver, hdr, cnt, len;
...@@ -89,5 +88,6 @@ nvbios_fan_parse(struct nouveau_bios *bios, struct nvbios_therm_fan *fan) ...@@ -89,5 +88,6 @@ nvbios_fan_parse(struct nouveau_bios *bios, struct nvbios_therm_fan *fan)
fan->pwm_freq = nv_ro32(bios, data + 0x0b) & 0xffffff; fan->pwm_freq = nv_ro32(bios, data + 0x0b) & 0xffffff;
} }
return data; return data;
} }
...@@ -21,14 +21,13 @@ ...@@ -21,14 +21,13 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/dcb.h> #include <subdev/bios/dcb.h>
#include <subdev/bios/gpio.h> #include <subdev/bios/gpio.h>
#include <subdev/bios/xpio.h> #include <subdev/bios/xpio.h>
u16 u16
dcb_gpio_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) dcb_gpio_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
u16 data = 0x0000; u16 data = 0x0000;
u16 dcb = dcb_table(bios, ver, hdr, cnt, len); u16 dcb = dcb_table(bios, ver, hdr, cnt, len);
...@@ -59,7 +58,7 @@ dcb_gpio_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) ...@@ -59,7 +58,7 @@ dcb_gpio_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
} }
u16 u16
dcb_gpio_entry(struct nouveau_bios *bios, int idx, int ent, u8 *ver, u8 *len) dcb_gpio_entry(struct nvkm_bios *bios, int idx, int ent, u8 *ver, u8 *len)
{ {
u8 hdr, cnt, xver; /* use gpio version for xpio entry parsing */ u8 hdr, cnt, xver; /* use gpio version for xpio entry parsing */
u16 gpio; u16 gpio;
...@@ -71,11 +70,12 @@ dcb_gpio_entry(struct nouveau_bios *bios, int idx, int ent, u8 *ver, u8 *len) ...@@ -71,11 +70,12 @@ dcb_gpio_entry(struct nouveau_bios *bios, int idx, int ent, u8 *ver, u8 *len)
if (gpio && ent < cnt) if (gpio && ent < cnt)
return gpio + hdr + (ent * *len); return gpio + hdr + (ent * *len);
return 0x0000; return 0x0000;
} }
u16 u16
dcb_gpio_parse(struct nouveau_bios *bios, int idx, int ent, u8 *ver, u8 *len, dcb_gpio_parse(struct nvkm_bios *bios, int idx, int ent, u8 *ver, u8 *len,
struct dcb_gpio_func *gpio) struct dcb_gpio_func *gpio)
{ {
u16 data = dcb_gpio_entry(bios, idx, ent, ver, len); u16 data = dcb_gpio_entry(bios, idx, ent, ver, len);
...@@ -116,7 +116,7 @@ dcb_gpio_parse(struct nouveau_bios *bios, int idx, int ent, u8 *ver, u8 *len, ...@@ -116,7 +116,7 @@ dcb_gpio_parse(struct nouveau_bios *bios, int idx, int ent, u8 *ver, u8 *len,
} }
u16 u16
dcb_gpio_match(struct nouveau_bios *bios, int idx, u8 func, u8 line, dcb_gpio_match(struct nvkm_bios *bios, int idx, u8 func, u8 line,
u8 *ver, u8 *len, struct dcb_gpio_func *gpio) u8 *ver, u8 *len, struct dcb_gpio_func *gpio)
{ {
u8 hdr, cnt, i = 0; u8 hdr, cnt, i = 0;
......
...@@ -21,14 +21,12 @@ ...@@ -21,14 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h>
#include <subdev/bios/dcb.h>
#include "subdev/bios.h" #include <subdev/bios/i2c.h>
#include "subdev/bios/dcb.h"
#include "subdev/bios/i2c.h"
u16 u16
dcb_i2c_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) dcb_i2c_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
u16 i2c = 0x0000; u16 i2c = 0x0000;
u16 dcb = dcb_table(bios, ver, hdr, cnt, len); u16 dcb = dcb_table(bios, ver, hdr, cnt, len);
...@@ -60,7 +58,7 @@ dcb_i2c_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) ...@@ -60,7 +58,7 @@ dcb_i2c_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
} }
u16 u16
dcb_i2c_entry(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len) dcb_i2c_entry(struct nvkm_bios *bios, u8 idx, u8 *ver, u8 *len)
{ {
u8 hdr, cnt; u8 hdr, cnt;
u16 i2c = dcb_i2c_table(bios, ver, &hdr, &cnt, len); u16 i2c = dcb_i2c_table(bios, ver, &hdr, &cnt, len);
...@@ -70,7 +68,7 @@ dcb_i2c_entry(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len) ...@@ -70,7 +68,7 @@ dcb_i2c_entry(struct nouveau_bios *bios, u8 idx, u8 *ver, u8 *len)
} }
int int
dcb_i2c_parse(struct nouveau_bios *bios, u8 idx, struct dcb_i2c_entry *info) dcb_i2c_parse(struct nvkm_bios *bios, u8 idx, struct dcb_i2c_entry *info)
{ {
u8 ver, len; u8 ver, len;
u16 ent = dcb_i2c_entry(bios, idx, &ver, &len); u16 ent = dcb_i2c_entry(bios, idx, &ver, &len);
......
...@@ -21,14 +21,13 @@ ...@@ -21,14 +21,13 @@
* *
* Authors: Ben Skeggs <bskeggs@redhat.com> * Authors: Ben Skeggs <bskeggs@redhat.com>
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/image.h> #include <subdev/bios/image.h>
#include <subdev/bios/pcir.h> #include <subdev/bios/pcir.h>
#include <subdev/bios/npde.h> #include <subdev/bios/npde.h>
static bool static bool
nvbios_imagen(struct nouveau_bios *bios, struct nvbios_image *image) nvbios_imagen(struct nvkm_bios *bios, struct nvbios_image *image)
{ {
struct nvbios_pcirT pcir; struct nvbios_pcirT pcir;
struct nvbios_npdeT npde; struct nvbios_npdeT npde;
...@@ -66,7 +65,7 @@ nvbios_imagen(struct nouveau_bios *bios, struct nvbios_image *image) ...@@ -66,7 +65,7 @@ nvbios_imagen(struct nouveau_bios *bios, struct nvbios_image *image)
} }
bool bool
nvbios_image(struct nouveau_bios *bios, int idx, struct nvbios_image *image) nvbios_image(struct nvkm_bios *bios, int idx, struct nvbios_image *image)
{ {
memset(image, 0x00, sizeof(*image)); memset(image, 0x00, sizeof(*image));
do { do {
......
...@@ -21,13 +21,12 @@ ...@@ -21,13 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/mxm.h> #include <subdev/bios/mxm.h>
u16 u16
mxm_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr) mxm_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr)
{ {
struct bit_entry x; struct bit_entry x;
...@@ -51,28 +50,28 @@ mxm_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr) ...@@ -51,28 +50,28 @@ mxm_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr)
* *
* MXM v3.x VBIOS are nicer and provide pointers to these tables. * MXM v3.x VBIOS are nicer and provide pointers to these tables.
*/ */
static u8 nv84_sor_map[16] = { static u8 g84_sor_map[16] = {
0x00, 0x12, 0x22, 0x11, 0x32, 0x31, 0x11, 0x31, 0x00, 0x12, 0x22, 0x11, 0x32, 0x31, 0x11, 0x31,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
static u8 nv92_sor_map[16] = { static u8 g92_sor_map[16] = {
0x00, 0x12, 0x22, 0x11, 0x32, 0x31, 0x11, 0x31, 0x00, 0x12, 0x22, 0x11, 0x32, 0x31, 0x11, 0x31,
0x11, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0x11, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
static u8 nv94_sor_map[16] = { static u8 g94_sor_map[16] = {
0x00, 0x14, 0x24, 0x11, 0x34, 0x31, 0x11, 0x31, 0x00, 0x14, 0x24, 0x11, 0x34, 0x31, 0x11, 0x31,
0x11, 0x31, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00 0x11, 0x31, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
static u8 nv98_sor_map[16] = { static u8 g98_sor_map[16] = {
0x00, 0x14, 0x12, 0x11, 0x00, 0x31, 0x11, 0x31, 0x00, 0x14, 0x12, 0x11, 0x00, 0x31, 0x11, 0x31,
0x11, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 0x11, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}; };
u8 u8
mxm_sor_map(struct nouveau_bios *bios, u8 conn) mxm_sor_map(struct nvkm_bios *bios, u8 conn)
{ {
u8 ver, hdr; u8 ver, hdr;
u16 mxm = mxm_table(bios, &ver, &hdr); u16 mxm = mxm_table(bios, &ver, &hdr);
...@@ -95,20 +94,20 @@ mxm_sor_map(struct nouveau_bios *bios, u8 conn) ...@@ -95,20 +94,20 @@ mxm_sor_map(struct nouveau_bios *bios, u8 conn)
} }
if (bios->version.chip == 0x84 || bios->version.chip == 0x86) if (bios->version.chip == 0x84 || bios->version.chip == 0x86)
return nv84_sor_map[conn]; return g84_sor_map[conn];
if (bios->version.chip == 0x92) if (bios->version.chip == 0x92)
return nv92_sor_map[conn]; return g92_sor_map[conn];
if (bios->version.chip == 0x94 || bios->version.chip == 0x96) if (bios->version.chip == 0x94 || bios->version.chip == 0x96)
return nv94_sor_map[conn]; return g94_sor_map[conn];
if (bios->version.chip == 0x98) if (bios->version.chip == 0x98)
return nv98_sor_map[conn]; return g98_sor_map[conn];
nv_warn(bios, "missing sor map\n"); nv_warn(bios, "missing sor map\n");
return 0x00; return 0x00;
} }
u8 u8
mxm_ddc_map(struct nouveau_bios *bios, u8 port) mxm_ddc_map(struct nvkm_bios *bios, u8 port)
{ {
u8 ver, hdr; u8 ver, hdr;
u16 mxm = mxm_table(bios, &ver, &hdr); u16 mxm = mxm_table(bios, &ver, &hdr);
......
...@@ -21,13 +21,12 @@ ...@@ -21,13 +21,12 @@
* *
* Authors: Ben Skeggs <bskeggs@redhat.com> * Authors: Ben Skeggs <bskeggs@redhat.com>
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/npde.h> #include <subdev/bios/npde.h>
#include <subdev/bios/pcir.h> #include <subdev/bios/pcir.h>
u32 u32
nvbios_npdeTe(struct nouveau_bios *bios, u32 base) nvbios_npdeTe(struct nvkm_bios *bios, u32 base)
{ {
struct nvbios_pcirT pcir; struct nvbios_pcirT pcir;
u8 ver; u16 hdr; u8 ver; u16 hdr;
...@@ -47,7 +46,7 @@ nvbios_npdeTe(struct nouveau_bios *bios, u32 base) ...@@ -47,7 +46,7 @@ nvbios_npdeTe(struct nouveau_bios *bios, u32 base)
} }
u32 u32
nvbios_npdeTp(struct nouveau_bios *bios, u32 base, struct nvbios_npdeT *info) nvbios_npdeTp(struct nvkm_bios *bios, u32 base, struct nvbios_npdeT *info)
{ {
u32 data = nvbios_npdeTe(bios, base); u32 data = nvbios_npdeTe(bios, base);
memset(info, 0x00, sizeof(*info)); memset(info, 0x00, sizeof(*info));
......
...@@ -21,12 +21,11 @@ ...@@ -21,12 +21,11 @@
* *
* Authors: Ben Skeggs <bskeggs@redhat.com> * Authors: Ben Skeggs <bskeggs@redhat.com>
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/pcir.h> #include <subdev/bios/pcir.h>
u32 u32
nvbios_pcirTe(struct nouveau_bios *bios, u32 base, u8 *ver, u16 *hdr) nvbios_pcirTe(struct nvkm_bios *bios, u32 base, u8 *ver, u16 *hdr)
{ {
u32 data = nv_ro16(bios, base + 0x18); u32 data = nv_ro16(bios, base + 0x18);
if (data) { if (data) {
...@@ -49,7 +48,7 @@ nvbios_pcirTe(struct nouveau_bios *bios, u32 base, u8 *ver, u16 *hdr) ...@@ -49,7 +48,7 @@ nvbios_pcirTe(struct nouveau_bios *bios, u32 base, u8 *ver, u16 *hdr)
} }
u32 u32
nvbios_pcirTp(struct nouveau_bios *bios, u32 base, u8 *ver, u16 *hdr, nvbios_pcirTp(struct nvkm_bios *bios, u32 base, u8 *ver, u16 *hdr,
struct nvbios_pcirT *info) struct nvbios_pcirT *info)
{ {
u32 data = nvbios_pcirTe(bios, base, ver, hdr); u32 data = nvbios_pcirTe(bios, base, ver, hdr);
......
...@@ -21,13 +21,14 @@ ...@@ -21,13 +21,14 @@
* *
* Authors: Martin Peres * Authors: Martin Peres
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/perf.h> #include <subdev/bios/perf.h>
#include <core/device.h>
u16 u16
nvbios_perf_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, nvbios_perf_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr,
u8 *cnt, u8 *len, u8 *snr, u8 *ssz) u8 *cnt, u8 *len, u8 *snr, u8 *ssz)
{ {
struct bit_entry bit_P; struct bit_entry bit_P;
...@@ -76,7 +77,7 @@ nvbios_perf_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, ...@@ -76,7 +77,7 @@ nvbios_perf_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr,
} }
u16 u16
nvbios_perf_entry(struct nouveau_bios *bios, int idx, nvbios_perf_entry(struct nvkm_bios *bios, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len) u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
u8 snr, ssz; u8 snr, ssz;
...@@ -92,9 +93,8 @@ nvbios_perf_entry(struct nouveau_bios *bios, int idx, ...@@ -92,9 +93,8 @@ nvbios_perf_entry(struct nouveau_bios *bios, int idx,
} }
u16 u16
nvbios_perfEp(struct nouveau_bios *bios, int idx, nvbios_perfEp(struct nvkm_bios *bios, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_perfE *info)
struct nvbios_perfE *info)
{ {
u16 perf = nvbios_perf_entry(bios, idx, ver, hdr, cnt, len); u16 perf = nvbios_perf_entry(bios, idx, ver, hdr, cnt, len);
memset(info, 0x00, sizeof(*info)); memset(info, 0x00, sizeof(*info));
...@@ -155,7 +155,7 @@ nvbios_perfEp(struct nouveau_bios *bios, int idx, ...@@ -155,7 +155,7 @@ nvbios_perfEp(struct nouveau_bios *bios, int idx,
} }
u32 u32
nvbios_perfSe(struct nouveau_bios *bios, u32 perfE, int idx, nvbios_perfSe(struct nvkm_bios *bios, u32 perfE, int idx,
u8 *ver, u8 *hdr, u8 cnt, u8 len) u8 *ver, u8 *hdr, u8 cnt, u8 len)
{ {
u32 data = 0x00000000; u32 data = 0x00000000;
...@@ -167,7 +167,7 @@ nvbios_perfSe(struct nouveau_bios *bios, u32 perfE, int idx, ...@@ -167,7 +167,7 @@ nvbios_perfSe(struct nouveau_bios *bios, u32 perfE, int idx,
} }
u32 u32
nvbios_perfSp(struct nouveau_bios *bios, u32 perfE, int idx, nvbios_perfSp(struct nvkm_bios *bios, u32 perfE, int idx,
u8 *ver, u8 *hdr, u8 cnt, u8 len, u8 *ver, u8 *hdr, u8 cnt, u8 len,
struct nvbios_perfS *info) struct nvbios_perfS *info)
{ {
...@@ -184,7 +184,7 @@ nvbios_perfSp(struct nouveau_bios *bios, u32 perfE, int idx, ...@@ -184,7 +184,7 @@ nvbios_perfSp(struct nouveau_bios *bios, u32 perfE, int idx,
} }
int int
nvbios_perf_fan_parse(struct nouveau_bios *bios, nvbios_perf_fan_parse(struct nvkm_bios *bios,
struct nvbios_perf_fan *fan) struct nvbios_perf_fan *fan)
{ {
u8 ver, hdr, cnt, len, snr, ssz; u8 ver, hdr, cnt, len, snr, ssz;
......
...@@ -21,12 +21,13 @@ ...@@ -21,12 +21,13 @@
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
#include <subdev/vga.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/bmp.h> #include <subdev/bios/bmp.h>
#include <subdev/bios/pll.h> #include <subdev/bios/pll.h>
#include <subdev/vga.h>
#include <core/device.h>
struct pll_mapping { struct pll_mapping {
u8 type; u8 type;
...@@ -66,7 +67,7 @@ nv50_pll_mapping[] = { ...@@ -66,7 +67,7 @@ nv50_pll_mapping[] = {
}; };
static struct pll_mapping static struct pll_mapping
nv84_pll_mapping[] = { g84_pll_mapping[] = {
{ PLL_CORE , 0x004028 }, { PLL_CORE , 0x004028 },
{ PLL_SHADER, 0x004020 }, { PLL_SHADER, 0x004020 },
{ PLL_MEMORY, 0x004008 }, { PLL_MEMORY, 0x004008 },
...@@ -78,7 +79,7 @@ nv84_pll_mapping[] = { ...@@ -78,7 +79,7 @@ nv84_pll_mapping[] = {
}; };
static u16 static u16
pll_limits_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) pll_limits_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
struct bit_entry bit_C; struct bit_entry bit_C;
...@@ -109,7 +110,7 @@ pll_limits_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) ...@@ -109,7 +110,7 @@ pll_limits_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
} }
static struct pll_mapping * static struct pll_mapping *
pll_map(struct nouveau_bios *bios) pll_map(struct nvkm_bios *bios)
{ {
switch (nv_device(bios)->card_type) { switch (nv_device(bios)->card_type) {
case NV_04: case NV_04:
...@@ -128,14 +129,14 @@ pll_map(struct nouveau_bios *bios) ...@@ -128,14 +129,14 @@ pll_map(struct nouveau_bios *bios)
if (nv_device(bios)->chipset < 0xa3 || if (nv_device(bios)->chipset < 0xa3 ||
nv_device(bios)->chipset == 0xaa || nv_device(bios)->chipset == 0xaa ||
nv_device(bios)->chipset == 0xac) nv_device(bios)->chipset == 0xac)
return nv84_pll_mapping; return g84_pll_mapping;
default: default:
return NULL; return NULL;
} }
} }
static u16 static u16
pll_map_reg(struct nouveau_bios *bios, u32 reg, u32 *type, u8 *ver, u8 *len) pll_map_reg(struct nvkm_bios *bios, u32 reg, u32 *type, u8 *ver, u8 *len)
{ {
struct pll_mapping *map; struct pll_mapping *map;
u8 hdr, cnt; u8 hdr, cnt;
...@@ -177,7 +178,7 @@ pll_map_reg(struct nouveau_bios *bios, u32 reg, u32 *type, u8 *ver, u8 *len) ...@@ -177,7 +178,7 @@ pll_map_reg(struct nouveau_bios *bios, u32 reg, u32 *type, u8 *ver, u8 *len)
} }
static u16 static u16
pll_map_type(struct nouveau_bios *bios, u8 type, u32 *reg, u8 *ver, u8 *len) pll_map_type(struct nvkm_bios *bios, u8 type, u32 *reg, u8 *ver, u8 *len)
{ {
struct pll_mapping *map; struct pll_mapping *map;
u8 hdr, cnt; u8 hdr, cnt;
...@@ -219,7 +220,7 @@ pll_map_type(struct nouveau_bios *bios, u8 type, u32 *reg, u8 *ver, u8 *len) ...@@ -219,7 +220,7 @@ pll_map_type(struct nouveau_bios *bios, u8 type, u32 *reg, u8 *ver, u8 *len)
} }
int int
nvbios_pll_parse(struct nouveau_bios *bios, u32 type, struct nvbios_pll *info) nvbios_pll_parse(struct nvkm_bios *bios, u32 type, struct nvbios_pll *info)
{ {
u8 ver, len; u8 ver, len;
u32 reg = type; u32 reg = type;
......
...@@ -21,14 +21,13 @@ ...@@ -21,14 +21,13 @@
* *
* Authors: Ben Skeggs <bskeggs@redhat.com> * Authors: Ben Skeggs <bskeggs@redhat.com>
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/image.h> #include <subdev/bios/image.h>
#include <subdev/bios/pmu.h> #include <subdev/bios/pmu.h>
static u32 static u32
weirdo_pointer(struct nouveau_bios *bios, u32 data) weirdo_pointer(struct nvkm_bios *bios, u32 data)
{ {
struct nvbios_image image; struct nvbios_image image;
int idx = 0; int idx = 0;
...@@ -43,7 +42,7 @@ weirdo_pointer(struct nouveau_bios *bios, u32 data) ...@@ -43,7 +42,7 @@ weirdo_pointer(struct nouveau_bios *bios, u32 data)
} }
u32 u32
nvbios_pmuTe(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) nvbios_pmuTe(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
struct bit_entry bit_p; struct bit_entry bit_p;
u32 data = 0; u32 data = 0;
...@@ -63,7 +62,7 @@ nvbios_pmuTe(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) ...@@ -63,7 +62,7 @@ nvbios_pmuTe(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
} }
u32 u32
nvbios_pmuTp(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, nvbios_pmuTp(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_pmuT *info) struct nvbios_pmuT *info)
{ {
u32 data = nvbios_pmuTe(bios, ver, hdr, cnt, len); u32 data = nvbios_pmuTe(bios, ver, hdr, cnt, len);
...@@ -76,7 +75,7 @@ nvbios_pmuTp(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, ...@@ -76,7 +75,7 @@ nvbios_pmuTp(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
} }
u32 u32
nvbios_pmuEe(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr) nvbios_pmuEe(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr)
{ {
u8 cnt, len; u8 cnt, len;
u32 data = nvbios_pmuTe(bios, ver, hdr, &cnt, &len); u32 data = nvbios_pmuTe(bios, ver, hdr, &cnt, &len);
...@@ -89,7 +88,7 @@ nvbios_pmuEe(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr) ...@@ -89,7 +88,7 @@ nvbios_pmuEe(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr)
} }
u32 u32
nvbios_pmuEp(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr, nvbios_pmuEp(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr,
struct nvbios_pmuE *info) struct nvbios_pmuE *info)
{ {
u32 data = nvbios_pmuEe(bios, idx, ver, hdr); u32 data = nvbios_pmuEe(bios, idx, ver, hdr);
...@@ -104,7 +103,7 @@ nvbios_pmuEp(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr, ...@@ -104,7 +103,7 @@ nvbios_pmuEp(struct nouveau_bios *bios, int idx, u8 *ver, u8 *hdr,
} }
bool bool
nvbios_pmuRm(struct nouveau_bios *bios, u8 type, struct nvbios_pmuR *info) nvbios_pmuRm(struct nvkm_bios *bios, u8 type, struct nvbios_pmuR *info)
{ {
struct nvbios_pmuE pmuE; struct nvbios_pmuE pmuE;
u8 ver, hdr, idx = 0; u8 ver, hdr, idx = 0;
......
#ifndef __NVKM_BIOS_PRIV_H__ #ifndef __NVKM_BIOS_PRIV_H__
#define __NVKM_BIOS_PRIV_H__ #define __NVKM_BIOS_PRIV_H__
#include <subdev/bios.h> #include <subdev/bios.h>
struct nvbios_source { struct nvbios_source {
const char *name; const char *name;
void *(*init)(struct nouveau_bios *, const char *); void *(*init)(struct nvkm_bios *, const char *);
void (*fini)(void *); void (*fini)(void *);
u32 (*read)(void *, u32 offset, u32 length, struct nouveau_bios *); u32 (*read)(void *, u32 offset, u32 length, struct nvkm_bios *);
bool rw; bool rw;
}; };
int nvbios_extend(struct nouveau_bios *, u32 length); int nvbios_extend(struct nvkm_bios *, u32 length);
int nvbios_shadow(struct nouveau_bios *); int nvbios_shadow(struct nvkm_bios *);
extern const struct nvbios_source nvbios_rom; extern const struct nvbios_source nvbios_rom;
extern const struct nvbios_source nvbios_ramin; extern const struct nvbios_source nvbios_ramin;
...@@ -21,5 +20,4 @@ extern const struct nvbios_source nvbios_acpi_slow; ...@@ -21,5 +20,4 @@ extern const struct nvbios_source nvbios_acpi_slow;
extern const struct nvbios_source nvbios_pcirom; extern const struct nvbios_source nvbios_pcirom;
extern const struct nvbios_source nvbios_platform; extern const struct nvbios_source nvbios_platform;
extern const struct nvbios_source nvbios_of; extern const struct nvbios_source nvbios_of;
#endif #endif
...@@ -21,20 +21,19 @@ ...@@ -21,20 +21,19 @@
* *
* Authors: Ben Skeggs <bskeggs@redhat.com> * Authors: Ben Skeggs <bskeggs@redhat.com>
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/ramcfg.h> #include <subdev/bios/ramcfg.h>
#include <subdev/bios/M0203.h> #include <subdev/bios/M0203.h>
static u8 static u8
nvbios_ramcfg_strap(struct nouveau_subdev *subdev) nvbios_ramcfg_strap(struct nvkm_subdev *subdev)
{ {
return (nv_rd32(subdev, 0x101000) & 0x0000003c) >> 2; return (nv_rd32(subdev, 0x101000) & 0x0000003c) >> 2;
} }
u8 u8
nvbios_ramcfg_count(struct nouveau_bios *bios) nvbios_ramcfg_count(struct nvkm_bios *bios)
{ {
struct bit_entry bit_M; struct bit_entry bit_M;
...@@ -49,9 +48,9 @@ nvbios_ramcfg_count(struct nouveau_bios *bios) ...@@ -49,9 +48,9 @@ nvbios_ramcfg_count(struct nouveau_bios *bios)
} }
u8 u8
nvbios_ramcfg_index(struct nouveau_subdev *subdev) nvbios_ramcfg_index(struct nvkm_subdev *subdev)
{ {
struct nouveau_bios *bios = nouveau_bios(subdev); struct nvkm_bios *bios = nvkm_bios(subdev);
u8 strap = nvbios_ramcfg_strap(subdev); u8 strap = nvbios_ramcfg_strap(subdev);
u32 xlat = 0x00000000; u32 xlat = 0x00000000;
struct bit_entry bit_M; struct bit_entry bit_M;
......
...@@ -21,14 +21,12 @@ ...@@ -21,14 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/ramcfg.h>
#include <subdev/bios/rammap.h> #include <subdev/bios/rammap.h>
u32 u32
nvbios_rammapTe(struct nouveau_bios *bios, u8 *ver, u8 *hdr, nvbios_rammapTe(struct nvkm_bios *bios, u8 *ver, u8 *hdr,
u8 *cnt, u8 *len, u8 *snr, u8 *ssz) u8 *cnt, u8 *len, u8 *snr, u8 *ssz)
{ {
struct bit_entry bit_P; struct bit_entry bit_P;
...@@ -59,7 +57,7 @@ nvbios_rammapTe(struct nouveau_bios *bios, u8 *ver, u8 *hdr, ...@@ -59,7 +57,7 @@ nvbios_rammapTe(struct nouveau_bios *bios, u8 *ver, u8 *hdr,
} }
u32 u32
nvbios_rammapEe(struct nouveau_bios *bios, int idx, nvbios_rammapEe(struct nvkm_bios *bios, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len) u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
u8 snr, ssz; u8 snr, ssz;
...@@ -75,9 +73,8 @@ nvbios_rammapEe(struct nouveau_bios *bios, int idx, ...@@ -75,9 +73,8 @@ nvbios_rammapEe(struct nouveau_bios *bios, int idx,
} }
u32 u32
nvbios_rammapEp(struct nouveau_bios *bios, int idx, nvbios_rammapEp(struct nvkm_bios *bios, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_ramcfg *p)
struct nvbios_ramcfg *p)
{ {
u32 data = nvbios_rammapEe(bios, idx, ver, hdr, cnt, len), temp; u32 data = nvbios_rammapEe(bios, idx, ver, hdr, cnt, len), temp;
memset(p, 0x00, sizeof(*p)); memset(p, 0x00, sizeof(*p));
...@@ -118,9 +115,8 @@ nvbios_rammapEp(struct nouveau_bios *bios, int idx, ...@@ -118,9 +115,8 @@ nvbios_rammapEp(struct nouveau_bios *bios, int idx,
} }
u32 u32
nvbios_rammapEm(struct nouveau_bios *bios, u16 mhz, nvbios_rammapEm(struct nvkm_bios *bios, u16 mhz,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_ramcfg *info)
struct nvbios_ramcfg *info)
{ {
int idx = 0; int idx = 0;
u32 data; u32 data;
...@@ -132,9 +128,8 @@ nvbios_rammapEm(struct nouveau_bios *bios, u16 mhz, ...@@ -132,9 +128,8 @@ nvbios_rammapEm(struct nouveau_bios *bios, u16 mhz,
} }
u32 u32
nvbios_rammapSe(struct nouveau_bios *bios, u32 data, nvbios_rammapSe(struct nvkm_bios *bios, u32 data,
u8 ever, u8 ehdr, u8 ecnt, u8 elen, int idx, u8 ever, u8 ehdr, u8 ecnt, u8 elen, int idx, u8 *ver, u8 *hdr)
u8 *ver, u8 *hdr)
{ {
if (idx < ecnt) { if (idx < ecnt) {
data = data + ehdr + (idx * elen); data = data + ehdr + (idx * elen);
...@@ -146,7 +141,7 @@ nvbios_rammapSe(struct nouveau_bios *bios, u32 data, ...@@ -146,7 +141,7 @@ nvbios_rammapSe(struct nouveau_bios *bios, u32 data,
} }
u32 u32
nvbios_rammapSp(struct nouveau_bios *bios, u32 data, nvbios_rammapSp(struct nvkm_bios *bios, u32 data,
u8 ever, u8 ehdr, u8 ecnt, u8 elen, int idx, u8 ever, u8 ehdr, u8 ecnt, u8 elen, int idx,
u8 *ver, u8 *hdr, struct nvbios_ramcfg *p) u8 *ver, u8 *hdr, struct nvbios_ramcfg *p)
{ {
......
...@@ -21,13 +21,15 @@ ...@@ -21,13 +21,15 @@
* *
* Authors: Ben Skeggs <bskeggs@redhat.com> * Authors: Ben Skeggs <bskeggs@redhat.com>
*/ */
#include "priv.h" #include "priv.h"
#include <core/device.h>
#include <core/option.h> #include <core/option.h>
#include <subdev/bios.h>
#include <subdev/bios/image.h> #include <subdev/bios/image.h>
struct shadow { struct shadow {
struct nouveau_oclass base; struct nvkm_oclass base;
u32 skip; u32 skip;
const struct nvbios_source *func; const struct nvbios_source *func;
void *data; void *data;
...@@ -36,7 +38,7 @@ struct shadow { ...@@ -36,7 +38,7 @@ struct shadow {
}; };
static bool static bool
shadow_fetch(struct nouveau_bios *bios, u32 upto) shadow_fetch(struct nvkm_bios *bios, u32 upto)
{ {
struct shadow *mthd = (void *)nv_object(bios)->oclass; struct shadow *mthd = (void *)nv_object(bios)->oclass;
const u32 limit = (upto + 3) & ~3; const u32 limit = (upto + 3) & ~3;
...@@ -50,36 +52,36 @@ shadow_fetch(struct nouveau_bios *bios, u32 upto) ...@@ -50,36 +52,36 @@ shadow_fetch(struct nouveau_bios *bios, u32 upto)
} }
static u8 static u8
shadow_rd08(struct nouveau_object *object, u64 addr) shadow_rd08(struct nvkm_object *object, u64 addr)
{ {
struct nouveau_bios *bios = (void *)object; struct nvkm_bios *bios = (void *)object;
if (shadow_fetch(bios, addr + 1)) if (shadow_fetch(bios, addr + 1))
return bios->data[addr]; return bios->data[addr];
return 0x00; return 0x00;
} }
static u16 static u16
shadow_rd16(struct nouveau_object *object, u64 addr) shadow_rd16(struct nvkm_object *object, u64 addr)
{ {
struct nouveau_bios *bios = (void *)object; struct nvkm_bios *bios = (void *)object;
if (shadow_fetch(bios, addr + 2)) if (shadow_fetch(bios, addr + 2))
return get_unaligned_le16(&bios->data[addr]); return get_unaligned_le16(&bios->data[addr]);
return 0x0000; return 0x0000;
} }
static u32 static u32
shadow_rd32(struct nouveau_object *object, u64 addr) shadow_rd32(struct nvkm_object *object, u64 addr)
{ {
struct nouveau_bios *bios = (void *)object; struct nvkm_bios *bios = (void *)object;
if (shadow_fetch(bios, addr + 4)) if (shadow_fetch(bios, addr + 4))
return get_unaligned_le32(&bios->data[addr]); return get_unaligned_le32(&bios->data[addr]);
return 0x00000000; return 0x00000000;
} }
static struct nouveau_oclass static struct nvkm_oclass
shadow_class = { shadow_class = {
.handle = NV_SUBDEV(VBIOS, 0x00), .handle = NV_SUBDEV(VBIOS, 0x00),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.rd08 = shadow_rd08, .rd08 = shadow_rd08,
.rd16 = shadow_rd16, .rd16 = shadow_rd16,
.rd32 = shadow_rd32, .rd32 = shadow_rd32,
...@@ -87,7 +89,7 @@ shadow_class = { ...@@ -87,7 +89,7 @@ shadow_class = {
}; };
static int static int
shadow_image(struct nouveau_bios *bios, int idx, struct shadow *mthd) shadow_image(struct nvkm_bios *bios, int idx, struct shadow *mthd)
{ {
struct nvbios_image image; struct nvbios_image image;
int score = 1; int score = 1;
...@@ -126,9 +128,9 @@ shadow_image(struct nouveau_bios *bios, int idx, struct shadow *mthd) ...@@ -126,9 +128,9 @@ shadow_image(struct nouveau_bios *bios, int idx, struct shadow *mthd)
} }
static int static int
shadow_score(struct nouveau_bios *bios, struct shadow *mthd) shadow_score(struct nvkm_bios *bios, struct shadow *mthd)
{ {
struct nouveau_oclass *oclass = nv_object(bios)->oclass; struct nvkm_oclass *oclass = nv_object(bios)->oclass;
int score; int score;
nv_object(bios)->oclass = &mthd->base; nv_object(bios)->oclass = &mthd->base;
score = shadow_image(bios, 0, mthd); score = shadow_image(bios, 0, mthd);
...@@ -138,7 +140,7 @@ shadow_score(struct nouveau_bios *bios, struct shadow *mthd) ...@@ -138,7 +140,7 @@ shadow_score(struct nouveau_bios *bios, struct shadow *mthd)
} }
static int static int
shadow_method(struct nouveau_bios *bios, struct shadow *mthd, const char *name) shadow_method(struct nvkm_bios *bios, struct shadow *mthd, const char *name)
{ {
const struct nvbios_source *func = mthd->func; const struct nvbios_source *func = mthd->func;
if (func->name) { if (func->name) {
...@@ -163,7 +165,7 @@ shadow_method(struct nouveau_bios *bios, struct shadow *mthd, const char *name) ...@@ -163,7 +165,7 @@ shadow_method(struct nouveau_bios *bios, struct shadow *mthd, const char *name)
} }
static u32 static u32
shadow_fw_read(void *data, u32 offset, u32 length, struct nouveau_bios *bios) shadow_fw_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
{ {
const struct firmware *fw = data; const struct firmware *fw = data;
if (offset + length <= fw->size) { if (offset + length <= fw->size) {
...@@ -174,7 +176,7 @@ shadow_fw_read(void *data, u32 offset, u32 length, struct nouveau_bios *bios) ...@@ -174,7 +176,7 @@ shadow_fw_read(void *data, u32 offset, u32 length, struct nouveau_bios *bios)
} }
static void * static void *
shadow_fw_init(struct nouveau_bios *bios, const char *name) shadow_fw_init(struct nvkm_bios *bios, const char *name)
{ {
struct device *dev = &nv_device(bios)->pdev->dev; struct device *dev = &nv_device(bios)->pdev->dev;
const struct firmware *fw; const struct firmware *fw;
...@@ -194,7 +196,7 @@ shadow_fw = { ...@@ -194,7 +196,7 @@ shadow_fw = {
}; };
int int
nvbios_shadow(struct nouveau_bios *bios) nvbios_shadow(struct nvkm_bios *bios)
{ {
struct shadow mthds[] = { struct shadow mthds[] = {
{ shadow_class, 0, &nvbios_of }, { shadow_class, 0, &nvbios_of },
...@@ -211,7 +213,7 @@ nvbios_shadow(struct nouveau_bios *bios) ...@@ -211,7 +213,7 @@ nvbios_shadow(struct nouveau_bios *bios)
int optlen; int optlen;
/* handle user-specified bios source */ /* handle user-specified bios source */
optarg = nouveau_stropt(nv_device(bios)->cfgopt, "NvBios", &optlen); optarg = nvkm_stropt(nv_device(bios)->cfgopt, "NvBios", &optlen);
source = optarg ? kstrndup(optarg, optlen, GFP_KERNEL) : NULL; source = optarg ? kstrndup(optarg, optlen, GFP_KERNEL) : NULL;
if (source) { if (source) {
/* try to match one of the built-in methods */ /* try to match one of the built-in methods */
......
...@@ -20,9 +20,10 @@ ...@@ -20,9 +20,10 @@
* OTHER DEALINGS IN THE SOFTWARE. * OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "priv.h" #include "priv.h"
#include <core/device.h>
#if defined(CONFIG_ACPI) && defined(CONFIG_X86) #if defined(CONFIG_ACPI) && defined(CONFIG_X86)
int nouveau_acpi_get_bios_chunk(uint8_t *bios, int offset, int len); int nouveau_acpi_get_bios_chunk(uint8_t *bios, int offset, int len);
bool nouveau_acpi_rom_supported(struct pci_dev *pdev); bool nouveau_acpi_rom_supported(struct pci_dev *pdev);
...@@ -45,7 +46,7 @@ nouveau_acpi_get_bios_chunk(uint8_t *bios, int offset, int len) ...@@ -45,7 +46,7 @@ nouveau_acpi_get_bios_chunk(uint8_t *bios, int offset, int len)
* on some systems, such as Lenovo W530. * on some systems, such as Lenovo W530.
*/ */
static u32 static u32
acpi_read_fast(void *data, u32 offset, u32 length, struct nouveau_bios *bios) acpi_read_fast(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
{ {
u32 limit = (offset + length + 0xfff) & ~0xfff; u32 limit = (offset + length + 0xfff) & ~0xfff;
u32 start = offset & ~0x00000fff; u32 start = offset & ~0x00000fff;
...@@ -66,7 +67,7 @@ acpi_read_fast(void *data, u32 offset, u32 length, struct nouveau_bios *bios) ...@@ -66,7 +67,7 @@ acpi_read_fast(void *data, u32 offset, u32 length, struct nouveau_bios *bios)
* function. * function.
*/ */
static u32 static u32
acpi_read_slow(void *data, u32 offset, u32 length, struct nouveau_bios *bios) acpi_read_slow(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
{ {
u32 limit = (offset + length + 0xfff) & ~0xfff; u32 limit = (offset + length + 0xfff) & ~0xfff;
u32 start = offset & ~0xfff; u32 start = offset & ~0xfff;
...@@ -87,7 +88,7 @@ acpi_read_slow(void *data, u32 offset, u32 length, struct nouveau_bios *bios) ...@@ -87,7 +88,7 @@ acpi_read_slow(void *data, u32 offset, u32 length, struct nouveau_bios *bios)
} }
static void * static void *
acpi_init(struct nouveau_bios *bios, const char *name) acpi_init(struct nvkm_bios *bios, const char *name)
{ {
if (!nouveau_acpi_rom_supported(nv_device(bios)->pdev)) if (!nouveau_acpi_rom_supported(nv_device(bios)->pdev))
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
......
...@@ -20,9 +20,10 @@ ...@@ -20,9 +20,10 @@
* OTHER DEALINGS IN THE SOFTWARE. * OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "priv.h" #include "priv.h"
#include <core/device.h>
#if defined(__powerpc__) #if defined(__powerpc__)
struct priv { struct priv {
const void __iomem *data; const void __iomem *data;
...@@ -30,7 +31,7 @@ struct priv { ...@@ -30,7 +31,7 @@ struct priv {
}; };
static u32 static u32
of_read(void *data, u32 offset, u32 length, struct nouveau_bios *bios) of_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
{ {
struct priv *priv = data; struct priv *priv = data;
if (offset + length <= priv->size) { if (offset + length <= priv->size) {
...@@ -41,7 +42,7 @@ of_read(void *data, u32 offset, u32 length, struct nouveau_bios *bios) ...@@ -41,7 +42,7 @@ of_read(void *data, u32 offset, u32 length, struct nouveau_bios *bios)
} }
static void * static void *
of_init(struct nouveau_bios *bios, const char *name) of_init(struct nvkm_bios *bios, const char *name)
{ {
struct pci_dev *pdev = nv_device(bios)->pdev; struct pci_dev *pdev = nv_device(bios)->pdev;
struct device_node *dn; struct device_node *dn;
......
...@@ -20,9 +20,10 @@ ...@@ -20,9 +20,10 @@
* OTHER DEALINGS IN THE SOFTWARE. * OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "priv.h" #include "priv.h"
#include <core/device.h>
struct priv { struct priv {
struct pci_dev *pdev; struct pci_dev *pdev;
void __iomem *rom; void __iomem *rom;
...@@ -30,7 +31,7 @@ struct priv { ...@@ -30,7 +31,7 @@ struct priv {
}; };
static u32 static u32
pcirom_read(void *data, u32 offset, u32 length, struct nouveau_bios *bios) pcirom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
{ {
struct priv *priv = data; struct priv *priv = data;
if (offset + length <= priv->size) { if (offset + length <= priv->size) {
...@@ -50,7 +51,7 @@ pcirom_fini(void *data) ...@@ -50,7 +51,7 @@ pcirom_fini(void *data)
} }
static void * static void *
pcirom_init(struct nouveau_bios *bios, const char *name) pcirom_init(struct nvkm_bios *bios, const char *name)
{ {
struct pci_dev *pdev = nv_device(bios)->pdev; struct pci_dev *pdev = nv_device(bios)->pdev;
struct priv *priv = NULL; struct priv *priv = NULL;
...@@ -82,7 +83,7 @@ nvbios_pcirom = { ...@@ -82,7 +83,7 @@ nvbios_pcirom = {
}; };
static void * static void *
platform_init(struct nouveau_bios *bios, const char *name) platform_init(struct nvkm_bios *bios, const char *name)
{ {
struct pci_dev *pdev = nv_device(bios)->pdev; struct pci_dev *pdev = nv_device(bios)->pdev;
struct priv *priv; struct priv *priv;
......
...@@ -20,16 +20,17 @@ ...@@ -20,16 +20,17 @@
* OTHER DEALINGS IN THE SOFTWARE. * OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "priv.h" #include "priv.h"
#include <core/device.h>
struct priv { struct priv {
struct nouveau_bios *bios; struct nvkm_bios *bios;
u32 bar0; u32 bar0;
}; };
static u32 static u32
pramin_read(void *data, u32 offset, u32 length, struct nouveau_bios *bios) pramin_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
{ {
u32 i; u32 i;
if (offset + length <= 0x00100000) { if (offset + length <= 0x00100000) {
...@@ -51,7 +52,7 @@ pramin_fini(void *data) ...@@ -51,7 +52,7 @@ pramin_fini(void *data)
} }
static void * static void *
pramin_init(struct nouveau_bios *bios, const char *name) pramin_init(struct nvkm_bios *bios, const char *name)
{ {
struct priv *priv = NULL; struct priv *priv = NULL;
u64 addr = 0; u64 addr = 0;
......
...@@ -20,11 +20,12 @@ ...@@ -20,11 +20,12 @@
* OTHER DEALINGS IN THE SOFTWARE. * OTHER DEALINGS IN THE SOFTWARE.
* *
*/ */
#include "priv.h" #include "priv.h"
#include <core/device.h>
static u32 static u32
prom_read(void *data, u32 offset, u32 length, struct nouveau_bios *bios) prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios)
{ {
u32 i; u32 i;
if (offset + length <= 0x00100000) { if (offset + length <= 0x00100000) {
...@@ -38,7 +39,7 @@ prom_read(void *data, u32 offset, u32 length, struct nouveau_bios *bios) ...@@ -38,7 +39,7 @@ prom_read(void *data, u32 offset, u32 length, struct nouveau_bios *bios)
static void static void
prom_fini(void *data) prom_fini(void *data)
{ {
struct nouveau_bios *bios = data; struct nvkm_bios *bios = data;
if (nv_device(bios)->card_type < NV_50) if (nv_device(bios)->card_type < NV_50)
nv_mask(bios, 0x001850, 0x00000001, 0x00000001); nv_mask(bios, 0x001850, 0x00000001, 0x00000001);
else else
...@@ -46,7 +47,7 @@ prom_fini(void *data) ...@@ -46,7 +47,7 @@ prom_fini(void *data)
} }
static void * static void *
prom_init(struct nouveau_bios *bios, const char *name) prom_init(struct nvkm_bios *bios, const char *name)
{ {
if (nv_device(bios)->card_type < NV_50) { if (nv_device(bios)->card_type < NV_50) {
if (nv_device(bios)->card_type == NV_40 && if (nv_device(bios)->card_type == NV_40 &&
......
...@@ -21,13 +21,14 @@ ...@@ -21,13 +21,14 @@
* *
* Authors: Martin Peres * Authors: Martin Peres
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/therm.h> #include <subdev/bios/therm.h>
#include <core/device.h>
static u16 static u16
therm_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *len, u8 *cnt) therm_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *len, u8 *cnt)
{ {
struct bit_entry bit_P; struct bit_entry bit_P;
u16 therm = 0; u16 therm = 0;
...@@ -51,12 +52,11 @@ therm_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *len, u8 *cnt) ...@@ -51,12 +52,11 @@ therm_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *len, u8 *cnt)
*hdr = nv_ro08(bios, therm + 1); *hdr = nv_ro08(bios, therm + 1);
*len = nv_ro08(bios, therm + 2); *len = nv_ro08(bios, therm + 2);
*cnt = nv_ro08(bios, therm + 3); *cnt = nv_ro08(bios, therm + 3);
return therm + nv_ro08(bios, therm + 1); return therm + nv_ro08(bios, therm + 1);
} }
static u16 static u16
nvbios_therm_entry(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len) nvbios_therm_entry(struct nvkm_bios *bios, int idx, u8 *ver, u8 *len)
{ {
u8 hdr, cnt; u8 hdr, cnt;
u16 therm = therm_table(bios, ver, &hdr, len, &cnt); u16 therm = therm_table(bios, ver, &hdr, len, &cnt);
...@@ -66,7 +66,7 @@ nvbios_therm_entry(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len) ...@@ -66,7 +66,7 @@ nvbios_therm_entry(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len)
} }
int int
nvbios_therm_sensor_parse(struct nouveau_bios *bios, nvbios_therm_sensor_parse(struct nvkm_bios *bios,
enum nvbios_therm_domain domain, enum nvbios_therm_domain domain,
struct nvbios_therm_sensor *sensor) struct nvbios_therm_sensor *sensor)
{ {
...@@ -152,10 +152,9 @@ nvbios_therm_sensor_parse(struct nouveau_bios *bios, ...@@ -152,10 +152,9 @@ nvbios_therm_sensor_parse(struct nouveau_bios *bios,
} }
int int
nvbios_therm_fan_parse(struct nouveau_bios *bios, nvbios_therm_fan_parse(struct nvkm_bios *bios, struct nvbios_therm_fan *fan)
struct nvbios_therm_fan *fan)
{ {
struct nouveau_therm_trip_point *cur_trip = NULL; struct nvbios_therm_trip_point *cur_trip = NULL;
u8 ver, len, i; u8 ver, len, i;
u16 entry; u16 entry;
......
...@@ -21,14 +21,12 @@ ...@@ -21,14 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/ramcfg.h>
#include <subdev/bios/timing.h> #include <subdev/bios/timing.h>
u16 u16
nvbios_timingTe(struct nouveau_bios *bios, nvbios_timingTe(struct nvkm_bios *bios,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz) u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *snr, u8 *ssz)
{ {
struct bit_entry bit_P; struct bit_entry bit_P;
...@@ -68,7 +66,7 @@ nvbios_timingTe(struct nouveau_bios *bios, ...@@ -68,7 +66,7 @@ nvbios_timingTe(struct nouveau_bios *bios,
} }
u16 u16
nvbios_timingEe(struct nouveau_bios *bios, int idx, nvbios_timingEe(struct nvkm_bios *bios, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len) u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
u8 snr, ssz; u8 snr, ssz;
...@@ -84,9 +82,8 @@ nvbios_timingEe(struct nouveau_bios *bios, int idx, ...@@ -84,9 +82,8 @@ nvbios_timingEe(struct nouveau_bios *bios, int idx,
} }
u16 u16
nvbios_timingEp(struct nouveau_bios *bios, int idx, nvbios_timingEp(struct nvkm_bios *bios, int idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_ramcfg *p)
struct nvbios_ramcfg *p)
{ {
u16 data = nvbios_timingEe(bios, idx, ver, hdr, cnt, len), temp; u16 data = nvbios_timingEe(bios, idx, ver, hdr, cnt, len), temp;
p->timing_ver = *ver; p->timing_ver = *ver;
......
...@@ -21,13 +21,12 @@ ...@@ -21,13 +21,12 @@
* *
* Authors: Martin Peres * Authors: Martin Peres
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/vmap.h> #include <subdev/bios/vmap.h>
u16 u16
nvbios_vmap_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) nvbios_vmap_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
struct bit_entry bit_P; struct bit_entry bit_P;
u16 vmap = 0x0000; u16 vmap = 0x0000;
...@@ -55,7 +54,7 @@ nvbios_vmap_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) ...@@ -55,7 +54,7 @@ nvbios_vmap_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
} }
u16 u16
nvbios_vmap_parse(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, nvbios_vmap_parse(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_vmap *info) struct nvbios_vmap *info)
{ {
u16 vmap = nvbios_vmap_table(bios, ver, hdr, cnt, len); u16 vmap = nvbios_vmap_table(bios, ver, hdr, cnt, len);
...@@ -69,7 +68,7 @@ nvbios_vmap_parse(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, ...@@ -69,7 +68,7 @@ nvbios_vmap_parse(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
} }
u16 u16
nvbios_vmap_entry(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len) nvbios_vmap_entry(struct nvkm_bios *bios, int idx, u8 *ver, u8 *len)
{ {
u8 hdr, cnt; u8 hdr, cnt;
u16 vmap = nvbios_vmap_table(bios, ver, &hdr, &cnt, len); u16 vmap = nvbios_vmap_table(bios, ver, &hdr, &cnt, len);
...@@ -81,7 +80,7 @@ nvbios_vmap_entry(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len) ...@@ -81,7 +80,7 @@ nvbios_vmap_entry(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len)
} }
u16 u16
nvbios_vmap_entry_parse(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len, nvbios_vmap_entry_parse(struct nvkm_bios *bios, int idx, u8 *ver, u8 *len,
struct nvbios_vmap_entry *info) struct nvbios_vmap_entry *info)
{ {
u16 vmap = nvbios_vmap_entry(bios, idx, ver, len); u16 vmap = nvbios_vmap_entry(bios, idx, ver, len);
......
...@@ -21,13 +21,12 @@ ...@@ -21,13 +21,12 @@
* *
* Authors: Martin Peres * Authors: Martin Peres
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/bit.h> #include <subdev/bios/bit.h>
#include <subdev/bios/volt.h> #include <subdev/bios/volt.h>
u16 u16
nvbios_volt_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) nvbios_volt_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
struct bit_entry bit_P; struct bit_entry bit_P;
u16 volt = 0x0000; u16 volt = 0x0000;
...@@ -67,7 +66,7 @@ nvbios_volt_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) ...@@ -67,7 +66,7 @@ nvbios_volt_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
} }
u16 u16
nvbios_volt_parse(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, nvbios_volt_parse(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
struct nvbios_volt *info) struct nvbios_volt *info)
{ {
u16 volt = nvbios_volt_table(bios, ver, hdr, cnt, len); u16 volt = nvbios_volt_table(bios, ver, hdr, cnt, len);
...@@ -102,7 +101,7 @@ nvbios_volt_parse(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, ...@@ -102,7 +101,7 @@ nvbios_volt_parse(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
} }
u16 u16
nvbios_volt_entry(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len) nvbios_volt_entry(struct nvkm_bios *bios, int idx, u8 *ver, u8 *len)
{ {
u8 hdr, cnt; u8 hdr, cnt;
u16 volt = nvbios_volt_table(bios, ver, &hdr, &cnt, len); u16 volt = nvbios_volt_table(bios, ver, &hdr, &cnt, len);
...@@ -114,7 +113,7 @@ nvbios_volt_entry(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len) ...@@ -114,7 +113,7 @@ nvbios_volt_entry(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len)
} }
u16 u16
nvbios_volt_entry_parse(struct nouveau_bios *bios, int idx, u8 *ver, u8 *len, nvbios_volt_entry_parse(struct nvkm_bios *bios, int idx, u8 *ver, u8 *len,
struct nvbios_volt_entry *info) struct nvbios_volt_entry *info)
{ {
u16 volt = nvbios_volt_entry(bios, idx, ver, len); u16 volt = nvbios_volt_entry(bios, idx, ver, len);
......
...@@ -21,13 +21,12 @@ ...@@ -21,13 +21,12 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/gpio.h> #include <subdev/bios/gpio.h>
#include <subdev/bios/xpio.h> #include <subdev/bios/xpio.h>
static u16 static u16
dcb_xpiod_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) dcb_xpiod_table(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
u16 data = dcb_gpio_table(bios, ver, hdr, cnt, len); u16 data = dcb_gpio_table(bios, ver, hdr, cnt, len);
if (data && *ver >= 0x40 && *hdr >= 0x06) { if (data && *ver >= 0x40 && *hdr >= 0x06) {
...@@ -44,7 +43,7 @@ dcb_xpiod_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len) ...@@ -44,7 +43,7 @@ dcb_xpiod_table(struct nouveau_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
} }
u16 u16
dcb_xpio_table(struct nouveau_bios *bios, u8 idx, dcb_xpio_table(struct nvkm_bios *bios, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len) u8 *ver, u8 *hdr, u8 *cnt, u8 *len)
{ {
u16 data = dcb_xpiod_table(bios, ver, hdr, cnt, len); u16 data = dcb_xpiod_table(bios, ver, hdr, cnt, len);
...@@ -62,9 +61,8 @@ dcb_xpio_table(struct nouveau_bios *bios, u8 idx, ...@@ -62,9 +61,8 @@ dcb_xpio_table(struct nouveau_bios *bios, u8 idx,
} }
u16 u16
dcb_xpio_parse(struct nouveau_bios *bios, u8 idx, dcb_xpio_parse(struct nvkm_bios *bios, u8 idx,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_xpio *info)
struct nvbios_xpio *info)
{ {
u16 data = dcb_xpio_table(bios, idx, ver, hdr, cnt, len); u16 data = dcb_xpio_table(bios, idx, ver, hdr, cnt, len);
if (data && *len >= 6) { if (data && *len >= 6) {
......
...@@ -33,9 +33,9 @@ static int ...@@ -33,9 +33,9 @@ static int
nouveau_therm_update_trip(struct nouveau_therm *therm) nouveau_therm_update_trip(struct nouveau_therm *therm)
{ {
struct nouveau_therm_priv *priv = (void *)therm; struct nouveau_therm_priv *priv = (void *)therm;
struct nouveau_therm_trip_point *trip = priv->fan->bios.trip, struct nvbios_therm_trip_point *trip = priv->fan->bios.trip,
*cur_trip = NULL, *cur_trip = NULL,
*last_trip = priv->last_trip; *last_trip = priv->last_trip;
u8 temp = therm->temp_get(therm); u8 temp = therm->temp_get(therm);
u16 duty, i; u16 duty, i;
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <subdev/therm.h> #include <subdev/therm.h>
#include <subdev/bios.h>
#include <subdev/bios/extdev.h> #include <subdev/bios/extdev.h>
#include <subdev/bios/gpio.h> #include <subdev/bios/gpio.h>
#include <subdev/bios/perf.h> #include <subdev/bios/perf.h>
...@@ -74,7 +75,7 @@ struct nouveau_therm_priv { ...@@ -74,7 +75,7 @@ struct nouveau_therm_priv {
/* automatic thermal management */ /* automatic thermal management */
struct nouveau_alarm alarm; struct nouveau_alarm alarm;
spinlock_t lock; spinlock_t lock;
struct nouveau_therm_trip_point *last_trip; struct nvbios_therm_trip_point *last_trip;
int mode; int mode;
int cstate; int cstate;
int suspend; int suspend;
......
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