static u8
init_conn(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
struct nvbios_connE connE;
u8 ver, hdr;
u32 conn;
static inline u32
init_nvreg(struct nvbios_init *init, u32 reg)
{
- struct nvkm_devinit *devinit = init->bios->subdev.device->devinit;
+ struct nvkm_devinit *devinit = init->subdev->device->devinit;
/* C51 (at least) sometimes has the lower bits set which the VBIOS
* interprets to mean that access needs to go through certain IO
/* GF8+ display scripts need register addresses mangled a bit to
* select a specific CRTC/OR
*/
- if (init->bios->subdev.device->card_type >= NV_50) {
+ if (init->subdev->device->card_type >= NV_50) {
if (reg & 0x80000000) {
reg += init_crtc(init) * 0x800;
reg &= ~0x80000000;
static u32
init_rd32(struct nvbios_init *init, u32 reg)
{
- struct nvkm_device *device = init->bios->subdev.device;
+ struct nvkm_device *device = init->subdev->device;
reg = init_nvreg(init, reg);
if (reg != ~0 && init_exec(init))
return nvkm_rd32(device, reg);
static void
init_wr32(struct nvbios_init *init, u32 reg, u32 val)
{
- struct nvkm_device *device = init->bios->subdev.device;
+ struct nvkm_device *device = init->subdev->device;
reg = init_nvreg(init, reg);
if (reg != ~0 && init_exec(init))
nvkm_wr32(device, reg, val);
static u32
init_mask(struct nvbios_init *init, u32 reg, u32 mask, u32 val)
{
- struct nvkm_device *device = init->bios->subdev.device;
+ struct nvkm_device *device = init->subdev->device;
reg = init_nvreg(init, reg);
if (reg != ~0 && init_exec(init)) {
u32 tmp = nvkm_rd32(device, reg);
static struct i2c_adapter *
init_i2c(struct nvbios_init *init, int index)
{
- struct nvkm_i2c *i2c = init->bios->subdev.device->i2c;
+ struct nvkm_i2c *i2c = init->subdev->device->i2c;
struct nvkm_i2c_bus *bus;
if (index == 0xff) {
static struct nvkm_i2c_aux *
init_aux(struct nvbios_init *init)
{
- struct nvkm_i2c *i2c = init->bios->subdev.device->i2c;
+ struct nvkm_i2c *i2c = init->subdev->device->i2c;
if (!init->outp) {
if (init_exec(init))
error("script needs output for aux\n");
static void
init_prog_pll(struct nvbios_init *init, u32 id, u32 freq)
{
- struct nvkm_devinit *devinit = init->bios->subdev.device->devinit;
+ struct nvkm_devinit *devinit = init->subdev->device->devinit;
if (init_exec(init)) {
int ret = nvkm_devinit_pll_set(devinit, id, freq);
if (ret)
static u16
init_table_(struct nvbios_init *init, u16 offset, const char *name)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 len, data = init_table(bios, &len);
if (data) {
if (len >= offset + 2) {
static u16
init_script(struct nvkm_bios *bios, int index)
{
- struct nvbios_init init = { .bios = bios };
+ struct nvbios_init init = { .subdev = &bios->subdev };
u16 bmp_ver = bmp_version(bios), data;
if (bmp_ver && bmp_ver < 0x0510) {
static u8
init_ram_restrict_group_count(struct nvbios_init *init)
{
- return nvbios_ramcfg_count(init->bios);
+ return nvbios_ramcfg_count(init->subdev->device->bios);
}
static u8
* Preserving the non-caching behaviour on earlier chipsets just
* in case *not* re-reading the strap causes similar breakage.
*/
- if (!init->ramcfg || init->bios->version.major < 0x70)
+ if (!init->ramcfg || init->subdev->device->bios->version.major < 0x70)
init->ramcfg = 0x80000000 | nvbios_ramcfg_index(init->subdev);
return (init->ramcfg & 0x7fffffff);
}
static u8
init_xlat_(struct nvbios_init *init, u8 index, u8 offset)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 table = init_xlat_table(init);
if (table) {
u16 data = nvbios_rd16(bios, table + (index * 2));
static bool
init_condition_met(struct nvbios_init *init, u8 cond)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 table = init_condition_table(init);
if (table) {
u32 reg = nvbios_rd32(bios, table + (cond * 12) + 0);
static bool
init_io_condition_met(struct nvbios_init *init, u8 cond)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 table = init_io_condition_table(init);
if (table) {
u16 port = nvbios_rd16(bios, table + (cond * 5) + 0);
static bool
init_io_flag_condition_met(struct nvbios_init *init, u8 cond)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 table = init_io_flag_condition_table(init);
if (table) {
u16 port = nvbios_rd16(bios, table + (cond * 9) + 0);
static void
init_reserved(struct nvbios_init *init)
{
- u8 opcode = nvbios_rd08(init->bios, init->offset);
+ struct nvkm_bios *bios = init->subdev->device->bios;
+ u8 opcode = nvbios_rd08(bios, init->offset);
u8 length, i;
switch (opcode) {
trace("RESERVED 0x%02x\t", opcode);
for (i = 1; i < length; i++)
- cont(" 0x%02x", nvbios_rd08(init->bios, init->offset + i));
+ cont(" 0x%02x", nvbios_rd08(bios, init->offset + i));
cont("\n");
init->offset += length;
}
static void
init_io_restrict_prog(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 port = nvbios_rd16(bios, init->offset + 1);
u8 index = nvbios_rd08(bios, init->offset + 3);
u8 mask = nvbios_rd08(bios, init->offset + 4);
static void
init_repeat(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 count = nvbios_rd08(bios, init->offset + 1);
u16 repeat = init->repeat;
static void
init_io_restrict_pll(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 port = nvbios_rd16(bios, init->offset + 1);
u8 index = nvbios_rd08(bios, init->offset + 3);
u8 mask = nvbios_rd08(bios, init->offset + 4);
static void
init_copy(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 reg = nvbios_rd32(bios, init->offset + 1);
u8 shift = nvbios_rd08(bios, init->offset + 5);
u8 smask = nvbios_rd08(bios, init->offset + 6);
static void
init_io_flag_condition(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 cond = nvbios_rd08(bios, init->offset + 1);
trace("IO_FLAG_CONDITION\t0x%02x\n", cond);
static void
init_generic_condition(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
struct nvbios_dpout info;
u8 cond = nvbios_rd08(bios, init->offset + 1);
u8 size = nvbios_rd08(bios, init->offset + 2);
static void
init_io_mask_or(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 index = nvbios_rd08(bios, init->offset + 1);
u8 or = init_or(init);
u8 data;
static void
init_io_or(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 index = nvbios_rd08(bios, init->offset + 1);
u8 or = init_or(init);
u8 data;
static void
init_andn_reg(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 reg = nvbios_rd32(bios, init->offset + 1);
u32 mask = nvbios_rd32(bios, init->offset + 5);
static void
init_or_reg(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 reg = nvbios_rd32(bios, init->offset + 1);
u32 mask = nvbios_rd32(bios, init->offset + 5);
static void
init_idx_addr_latched(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 creg = nvbios_rd32(bios, init->offset + 1);
u32 dreg = nvbios_rd32(bios, init->offset + 5);
u32 mask = nvbios_rd32(bios, init->offset + 9);
static void
init_io_restrict_pll2(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 port = nvbios_rd16(bios, init->offset + 1);
u8 index = nvbios_rd08(bios, init->offset + 3);
u8 mask = nvbios_rd08(bios, init->offset + 4);
static void
init_pll2(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 reg = nvbios_rd32(bios, init->offset + 1);
u32 freq = nvbios_rd32(bios, init->offset + 5);
static void
init_i2c_byte(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 index = nvbios_rd08(bios, init->offset + 1);
u8 addr = nvbios_rd08(bios, init->offset + 2) >> 1;
u8 count = nvbios_rd08(bios, init->offset + 3);
static void
init_zm_i2c_byte(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 index = nvbios_rd08(bios, init->offset + 1);
u8 addr = nvbios_rd08(bios, init->offset + 2) >> 1;
u8 count = nvbios_rd08(bios, init->offset + 3);
static void
init_zm_i2c(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 index = nvbios_rd08(bios, init->offset + 1);
u8 addr = nvbios_rd08(bios, init->offset + 2) >> 1;
u8 count = nvbios_rd08(bios, init->offset + 3);
static void
init_tmds(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 tmds = nvbios_rd08(bios, init->offset + 1);
u8 addr = nvbios_rd08(bios, init->offset + 2);
u8 mask = nvbios_rd08(bios, init->offset + 3);
static void
init_zm_tmds_group(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 tmds = nvbios_rd08(bios, init->offset + 1);
u8 count = nvbios_rd08(bios, init->offset + 2);
u32 reg = init_tmds_reg(init, tmds);
static void
init_cr_idx_adr_latch(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 addr0 = nvbios_rd08(bios, init->offset + 1);
u8 addr1 = nvbios_rd08(bios, init->offset + 2);
u8 base = nvbios_rd08(bios, init->offset + 3);
static void
init_cr(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 addr = nvbios_rd08(bios, init->offset + 1);
u8 mask = nvbios_rd08(bios, init->offset + 2);
u8 data = nvbios_rd08(bios, init->offset + 3);
static void
init_zm_cr(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 addr = nvbios_rd08(bios, init->offset + 1);
u8 data = nvbios_rd08(bios, init->offset + 2);
static void
init_zm_cr_group(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 count = nvbios_rd08(bios, init->offset + 1);
trace("ZM_CR_GROUP\n");
static void
init_condition_time(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 cond = nvbios_rd08(bios, init->offset + 1);
u8 retry = nvbios_rd08(bios, init->offset + 2);
u8 wait = min((u16)retry * 50, 100);
static void
init_ltime(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 msec = nvbios_rd16(bios, init->offset + 1);
trace("LTIME\t0x%04x\n", msec);
static void
init_zm_reg_sequence(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 base = nvbios_rd32(bios, init->offset + 1);
u8 count = nvbios_rd08(bios, init->offset + 5);
static void
init_pll_indirect(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 reg = nvbios_rd32(bios, init->offset + 1);
u16 addr = nvbios_rd16(bios, init->offset + 5);
u32 freq = (u32)nvbios_rd16(bios, addr) * 1000;
static void
init_zm_reg_indirect(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 reg = nvbios_rd32(bios, init->offset + 1);
u16 addr = nvbios_rd16(bios, init->offset + 5);
u32 data = nvbios_rd32(bios, addr);
static void
init_sub_direct(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 addr = nvbios_rd16(bios, init->offset + 1);
u16 save;
static void
init_jump(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 offset = nvbios_rd16(bios, init->offset + 1);
trace("JUMP\t0x%04x\n", offset);
static void
init_i2c_if(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 index = nvbios_rd08(bios, init->offset + 1);
u8 addr = nvbios_rd08(bios, init->offset + 2);
u8 reg = nvbios_rd08(bios, init->offset + 3);
static void
init_copy_nv_reg(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 sreg = nvbios_rd32(bios, init->offset + 1);
u8 shift = nvbios_rd08(bios, init->offset + 5);
u32 smask = nvbios_rd32(bios, init->offset + 6);
static void
init_zm_index_io(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 port = nvbios_rd16(bios, init->offset + 1);
u8 index = nvbios_rd08(bios, init->offset + 3);
u8 data = nvbios_rd08(bios, init->offset + 4);
static void
init_compute_mem(struct nvbios_init *init)
{
- struct nvkm_devinit *devinit = init->bios->subdev.device->devinit;
+ struct nvkm_devinit *devinit = init->subdev->device->devinit;
trace("COMPUTE_MEM\n");
init->offset += 1;
static void
init_reset(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 reg = nvbios_rd32(bios, init->offset + 1);
u32 data1 = nvbios_rd32(bios, init->offset + 5);
u32 data2 = nvbios_rd32(bios, init->offset + 9);
static u16
init_configure_mem_clk(struct nvbios_init *init)
{
- u16 mdata = bmp_mem_init_table(init->bios);
+ u16 mdata = bmp_mem_init_table(init->subdev->device->bios);
if (mdata)
mdata += (init_rdvgai(init, 0x03d4, 0x3c) >> 4) * 66;
return mdata;
static void
init_configure_mem(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 mdata, sdata;
u32 addr, data;
static void
init_configure_clk(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 mdata, clock;
trace("CONFIGURE_CLK\n");
static void
init_configure_preinit(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 strap;
trace("CONFIGURE_PREINIT\n");
static void
init_io(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 port = nvbios_rd16(bios, init->offset + 1);
u8 mask = nvbios_rd16(bios, init->offset + 3);
u8 data = nvbios_rd16(bios, init->offset + 4);
static void
init_sub(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 index = nvbios_rd08(bios, init->offset + 1);
u16 addr, save;
static void
init_ram_condition(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 mask = nvbios_rd08(bios, init->offset + 1);
u8 value = nvbios_rd08(bios, init->offset + 2);
static void
init_nv_reg(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 reg = nvbios_rd32(bios, init->offset + 1);
u32 mask = nvbios_rd32(bios, init->offset + 5);
u32 data = nvbios_rd32(bios, init->offset + 9);
static void
init_macro(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 macro = nvbios_rd08(bios, init->offset + 1);
u16 table;
static void
init_strap_condition(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 mask = nvbios_rd32(bios, init->offset + 1);
u32 value = nvbios_rd32(bios, init->offset + 5);
static void
init_time(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 usec = nvbios_rd16(bios, init->offset + 1);
trace("TIME\t0x%04x\n", usec);
static void
init_condition(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 cond = nvbios_rd08(bios, init->offset + 1);
trace("CONDITION\t0x%02x\n", cond);
static void
init_io_condition(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 cond = nvbios_rd08(bios, init->offset + 1);
trace("IO_CONDITION\t0x%02x\n", cond);
static void
init_zm_reg16(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 addr = nvbios_rd32(bios, init->offset + 1);
u16 data = nvbios_rd16(bios, init->offset + 5);
static void
init_index_io(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u16 port = nvbios_rd16(bios, init->offset + 1);
u8 index = nvbios_rd16(bios, init->offset + 3);
u8 mask = nvbios_rd08(bios, init->offset + 4);
static void
init_pll(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 reg = nvbios_rd32(bios, init->offset + 1);
u32 freq = nvbios_rd16(bios, init->offset + 5) * 10;
static void
init_zm_reg(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 addr = nvbios_rd32(bios, init->offset + 1);
u32 data = nvbios_rd32(bios, init->offset + 5);
static void
init_ram_restrict_pll(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 type = nvbios_rd08(bios, init->offset + 1);
u8 count = init_ram_restrict_group_count(init);
u8 strap = init_ram_restrict(init);
static void
init_gpio(struct nvbios_init *init)
{
- struct nvkm_gpio *gpio = init->bios->subdev.device->gpio;
+ struct nvkm_gpio *gpio = init->subdev->device->gpio;
trace("GPIO\n");
init->offset += 1;
static void
init_ram_restrict_zm_reg_group(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 addr = nvbios_rd32(bios, init->offset + 1);
u8 incr = nvbios_rd08(bios, init->offset + 5);
u8 num = nvbios_rd08(bios, init->offset + 6);
static void
init_copy_zm_reg(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 sreg = nvbios_rd32(bios, init->offset + 1);
u32 dreg = nvbios_rd32(bios, init->offset + 5);
static void
init_zm_reg_group(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 addr = nvbios_rd32(bios, init->offset + 1);
u8 count = nvbios_rd08(bios, init->offset + 5);
static void
init_xlat(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 saddr = nvbios_rd32(bios, init->offset + 1);
u8 sshift = nvbios_rd08(bios, init->offset + 5);
u8 smask = nvbios_rd08(bios, init->offset + 6);
static void
init_zm_mask_add(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 addr = nvbios_rd32(bios, init->offset + 1);
u32 mask = nvbios_rd32(bios, init->offset + 5);
u32 add = nvbios_rd32(bios, init->offset + 9);
static void
init_auxch(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 addr = nvbios_rd32(bios, init->offset + 1);
u8 count = nvbios_rd08(bios, init->offset + 5);
static void
init_zm_auxch(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u32 addr = nvbios_rd32(bios, init->offset + 1);
u8 count = nvbios_rd08(bios, init->offset + 5);
static void
init_i2c_long_if(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
u8 index = nvbios_rd08(bios, init->offset + 1);
u8 addr = nvbios_rd08(bios, init->offset + 2) >> 1;
u8 reglo = nvbios_rd08(bios, init->offset + 3);
static void
init_gpio_ne(struct nvbios_init *init)
{
- struct nvkm_bios *bios = init->bios;
+ struct nvkm_bios *bios = init->subdev->device->bios;
struct nvkm_gpio *gpio = bios->subdev.device->gpio;
struct dcb_gpio_func func;
u8 count = nvbios_rd08(bios, init->offset + 1);
int
nvbios_exec(struct nvbios_init *init)
{
+ struct nvkm_bios *bios = init->subdev->device->bios;
init->nested++;
while (init->offset) {
- u8 opcode = nvbios_rd08(init->bios, init->offset);
+ u8 opcode = nvbios_rd08(bios, init->offset);
if (opcode >= init_opcode_nr || !init_opcode[opcode].exec) {
error("unknown opcode 0x%02x\n", opcode);
return -EINVAL;