Lines Matching refs:init
42 nvkm_printk(init->subdev, lvl, info, "0x%08x[%c]: "fmt, \
43 init->offset, init_exec(init) ? \
44 '0' + (init->nested - 1) : ' ', ##args); \
47 if (init->subdev->debug >= NV_DBG_TRACE) \
59 init_exec(struct nvbios_init *init) in init_exec() argument
61 return (init->execute == 1) || ((init->execute & 5) == 5); in init_exec()
65 init_exec_set(struct nvbios_init *init, bool exec) in init_exec_set() argument
67 if (exec) init->execute &= 0xfd; in init_exec_set()
68 else init->execute |= 0x02; in init_exec_set()
72 init_exec_inv(struct nvbios_init *init) in init_exec_inv() argument
74 init->execute ^= 0x02; in init_exec_inv()
78 init_exec_force(struct nvbios_init *init, bool exec) in init_exec_force() argument
80 if (exec) init->execute |= 0x04; in init_exec_force()
81 else init->execute &= 0xfb; in init_exec_force()
89 init_or(struct nvbios_init *init) in init_or() argument
91 if (init_exec(init)) { in init_or()
92 if (init->or >= 0) in init_or()
93 return init->or; in init_or()
100 init_link(struct nvbios_init *init) in init_link() argument
102 if (init_exec(init)) { in init_link()
103 if (init->link) in init_link()
104 return init->link == 2; in init_link()
111 init_head(struct nvbios_init *init) in init_head() argument
113 if (init_exec(init)) { in init_head()
114 if (init->head >= 0) in init_head()
115 return init->head; in init_head()
122 init_conn(struct nvbios_init *init) in init_conn() argument
124 struct nvkm_bios *bios = init->subdev->device->bios; in init_conn()
129 if (init_exec(init)) { in init_conn()
130 if (init->outp) { in init_conn()
131 conn = init->outp->connector; in init_conn()
144 init_nvreg(struct nvbios_init *init, u32 reg) in init_nvreg() argument
146 struct nvkm_devinit *devinit = init->subdev->device->devinit; in init_nvreg()
159 if (init->subdev->device->card_type >= NV_50) { in init_nvreg()
161 reg += init_head(init) * 0x800; in init_nvreg()
166 reg += init_or(init) * 0x800; in init_nvreg()
169 reg += init_link(init) * 0x80; in init_nvreg()
182 init_rd32(struct nvbios_init *init, u32 reg) in init_rd32() argument
184 struct nvkm_device *device = init->subdev->device; in init_rd32()
185 reg = init_nvreg(init, reg); in init_rd32()
186 if (reg != ~0 && init_exec(init)) in init_rd32()
192 init_wr32(struct nvbios_init *init, u32 reg, u32 val) in init_wr32() argument
194 struct nvkm_device *device = init->subdev->device; in init_wr32()
195 reg = init_nvreg(init, reg); in init_wr32()
196 if (reg != ~0 && init_exec(init)) in init_wr32()
201 init_mask(struct nvbios_init *init, u32 reg, u32 mask, u32 val) in init_mask() argument
203 struct nvkm_device *device = init->subdev->device; in init_mask()
204 reg = init_nvreg(init, reg); in init_mask()
205 if (reg != ~0 && init_exec(init)) { in init_mask()
214 init_rdport(struct nvbios_init *init, u16 port) in init_rdport() argument
216 if (init_exec(init)) in init_rdport()
217 return nvkm_rdport(init->subdev->device, init->head, port); in init_rdport()
222 init_wrport(struct nvbios_init *init, u16 port, u8 value) in init_wrport() argument
224 if (init_exec(init)) in init_wrport()
225 nvkm_wrport(init->subdev->device, init->head, port, value); in init_wrport()
229 init_rdvgai(struct nvbios_init *init, u16 port, u8 index) in init_rdvgai() argument
231 struct nvkm_subdev *subdev = init->subdev; in init_rdvgai()
232 if (init_exec(init)) { in init_rdvgai()
233 int head = init->head < 0 ? 0 : init->head; in init_rdvgai()
240 init_wrvgai(struct nvbios_init *init, u16 port, u8 index, u8 value) in init_wrvgai() argument
242 struct nvkm_device *device = init->subdev->device; in init_wrvgai()
247 init->head = 0; in init_wrvgai()
250 if (init_exec(init)) { in init_wrvgai()
251 int head = init->head < 0 ? 0 : init->head; in init_wrvgai()
258 init->head = 1; in init_wrvgai()
263 init_i2c(struct nvbios_init *init, int index) in init_i2c() argument
265 struct nvkm_i2c *i2c = init->subdev->device->i2c; in init_i2c()
270 if (init->outp && init->outp->i2c_upper_default) in init_i2c()
285 init_rdi2cr(struct nvbios_init *init, u8 index, u8 addr, u8 reg) in init_rdi2cr() argument
287 struct i2c_adapter *adap = init_i2c(init, index); in init_rdi2cr()
288 if (adap && init_exec(init)) in init_rdi2cr()
294 init_wri2cr(struct nvbios_init *init, u8 index, u8 addr, u8 reg, u8 val) in init_wri2cr() argument
296 struct i2c_adapter *adap = init_i2c(init, index); in init_wri2cr()
297 if (adap && init_exec(init)) in init_wri2cr()
303 init_aux(struct nvbios_init *init) in init_aux() argument
305 struct nvkm_i2c *i2c = init->subdev->device->i2c; in init_aux()
306 if (!init->outp) { in init_aux()
307 if (init_exec(init)) in init_aux()
311 return nvkm_i2c_aux_find(i2c, init->outp->i2c_index); in init_aux()
315 init_rdauxr(struct nvbios_init *init, u32 addr) in init_rdauxr() argument
317 struct nvkm_i2c_aux *aux = init_aux(init); in init_rdauxr()
320 if (aux && init_exec(init)) { in init_rdauxr()
331 init_wrauxr(struct nvbios_init *init, u32 addr, u8 data) in init_wrauxr() argument
333 struct nvkm_i2c_aux *aux = init_aux(init); in init_wrauxr()
334 if (aux && init_exec(init)) { in init_wrauxr()
344 init_prog_pll(struct nvbios_init *init, u32 id, u32 freq) in init_prog_pll() argument
346 struct nvkm_devinit *devinit = init->subdev->device->devinit; in init_prog_pll()
347 if (init_exec(init)) { in init_prog_pll()
377 init_table_(struct nvbios_init *init, u16 offset, const char *name) in init_table_() argument
379 struct nvkm_bios *bios = init->subdev->device->bios; in init_table_()
411 struct nvbios_init init = { .subdev = &bios->subdev }; in init_script() local
422 data = init_script_table(&init); in init_script()
439 init_ram_restrict_group_count(struct nvbios_init *init) in init_ram_restrict_group_count() argument
441 return nvbios_ramcfg_count(init->subdev->device->bios); in init_ram_restrict_group_count()
445 init_ram_restrict(struct nvbios_init *init) in init_ram_restrict() argument
455 if (!init->ramcfg || init->subdev->device->bios->version.major < 0x70) in init_ram_restrict()
456 init->ramcfg = 0x80000000 | nvbios_ramcfg_index(init->subdev); in init_ram_restrict()
457 return (init->ramcfg & 0x7fffffff); in init_ram_restrict()
461 init_xlat_(struct nvbios_init *init, u8 index, u8 offset) in init_xlat_() argument
463 struct nvkm_bios *bios = init->subdev->device->bios; in init_xlat_()
464 u16 table = init_xlat_table(init); in init_xlat_()
479 init_condition_met(struct nvbios_init *init, u8 cond) in init_condition_met() argument
481 struct nvkm_bios *bios = init->subdev->device->bios; in init_condition_met()
482 u16 table = init_condition_table(init); in init_condition_met()
489 return (init_rd32(init, reg) & msk) == val; in init_condition_met()
495 init_io_condition_met(struct nvbios_init *init, u8 cond) in init_io_condition_met() argument
497 struct nvkm_bios *bios = init->subdev->device->bios; in init_io_condition_met()
498 u16 table = init_io_condition_table(init); in init_io_condition_met()
506 return (init_rdvgai(init, port, index) & mask) == value; in init_io_condition_met()
512 init_io_flag_condition_met(struct nvbios_init *init, u8 cond) in init_io_flag_condition_met() argument
514 struct nvkm_bios *bios = init->subdev->device->bios; in init_io_flag_condition_met()
515 u16 table = init_io_flag_condition_table(init); in init_io_flag_condition_met()
524 u8 ioval = (init_rdvgai(init, port, index) & mask) >> shift; in init_io_flag_condition_met()
539 init_tmds_reg(struct nvbios_init *init, u8 tmds) in init_tmds_reg() argument
555 if (init->outp) { in init_tmds_reg()
556 u32 dacoffset = pramdac_offset[init->outp->or]; in init_tmds_reg()
562 if (init_exec(init)) in init_tmds_reg()
583 init_reserved(struct nvbios_init *init) in init_reserved() argument
585 struct nvkm_bios *bios = init->subdev->device->bios; in init_reserved()
586 u8 opcode = nvbios_rd08(bios, init->offset); in init_reserved()
600 cont(" 0x%02x", nvbios_rd08(bios, init->offset + i)); in init_reserved()
602 init->offset += length; in init_reserved()
610 init_done(struct nvbios_init *init) in init_done() argument
613 init->offset = 0x0000; in init_done()
621 init_io_restrict_prog(struct nvbios_init *init) in init_io_restrict_prog() argument
623 struct nvkm_bios *bios = init->subdev->device->bios; in init_io_restrict_prog()
624 u16 port = nvbios_rd16(bios, init->offset + 1); in init_io_restrict_prog()
625 u8 index = nvbios_rd08(bios, init->offset + 3); in init_io_restrict_prog()
626 u8 mask = nvbios_rd08(bios, init->offset + 4); in init_io_restrict_prog()
627 u8 shift = nvbios_rd08(bios, init->offset + 5); in init_io_restrict_prog()
628 u8 count = nvbios_rd08(bios, init->offset + 6); in init_io_restrict_prog()
629 u32 reg = nvbios_rd32(bios, init->offset + 7); in init_io_restrict_prog()
635 init->offset += 11; in init_io_restrict_prog()
637 conf = (init_rdvgai(init, port, index) & mask) >> shift; in init_io_restrict_prog()
639 u32 data = nvbios_rd32(bios, init->offset); in init_io_restrict_prog()
643 init_wr32(init, reg, data); in init_io_restrict_prog()
648 init->offset += 4; in init_io_restrict_prog()
658 init_repeat(struct nvbios_init *init) in init_repeat() argument
660 struct nvkm_bios *bios = init->subdev->device->bios; in init_repeat()
661 u8 count = nvbios_rd08(bios, init->offset + 1); in init_repeat()
662 u16 repeat = init->repeat; in init_repeat()
665 init->offset += 2; in init_repeat()
667 init->repeat = init->offset; in init_repeat()
668 init->repend = init->offset; in init_repeat()
670 init->offset = init->repeat; in init_repeat()
671 nvbios_exec(init); in init_repeat()
675 init->offset = init->repend; in init_repeat()
676 init->repeat = repeat; in init_repeat()
684 init_io_restrict_pll(struct nvbios_init *init) in init_io_restrict_pll() argument
686 struct nvkm_bios *bios = init->subdev->device->bios; in init_io_restrict_pll()
687 u16 port = nvbios_rd16(bios, init->offset + 1); in init_io_restrict_pll()
688 u8 index = nvbios_rd08(bios, init->offset + 3); in init_io_restrict_pll()
689 u8 mask = nvbios_rd08(bios, init->offset + 4); in init_io_restrict_pll()
690 u8 shift = nvbios_rd08(bios, init->offset + 5); in init_io_restrict_pll()
691 s8 iofc = nvbios_rd08(bios, init->offset + 6); in init_io_restrict_pll()
692 u8 count = nvbios_rd08(bios, init->offset + 7); in init_io_restrict_pll()
693 u32 reg = nvbios_rd32(bios, init->offset + 8); in init_io_restrict_pll()
699 init->offset += 12; in init_io_restrict_pll()
701 conf = (init_rdvgai(init, port, index) & mask) >> shift; in init_io_restrict_pll()
703 u32 freq = nvbios_rd16(bios, init->offset) * 10; in init_io_restrict_pll()
707 if (iofc > 0 && init_io_flag_condition_met(init, iofc)) in init_io_restrict_pll()
709 init_prog_pll(init, reg, freq); in init_io_restrict_pll()
714 init->offset += 2; in init_io_restrict_pll()
724 init_end_repeat(struct nvbios_init *init) in init_end_repeat() argument
727 init->offset += 1; in init_end_repeat()
729 if (init->repeat) { in init_end_repeat()
730 init->repend = init->offset; in init_end_repeat()
731 init->offset = 0; in init_end_repeat()
740 init_copy(struct nvbios_init *init) in init_copy() argument
742 struct nvkm_bios *bios = init->subdev->device->bios; in init_copy()
743 u32 reg = nvbios_rd32(bios, init->offset + 1); in init_copy()
744 u8 shift = nvbios_rd08(bios, init->offset + 5); in init_copy()
745 u8 smask = nvbios_rd08(bios, init->offset + 6); in init_copy()
746 u16 port = nvbios_rd16(bios, init->offset + 7); in init_copy()
747 u8 index = nvbios_rd08(bios, init->offset + 9); in init_copy()
748 u8 mask = nvbios_rd08(bios, init->offset + 10); in init_copy()
755 init->offset += 11; in init_copy()
757 data = init_rdvgai(init, port, index) & mask; in init_copy()
758 data |= init_shift(init_rd32(init, reg), shift) & smask; in init_copy()
759 init_wrvgai(init, port, index, data); in init_copy()
767 init_not(struct nvbios_init *init) in init_not() argument
770 init->offset += 1; in init_not()
771 init_exec_inv(init); in init_not()
779 init_io_flag_condition(struct nvbios_init *init) in init_io_flag_condition() argument
781 struct nvkm_bios *bios = init->subdev->device->bios; in init_io_flag_condition()
782 u8 cond = nvbios_rd08(bios, init->offset + 1); in init_io_flag_condition()
785 init->offset += 2; in init_io_flag_condition()
787 if (!init_io_flag_condition_met(init, cond)) in init_io_flag_condition()
788 init_exec_set(init, false); in init_io_flag_condition()
796 init_generic_condition(struct nvbios_init *init) in init_generic_condition() argument
798 struct nvkm_bios *bios = init->subdev->device->bios; in init_generic_condition()
800 u8 cond = nvbios_rd08(bios, init->offset + 1); in init_generic_condition()
801 u8 size = nvbios_rd08(bios, init->offset + 2); in init_generic_condition()
806 init->offset += 3; in init_generic_condition()
810 if (init_conn(init) != DCB_CONNECTOR_eDP) in init_generic_condition()
811 init_exec_set(init, false); in init_generic_condition()
815 if ( init->outp && in init_generic_condition()
817 (init->outp->or << 0) | in init_generic_condition()
818 (init->outp->sorconf.link << 6), in init_generic_condition()
822 init_exec_set(init, false); in init_generic_condition()
826 if (init_exec(init)) in init_generic_condition()
830 if (!(init_rdauxr(init, 0x0d) & 1)) in init_generic_condition()
831 init_exec_set(init, false); in init_generic_condition()
834 init_exec_set(init, false); in init_generic_condition()
838 init->offset += size; in init_generic_condition()
848 init_io_mask_or(struct nvbios_init *init) in init_io_mask_or() argument
850 struct nvkm_bios *bios = init->subdev->device->bios; in init_io_mask_or()
851 u8 index = nvbios_rd08(bios, init->offset + 1); in init_io_mask_or()
852 u8 or = init_or(init); in init_io_mask_or()
856 init->offset += 2; in init_io_mask_or()
858 data = init_rdvgai(init, 0x03d4, index); in init_io_mask_or()
859 init_wrvgai(init, 0x03d4, index, data &= ~(1 << or)); in init_io_mask_or()
867 init_io_or(struct nvbios_init *init) in init_io_or() argument
869 struct nvkm_bios *bios = init->subdev->device->bios; in init_io_or()
870 u8 index = nvbios_rd08(bios, init->offset + 1); in init_io_or()
871 u8 or = init_or(init); in init_io_or()
875 init->offset += 2; in init_io_or()
877 data = init_rdvgai(init, 0x03d4, index); in init_io_or()
878 init_wrvgai(init, 0x03d4, index, data | (1 << or)); in init_io_or()
886 init_andn_reg(struct nvbios_init *init) in init_andn_reg() argument
888 struct nvkm_bios *bios = init->subdev->device->bios; in init_andn_reg()
889 u32 reg = nvbios_rd32(bios, init->offset + 1); in init_andn_reg()
890 u32 mask = nvbios_rd32(bios, init->offset + 5); in init_andn_reg()
893 init->offset += 9; in init_andn_reg()
895 init_mask(init, reg, mask, 0); in init_andn_reg()
903 init_or_reg(struct nvbios_init *init) in init_or_reg() argument
905 struct nvkm_bios *bios = init->subdev->device->bios; in init_or_reg()
906 u32 reg = nvbios_rd32(bios, init->offset + 1); in init_or_reg()
907 u32 mask = nvbios_rd32(bios, init->offset + 5); in init_or_reg()
910 init->offset += 9; in init_or_reg()
912 init_mask(init, reg, 0, mask); in init_or_reg()
920 init_idx_addr_latched(struct nvbios_init *init) in init_idx_addr_latched() argument
922 struct nvkm_bios *bios = init->subdev->device->bios; in init_idx_addr_latched()
923 u32 creg = nvbios_rd32(bios, init->offset + 1); in init_idx_addr_latched()
924 u32 dreg = nvbios_rd32(bios, init->offset + 5); in init_idx_addr_latched()
925 u32 mask = nvbios_rd32(bios, init->offset + 9); in init_idx_addr_latched()
926 u32 data = nvbios_rd32(bios, init->offset + 13); in init_idx_addr_latched()
927 u8 count = nvbios_rd08(bios, init->offset + 17); in init_idx_addr_latched()
931 init->offset += 18; in init_idx_addr_latched()
934 u8 iaddr = nvbios_rd08(bios, init->offset + 0); in init_idx_addr_latched()
935 u8 idata = nvbios_rd08(bios, init->offset + 1); in init_idx_addr_latched()
938 init->offset += 2; in init_idx_addr_latched()
940 init_wr32(init, dreg, idata); in init_idx_addr_latched()
941 init_mask(init, creg, ~mask, data | iaddr); in init_idx_addr_latched()
950 init_io_restrict_pll2(struct nvbios_init *init) in init_io_restrict_pll2() argument
952 struct nvkm_bios *bios = init->subdev->device->bios; in init_io_restrict_pll2()
953 u16 port = nvbios_rd16(bios, init->offset + 1); in init_io_restrict_pll2()
954 u8 index = nvbios_rd08(bios, init->offset + 3); in init_io_restrict_pll2()
955 u8 mask = nvbios_rd08(bios, init->offset + 4); in init_io_restrict_pll2()
956 u8 shift = nvbios_rd08(bios, init->offset + 5); in init_io_restrict_pll2()
957 u8 count = nvbios_rd08(bios, init->offset + 6); in init_io_restrict_pll2()
958 u32 reg = nvbios_rd32(bios, init->offset + 7); in init_io_restrict_pll2()
964 init->offset += 11; in init_io_restrict_pll2()
966 conf = (init_rdvgai(init, port, index) & mask) >> shift; in init_io_restrict_pll2()
968 u32 freq = nvbios_rd32(bios, init->offset); in init_io_restrict_pll2()
971 init_prog_pll(init, reg, freq); in init_io_restrict_pll2()
975 init->offset += 4; in init_io_restrict_pll2()
985 init_pll2(struct nvbios_init *init) in init_pll2() argument
987 struct nvkm_bios *bios = init->subdev->device->bios; in init_pll2()
988 u32 reg = nvbios_rd32(bios, init->offset + 1); in init_pll2()
989 u32 freq = nvbios_rd32(bios, init->offset + 5); in init_pll2()
992 init->offset += 9; in init_pll2()
994 init_prog_pll(init, reg, freq); in init_pll2()
1002 init_i2c_byte(struct nvbios_init *init) in init_i2c_byte() argument
1004 struct nvkm_bios *bios = init->subdev->device->bios; in init_i2c_byte()
1005 u8 index = nvbios_rd08(bios, init->offset + 1); in init_i2c_byte()
1006 u8 addr = nvbios_rd08(bios, init->offset + 2) >> 1; in init_i2c_byte()
1007 u8 count = nvbios_rd08(bios, init->offset + 3); in init_i2c_byte()
1010 init->offset += 4; in init_i2c_byte()
1013 u8 reg = nvbios_rd08(bios, init->offset + 0); in init_i2c_byte()
1014 u8 mask = nvbios_rd08(bios, init->offset + 1); in init_i2c_byte()
1015 u8 data = nvbios_rd08(bios, init->offset + 2); in init_i2c_byte()
1019 init->offset += 3; in init_i2c_byte()
1021 val = init_rdi2cr(init, index, addr, reg); in init_i2c_byte()
1024 init_wri2cr(init, index, addr, reg, (val & mask) | data); in init_i2c_byte()
1033 init_zm_i2c_byte(struct nvbios_init *init) in init_zm_i2c_byte() argument
1035 struct nvkm_bios *bios = init->subdev->device->bios; in init_zm_i2c_byte()
1036 u8 index = nvbios_rd08(bios, init->offset + 1); in init_zm_i2c_byte()
1037 u8 addr = nvbios_rd08(bios, init->offset + 2) >> 1; in init_zm_i2c_byte()
1038 u8 count = nvbios_rd08(bios, init->offset + 3); in init_zm_i2c_byte()
1041 init->offset += 4; in init_zm_i2c_byte()
1044 u8 reg = nvbios_rd08(bios, init->offset + 0); in init_zm_i2c_byte()
1045 u8 data = nvbios_rd08(bios, init->offset + 1); in init_zm_i2c_byte()
1048 init->offset += 2; in init_zm_i2c_byte()
1050 init_wri2cr(init, index, addr, reg, data); in init_zm_i2c_byte()
1059 init_zm_i2c(struct nvbios_init *init) in init_zm_i2c() argument
1061 struct nvkm_bios *bios = init->subdev->device->bios; in init_zm_i2c()
1062 u8 index = nvbios_rd08(bios, init->offset + 1); in init_zm_i2c()
1063 u8 addr = nvbios_rd08(bios, init->offset + 2) >> 1; in init_zm_i2c()
1064 u8 count = nvbios_rd08(bios, init->offset + 3); in init_zm_i2c()
1068 init->offset += 4; in init_zm_i2c()
1071 data[i] = nvbios_rd08(bios, init->offset); in init_zm_i2c()
1073 init->offset++; in init_zm_i2c()
1076 if (init_exec(init)) { in init_zm_i2c()
1077 struct i2c_adapter *adap = init_i2c(init, index); in init_zm_i2c()
1093 init_tmds(struct nvbios_init *init) in init_tmds() argument
1095 struct nvkm_bios *bios = init->subdev->device->bios; in init_tmds()
1096 u8 tmds = nvbios_rd08(bios, init->offset + 1); in init_tmds()
1097 u8 addr = nvbios_rd08(bios, init->offset + 2); in init_tmds()
1098 u8 mask = nvbios_rd08(bios, init->offset + 3); in init_tmds()
1099 u8 data = nvbios_rd08(bios, init->offset + 4); in init_tmds()
1100 u32 reg = init_tmds_reg(init, tmds); in init_tmds()
1104 init->offset += 5; in init_tmds()
1109 init_wr32(init, reg + 0, addr | 0x00010000); in init_tmds()
1110 init_wr32(init, reg + 4, data | (init_rd32(init, reg + 4) & mask)); in init_tmds()
1111 init_wr32(init, reg + 0, addr); in init_tmds()
1119 init_zm_tmds_group(struct nvbios_init *init) in init_zm_tmds_group() argument
1121 struct nvkm_bios *bios = init->subdev->device->bios; in init_zm_tmds_group()
1122 u8 tmds = nvbios_rd08(bios, init->offset + 1); in init_zm_tmds_group()
1123 u8 count = nvbios_rd08(bios, init->offset + 2); in init_zm_tmds_group()
1124 u32 reg = init_tmds_reg(init, tmds); in init_zm_tmds_group()
1127 init->offset += 3; in init_zm_tmds_group()
1130 u8 addr = nvbios_rd08(bios, init->offset + 0); in init_zm_tmds_group()
1131 u8 data = nvbios_rd08(bios, init->offset + 1); in init_zm_tmds_group()
1134 init->offset += 2; in init_zm_tmds_group()
1136 init_wr32(init, reg + 4, data); in init_zm_tmds_group()
1137 init_wr32(init, reg + 0, addr); in init_zm_tmds_group()
1146 init_cr_idx_adr_latch(struct nvbios_init *init) in init_cr_idx_adr_latch() argument
1148 struct nvkm_bios *bios = init->subdev->device->bios; in init_cr_idx_adr_latch()
1149 u8 addr0 = nvbios_rd08(bios, init->offset + 1); in init_cr_idx_adr_latch()
1150 u8 addr1 = nvbios_rd08(bios, init->offset + 2); in init_cr_idx_adr_latch()
1151 u8 base = nvbios_rd08(bios, init->offset + 3); in init_cr_idx_adr_latch()
1152 u8 count = nvbios_rd08(bios, init->offset + 4); in init_cr_idx_adr_latch()
1156 init->offset += 5; in init_cr_idx_adr_latch()
1158 save0 = init_rdvgai(init, 0x03d4, addr0); in init_cr_idx_adr_latch()
1160 u8 data = nvbios_rd08(bios, init->offset); in init_cr_idx_adr_latch()
1163 init->offset += 1; in init_cr_idx_adr_latch()
1165 init_wrvgai(init, 0x03d4, addr0, base++); in init_cr_idx_adr_latch()
1166 init_wrvgai(init, 0x03d4, addr1, data); in init_cr_idx_adr_latch()
1168 init_wrvgai(init, 0x03d4, addr0, save0); in init_cr_idx_adr_latch()
1176 init_cr(struct nvbios_init *init) in init_cr() argument
1178 struct nvkm_bios *bios = init->subdev->device->bios; in init_cr()
1179 u8 addr = nvbios_rd08(bios, init->offset + 1); in init_cr()
1180 u8 mask = nvbios_rd08(bios, init->offset + 2); in init_cr()
1181 u8 data = nvbios_rd08(bios, init->offset + 3); in init_cr()
1185 init->offset += 4; in init_cr()
1187 val = init_rdvgai(init, 0x03d4, addr) & mask; in init_cr()
1188 init_wrvgai(init, 0x03d4, addr, val | data); in init_cr()
1196 init_zm_cr(struct nvbios_init *init) in init_zm_cr() argument
1198 struct nvkm_bios *bios = init->subdev->device->bios; in init_zm_cr()
1199 u8 addr = nvbios_rd08(bios, init->offset + 1); in init_zm_cr()
1200 u8 data = nvbios_rd08(bios, init->offset + 2); in init_zm_cr()
1203 init->offset += 3; in init_zm_cr()
1205 init_wrvgai(init, 0x03d4, addr, data); in init_zm_cr()
1213 init_zm_cr_group(struct nvbios_init *init) in init_zm_cr_group() argument
1215 struct nvkm_bios *bios = init->subdev->device->bios; in init_zm_cr_group()
1216 u8 count = nvbios_rd08(bios, init->offset + 1); in init_zm_cr_group()
1219 init->offset += 2; in init_zm_cr_group()
1222 u8 addr = nvbios_rd08(bios, init->offset + 0); in init_zm_cr_group()
1223 u8 data = nvbios_rd08(bios, init->offset + 1); in init_zm_cr_group()
1226 init->offset += 2; in init_zm_cr_group()
1228 init_wrvgai(init, 0x03d4, addr, data); in init_zm_cr_group()
1237 init_condition_time(struct nvbios_init *init) in init_condition_time() argument
1239 struct nvkm_bios *bios = init->subdev->device->bios; in init_condition_time()
1240 u8 cond = nvbios_rd08(bios, init->offset + 1); in init_condition_time()
1241 u8 retry = nvbios_rd08(bios, init->offset + 2); in init_condition_time()
1245 init->offset += 3; in init_condition_time()
1247 if (!init_exec(init)) in init_condition_time()
1251 if (init_condition_met(init, cond)) in init_condition_time()
1256 init_exec_set(init, false); in init_condition_time()
1264 init_ltime(struct nvbios_init *init) in init_ltime() argument
1266 struct nvkm_bios *bios = init->subdev->device->bios; in init_ltime()
1267 u16 msec = nvbios_rd16(bios, init->offset + 1); in init_ltime()
1270 init->offset += 3; in init_ltime()
1272 if (init_exec(init)) in init_ltime()
1281 init_zm_reg_sequence(struct nvbios_init *init) in init_zm_reg_sequence() argument
1283 struct nvkm_bios *bios = init->subdev->device->bios; in init_zm_reg_sequence()
1284 u32 base = nvbios_rd32(bios, init->offset + 1); in init_zm_reg_sequence()
1285 u8 count = nvbios_rd08(bios, init->offset + 5); in init_zm_reg_sequence()
1288 init->offset += 6; in init_zm_reg_sequence()
1291 u32 data = nvbios_rd32(bios, init->offset); in init_zm_reg_sequence()
1294 init->offset += 4; in init_zm_reg_sequence()
1296 init_wr32(init, base, data); in init_zm_reg_sequence()
1306 init_pll_indirect(struct nvbios_init *init) in init_pll_indirect() argument
1308 struct nvkm_bios *bios = init->subdev->device->bios; in init_pll_indirect()
1309 u32 reg = nvbios_rd32(bios, init->offset + 1); in init_pll_indirect()
1310 u16 addr = nvbios_rd16(bios, init->offset + 5); in init_pll_indirect()
1315 init->offset += 7; in init_pll_indirect()
1317 init_prog_pll(init, reg, freq); in init_pll_indirect()
1325 init_zm_reg_indirect(struct nvbios_init *init) in init_zm_reg_indirect() argument
1327 struct nvkm_bios *bios = init->subdev->device->bios; in init_zm_reg_indirect()
1328 u32 reg = nvbios_rd32(bios, init->offset + 1); in init_zm_reg_indirect()
1329 u16 addr = nvbios_rd16(bios, init->offset + 5); in init_zm_reg_indirect()
1334 init->offset += 7; in init_zm_reg_indirect()
1336 init_wr32(init, addr, data); in init_zm_reg_indirect()
1344 init_sub_direct(struct nvbios_init *init) in init_sub_direct() argument
1346 struct nvkm_bios *bios = init->subdev->device->bios; in init_sub_direct()
1347 u16 addr = nvbios_rd16(bios, init->offset + 1); in init_sub_direct()
1352 if (init_exec(init)) { in init_sub_direct()
1353 save = init->offset; in init_sub_direct()
1354 init->offset = addr; in init_sub_direct()
1355 if (nvbios_exec(init)) { in init_sub_direct()
1359 init->offset = save; in init_sub_direct()
1362 init->offset += 3; in init_sub_direct()
1370 init_jump(struct nvbios_init *init) in init_jump() argument
1372 struct nvkm_bios *bios = init->subdev->device->bios; in init_jump()
1373 u16 offset = nvbios_rd16(bios, init->offset + 1); in init_jump()
1377 if (init_exec(init)) in init_jump()
1378 init->offset = offset; in init_jump()
1380 init->offset += 3; in init_jump()
1388 init_i2c_if(struct nvbios_init *init) in init_i2c_if() argument
1390 struct nvkm_bios *bios = init->subdev->device->bios; in init_i2c_if()
1391 u8 index = nvbios_rd08(bios, init->offset + 1); in init_i2c_if()
1392 u8 addr = nvbios_rd08(bios, init->offset + 2); in init_i2c_if()
1393 u8 reg = nvbios_rd08(bios, init->offset + 3); in init_i2c_if()
1394 u8 mask = nvbios_rd08(bios, init->offset + 4); in init_i2c_if()
1395 u8 data = nvbios_rd08(bios, init->offset + 5); in init_i2c_if()
1400 init->offset += 6; in init_i2c_if()
1401 init_exec_force(init, true); in init_i2c_if()
1403 value = init_rdi2cr(init, index, addr, reg); in init_i2c_if()
1405 init_exec_set(init, false); in init_i2c_if()
1407 init_exec_force(init, false); in init_i2c_if()
1415 init_copy_nv_reg(struct nvbios_init *init) in init_copy_nv_reg() argument
1417 struct nvkm_bios *bios = init->subdev->device->bios; in init_copy_nv_reg()
1418 u32 sreg = nvbios_rd32(bios, init->offset + 1); in init_copy_nv_reg()
1419 u8 shift = nvbios_rd08(bios, init->offset + 5); in init_copy_nv_reg()
1420 u32 smask = nvbios_rd32(bios, init->offset + 6); in init_copy_nv_reg()
1421 u32 sxor = nvbios_rd32(bios, init->offset + 10); in init_copy_nv_reg()
1422 u32 dreg = nvbios_rd32(bios, init->offset + 14); in init_copy_nv_reg()
1423 u32 dmask = nvbios_rd32(bios, init->offset + 18); in init_copy_nv_reg()
1430 init->offset += 22; in init_copy_nv_reg()
1432 data = init_shift(init_rd32(init, sreg), shift); in init_copy_nv_reg()
1433 init_mask(init, dreg, ~dmask, (data & smask) ^ sxor); in init_copy_nv_reg()
1441 init_zm_index_io(struct nvbios_init *init) in init_zm_index_io() argument
1443 struct nvkm_bios *bios = init->subdev->device->bios; in init_zm_index_io()
1444 u16 port = nvbios_rd16(bios, init->offset + 1); in init_zm_index_io()
1445 u8 index = nvbios_rd08(bios, init->offset + 3); in init_zm_index_io()
1446 u8 data = nvbios_rd08(bios, init->offset + 4); in init_zm_index_io()
1449 init->offset += 5; in init_zm_index_io()
1451 init_wrvgai(init, port, index, data); in init_zm_index_io()
1459 init_compute_mem(struct nvbios_init *init) in init_compute_mem() argument
1461 struct nvkm_devinit *devinit = init->subdev->device->devinit; in init_compute_mem()
1464 init->offset += 1; in init_compute_mem()
1466 init_exec_force(init, true); in init_compute_mem()
1467 if (init_exec(init)) in init_compute_mem()
1469 init_exec_force(init, false); in init_compute_mem()
1477 init_reset(struct nvbios_init *init) in init_reset() argument
1479 struct nvkm_bios *bios = init->subdev->device->bios; in init_reset()
1480 u32 reg = nvbios_rd32(bios, init->offset + 1); in init_reset()
1481 u32 data1 = nvbios_rd32(bios, init->offset + 5); in init_reset()
1482 u32 data2 = nvbios_rd32(bios, init->offset + 9); in init_reset()
1486 init->offset += 13; in init_reset()
1487 init_exec_force(init, true); in init_reset()
1489 savepci19 = init_mask(init, 0x00184c, 0x00000f00, 0x00000000); in init_reset()
1490 init_wr32(init, reg, data1); in init_reset()
1492 init_wr32(init, reg, data2); in init_reset()
1493 init_wr32(init, 0x00184c, savepci19); in init_reset()
1494 init_mask(init, 0x001850, 0x00000001, 0x00000000); in init_reset()
1496 init_exec_force(init, false); in init_reset()
1504 init_configure_mem_clk(struct nvbios_init *init) in init_configure_mem_clk() argument
1506 u16 mdata = bmp_mem_init_table(init->subdev->device->bios); in init_configure_mem_clk()
1508 mdata += (init_rdvgai(init, 0x03d4, 0x3c) >> 4) * 66; in init_configure_mem_clk()
1513 init_configure_mem(struct nvbios_init *init) in init_configure_mem() argument
1515 struct nvkm_bios *bios = init->subdev->device->bios; in init_configure_mem()
1520 init->offset += 1; in init_configure_mem()
1523 init_done(init); in init_configure_mem()
1526 init_exec_force(init, true); in init_configure_mem()
1528 mdata = init_configure_mem_clk(init); in init_configure_mem()
1534 data = init_rdvgai(init, 0x03c4, 0x01); in init_configure_mem()
1535 init_wrvgai(init, 0x03c4, 0x01, data | 0x20); in init_configure_mem()
1552 init_wr32(init, addr, data); in init_configure_mem()
1555 init_exec_force(init, false); in init_configure_mem()
1563 init_configure_clk(struct nvbios_init *init) in init_configure_clk() argument
1565 struct nvkm_bios *bios = init->subdev->device->bios; in init_configure_clk()
1569 init->offset += 1; in init_configure_clk()
1572 init_done(init); in init_configure_clk()
1575 init_exec_force(init, true); in init_configure_clk()
1577 mdata = init_configure_mem_clk(init); in init_configure_clk()
1581 init_prog_pll(init, 0x680500, clock); in init_configure_clk()
1587 init_prog_pll(init, 0x680504, clock); in init_configure_clk()
1589 init_exec_force(init, false); in init_configure_clk()
1597 init_configure_preinit(struct nvbios_init *init) in init_configure_preinit() argument
1599 struct nvkm_bios *bios = init->subdev->device->bios; in init_configure_preinit()
1603 init->offset += 1; in init_configure_preinit()
1606 init_done(init); in init_configure_preinit()
1609 init_exec_force(init, true); in init_configure_preinit()
1611 strap = init_rd32(init, 0x101000); in init_configure_preinit()
1613 init_wrvgai(init, 0x03d4, 0x3c, strap); in init_configure_preinit()
1615 init_exec_force(init, false); in init_configure_preinit()
1623 init_io(struct nvbios_init *init) in init_io() argument
1625 struct nvkm_bios *bios = init->subdev->device->bios; in init_io()
1626 u16 port = nvbios_rd16(bios, init->offset + 1); in init_io()
1627 u8 mask = nvbios_rd16(bios, init->offset + 3); in init_io()
1628 u8 data = nvbios_rd16(bios, init->offset + 4); in init_io()
1632 init->offset += 5; in init_io()
1640 init_mask(init, 0x614100, 0xf0800000, 0x00800000); in init_io()
1641 init_mask(init, 0x00e18c, 0x00020000, 0x00020000); in init_io()
1642 init_mask(init, 0x614900, 0xf0800000, 0x00800000); in init_io()
1643 init_mask(init, 0x000200, 0x40000000, 0x00000000); in init_io()
1645 init_mask(init, 0x00e18c, 0x00020000, 0x00000000); in init_io()
1646 init_mask(init, 0x000200, 0x40000000, 0x40000000); in init_io()
1647 init_wr32(init, 0x614100, 0x00800018); in init_io()
1648 init_wr32(init, 0x614900, 0x00800018); in init_io()
1650 init_wr32(init, 0x614100, 0x10000018); in init_io()
1651 init_wr32(init, 0x614900, 0x10000018); in init_io()
1654 value = init_rdport(init, port) & mask; in init_io()
1655 init_wrport(init, port, data | value); in init_io()
1663 init_sub(struct nvbios_init *init) in init_sub() argument
1665 struct nvkm_bios *bios = init->subdev->device->bios; in init_sub()
1666 u8 index = nvbios_rd08(bios, init->offset + 1); in init_sub()
1672 if (addr && init_exec(init)) { in init_sub()
1673 save = init->offset; in init_sub()
1674 init->offset = addr; in init_sub()
1675 if (nvbios_exec(init)) { in init_sub()
1679 init->offset = save; in init_sub()
1682 init->offset += 2; in init_sub()
1690 init_ram_condition(struct nvbios_init *init) in init_ram_condition() argument
1692 struct nvkm_bios *bios = init->subdev->device->bios; in init_ram_condition()
1693 u8 mask = nvbios_rd08(bios, init->offset + 1); in init_ram_condition()
1694 u8 value = nvbios_rd08(bios, init->offset + 2); in init_ram_condition()
1698 init->offset += 3; in init_ram_condition()
1700 if ((init_rd32(init, 0x100000) & mask) != value) in init_ram_condition()
1701 init_exec_set(init, false); in init_ram_condition()
1709 init_nv_reg(struct nvbios_init *init) in init_nv_reg() argument
1711 struct nvkm_bios *bios = init->subdev->device->bios; in init_nv_reg()
1712 u32 reg = nvbios_rd32(bios, init->offset + 1); in init_nv_reg()
1713 u32 mask = nvbios_rd32(bios, init->offset + 5); in init_nv_reg()
1714 u32 data = nvbios_rd32(bios, init->offset + 9); in init_nv_reg()
1717 init->offset += 13; in init_nv_reg()
1719 init_mask(init, reg, ~mask, data); in init_nv_reg()
1727 init_macro(struct nvbios_init *init) in init_macro() argument
1729 struct nvkm_bios *bios = init->subdev->device->bios; in init_macro()
1730 u8 macro = nvbios_rd08(bios, init->offset + 1); in init_macro()
1735 table = init_macro_table(init); in init_macro()
1740 init_wr32(init, addr, data); in init_macro()
1743 init->offset += 2; in init_macro()
1751 init_resume(struct nvbios_init *init) in init_resume() argument
1754 init->offset += 1; in init_resume()
1755 init_exec_set(init, true); in init_resume()
1763 init_strap_condition(struct nvbios_init *init) in init_strap_condition() argument
1765 struct nvkm_bios *bios = init->subdev->device->bios; in init_strap_condition()
1766 u32 mask = nvbios_rd32(bios, init->offset + 1); in init_strap_condition()
1767 u32 value = nvbios_rd32(bios, init->offset + 5); in init_strap_condition()
1770 init->offset += 9; in init_strap_condition()
1772 if ((init_rd32(init, 0x101000) & mask) != value) in init_strap_condition()
1773 init_exec_set(init, false); in init_strap_condition()
1781 init_time(struct nvbios_init *init) in init_time() argument
1783 struct nvkm_bios *bios = init->subdev->device->bios; in init_time()
1784 u16 usec = nvbios_rd16(bios, init->offset + 1); in init_time()
1787 init->offset += 3; in init_time()
1789 if (init_exec(init)) { in init_time()
1802 init_condition(struct nvbios_init *init) in init_condition() argument
1804 struct nvkm_bios *bios = init->subdev->device->bios; in init_condition()
1805 u8 cond = nvbios_rd08(bios, init->offset + 1); in init_condition()
1808 init->offset += 2; in init_condition()
1810 if (!init_condition_met(init, cond)) in init_condition()
1811 init_exec_set(init, false); in init_condition()
1819 init_io_condition(struct nvbios_init *init) in init_io_condition() argument
1821 struct nvkm_bios *bios = init->subdev->device->bios; in init_io_condition()
1822 u8 cond = nvbios_rd08(bios, init->offset + 1); in init_io_condition()
1825 init->offset += 2; in init_io_condition()
1827 if (!init_io_condition_met(init, cond)) in init_io_condition()
1828 init_exec_set(init, false); in init_io_condition()
1836 init_zm_reg16(struct nvbios_init *init) in init_zm_reg16() argument
1838 struct nvkm_bios *bios = init->subdev->device->bios; in init_zm_reg16()
1839 u32 addr = nvbios_rd32(bios, init->offset + 1); in init_zm_reg16()
1840 u16 data = nvbios_rd16(bios, init->offset + 5); in init_zm_reg16()
1843 init->offset += 7; in init_zm_reg16()
1845 init_wr32(init, addr, data); in init_zm_reg16()
1853 init_index_io(struct nvbios_init *init) in init_index_io() argument
1855 struct nvkm_bios *bios = init->subdev->device->bios; in init_index_io()
1856 u16 port = nvbios_rd16(bios, init->offset + 1); in init_index_io()
1857 u8 index = nvbios_rd16(bios, init->offset + 3); in init_index_io()
1858 u8 mask = nvbios_rd08(bios, init->offset + 4); in init_index_io()
1859 u8 data = nvbios_rd08(bios, init->offset + 5); in init_index_io()
1864 init->offset += 6; in init_index_io()
1866 value = init_rdvgai(init, port, index) & mask; in init_index_io()
1867 init_wrvgai(init, port, index, data | value); in init_index_io()
1875 init_pll(struct nvbios_init *init) in init_pll() argument
1877 struct nvkm_bios *bios = init->subdev->device->bios; in init_pll()
1878 u32 reg = nvbios_rd32(bios, init->offset + 1); in init_pll()
1879 u32 freq = nvbios_rd16(bios, init->offset + 5) * 10; in init_pll()
1882 init->offset += 7; in init_pll()
1884 init_prog_pll(init, reg, freq); in init_pll()
1892 init_zm_reg(struct nvbios_init *init) in init_zm_reg() argument
1894 struct nvkm_bios *bios = init->subdev->device->bios; in init_zm_reg()
1895 u32 addr = nvbios_rd32(bios, init->offset + 1); in init_zm_reg()
1896 u32 data = nvbios_rd32(bios, init->offset + 5); in init_zm_reg()
1899 init->offset += 9; in init_zm_reg()
1904 init_wr32(init, addr, data); in init_zm_reg()
1912 init_ram_restrict_pll(struct nvbios_init *init) in init_ram_restrict_pll() argument
1914 struct nvkm_bios *bios = init->subdev->device->bios; in init_ram_restrict_pll()
1915 u8 type = nvbios_rd08(bios, init->offset + 1); in init_ram_restrict_pll()
1916 u8 count = init_ram_restrict_group_count(init); in init_ram_restrict_pll()
1917 u8 strap = init_ram_restrict(init); in init_ram_restrict_pll()
1921 init->offset += 2; in init_ram_restrict_pll()
1924 u32 freq = nvbios_rd32(bios, init->offset); in init_ram_restrict_pll()
1928 init_prog_pll(init, type, freq); in init_ram_restrict_pll()
1933 init->offset += 4; in init_ram_restrict_pll()
1942 init_reset_begun(struct nvbios_init *init) in init_reset_begun() argument
1945 init->offset += 1; in init_reset_begun()
1953 init_reset_end(struct nvbios_init *init) in init_reset_end() argument
1956 init->offset += 1; in init_reset_end()
1964 init_gpio(struct nvbios_init *init) in init_gpio() argument
1966 struct nvkm_gpio *gpio = init->subdev->device->gpio; in init_gpio()
1969 init->offset += 1; in init_gpio()
1971 if (init_exec(init)) in init_gpio()
1980 init_ram_restrict_zm_reg_group(struct nvbios_init *init) in init_ram_restrict_zm_reg_group() argument
1982 struct nvkm_bios *bios = init->subdev->device->bios; in init_ram_restrict_zm_reg_group()
1983 u32 addr = nvbios_rd32(bios, init->offset + 1); in init_ram_restrict_zm_reg_group()
1984 u8 incr = nvbios_rd08(bios, init->offset + 5); in init_ram_restrict_zm_reg_group()
1985 u8 num = nvbios_rd08(bios, init->offset + 6); in init_ram_restrict_zm_reg_group()
1986 u8 count = init_ram_restrict_group_count(init); in init_ram_restrict_zm_reg_group()
1987 u8 index = init_ram_restrict(init); in init_ram_restrict_zm_reg_group()
1992 init->offset += 7; in init_ram_restrict_zm_reg_group()
1997 u32 data = nvbios_rd32(bios, init->offset); in init_ram_restrict_zm_reg_group()
2001 init_wr32(init, addr, data); in init_ram_restrict_zm_reg_group()
2006 init->offset += 4; in init_ram_restrict_zm_reg_group()
2018 init_copy_zm_reg(struct nvbios_init *init) in init_copy_zm_reg() argument
2020 struct nvkm_bios *bios = init->subdev->device->bios; in init_copy_zm_reg()
2021 u32 sreg = nvbios_rd32(bios, init->offset + 1); in init_copy_zm_reg()
2022 u32 dreg = nvbios_rd32(bios, init->offset + 5); in init_copy_zm_reg()
2025 init->offset += 9; in init_copy_zm_reg()
2027 init_wr32(init, dreg, init_rd32(init, sreg)); in init_copy_zm_reg()
2035 init_zm_reg_group(struct nvbios_init *init) in init_zm_reg_group() argument
2037 struct nvkm_bios *bios = init->subdev->device->bios; in init_zm_reg_group()
2038 u32 addr = nvbios_rd32(bios, init->offset + 1); in init_zm_reg_group()
2039 u8 count = nvbios_rd08(bios, init->offset + 5); in init_zm_reg_group()
2042 init->offset += 6; in init_zm_reg_group()
2045 u32 data = nvbios_rd32(bios, init->offset); in init_zm_reg_group()
2047 init_wr32(init, addr, data); in init_zm_reg_group()
2048 init->offset += 4; in init_zm_reg_group()
2057 init_xlat(struct nvbios_init *init) in init_xlat() argument
2059 struct nvkm_bios *bios = init->subdev->device->bios; in init_xlat()
2060 u32 saddr = nvbios_rd32(bios, init->offset + 1); in init_xlat()
2061 u8 sshift = nvbios_rd08(bios, init->offset + 5); in init_xlat()
2062 u8 smask = nvbios_rd08(bios, init->offset + 6); in init_xlat()
2063 u8 index = nvbios_rd08(bios, init->offset + 7); in init_xlat()
2064 u32 daddr = nvbios_rd32(bios, init->offset + 8); in init_xlat()
2065 u32 dmask = nvbios_rd32(bios, init->offset + 12); in init_xlat()
2066 u8 shift = nvbios_rd08(bios, init->offset + 16); in init_xlat()
2073 init->offset += 17; in init_xlat()
2075 data = init_shift(init_rd32(init, saddr), sshift) & smask; in init_xlat()
2076 data = init_xlat_(init, index, data) << shift; in init_xlat()
2077 init_mask(init, daddr, ~dmask, data); in init_xlat()
2085 init_zm_mask_add(struct nvbios_init *init) in init_zm_mask_add() argument
2087 struct nvkm_bios *bios = init->subdev->device->bios; in init_zm_mask_add()
2088 u32 addr = nvbios_rd32(bios, init->offset + 1); in init_zm_mask_add()
2089 u32 mask = nvbios_rd32(bios, init->offset + 5); in init_zm_mask_add()
2090 u32 add = nvbios_rd32(bios, init->offset + 9); in init_zm_mask_add()
2094 init->offset += 13; in init_zm_mask_add()
2096 data = init_rd32(init, addr); in init_zm_mask_add()
2098 init_wr32(init, addr, data); in init_zm_mask_add()
2106 init_auxch(struct nvbios_init *init) in init_auxch() argument
2108 struct nvkm_bios *bios = init->subdev->device->bios; in init_auxch()
2109 u32 addr = nvbios_rd32(bios, init->offset + 1); in init_auxch()
2110 u8 count = nvbios_rd08(bios, init->offset + 5); in init_auxch()
2113 init->offset += 6; in init_auxch()
2116 u8 mask = nvbios_rd08(bios, init->offset + 0); in init_auxch()
2117 u8 data = nvbios_rd08(bios, init->offset + 1); in init_auxch()
2119 mask = init_rdauxr(init, addr) & mask; in init_auxch()
2120 init_wrauxr(init, addr, mask | data); in init_auxch()
2121 init->offset += 2; in init_auxch()
2130 init_zm_auxch(struct nvbios_init *init) in init_zm_auxch() argument
2132 struct nvkm_bios *bios = init->subdev->device->bios; in init_zm_auxch()
2133 u32 addr = nvbios_rd32(bios, init->offset + 1); in init_zm_auxch()
2134 u8 count = nvbios_rd08(bios, init->offset + 5); in init_zm_auxch()
2137 init->offset += 6; in init_zm_auxch()
2140 u8 data = nvbios_rd08(bios, init->offset + 0); in init_zm_auxch()
2142 init_wrauxr(init, addr, data); in init_zm_auxch()
2143 init->offset += 1; in init_zm_auxch()
2152 init_i2c_long_if(struct nvbios_init *init) in init_i2c_long_if() argument
2154 struct nvkm_bios *bios = init->subdev->device->bios; in init_i2c_long_if()
2155 u8 index = nvbios_rd08(bios, init->offset + 1); in init_i2c_long_if()
2156 u8 addr = nvbios_rd08(bios, init->offset + 2) >> 1; in init_i2c_long_if()
2157 u8 reglo = nvbios_rd08(bios, init->offset + 3); in init_i2c_long_if()
2158 u8 reghi = nvbios_rd08(bios, init->offset + 4); in init_i2c_long_if()
2159 u8 mask = nvbios_rd08(bios, init->offset + 5); in init_i2c_long_if()
2160 u8 data = nvbios_rd08(bios, init->offset + 6); in init_i2c_long_if()
2166 init->offset += 7; in init_i2c_long_if()
2168 adap = init_i2c(init, index); in init_i2c_long_if()
2183 init_exec_set(init, false); in init_i2c_long_if()
2191 init_gpio_ne(struct nvbios_init *init) in init_gpio_ne() argument
2193 struct nvkm_bios *bios = init->subdev->device->bios; in init_gpio_ne()
2196 u8 count = nvbios_rd08(bios, init->offset + 1); in init_gpio_ne()
2201 init->offset += 2; in init_gpio_ne()
2203 for (i = init->offset; i < init->offset + count; i++) in init_gpio_ne()
2209 for (i = init->offset; i < init->offset + count; i++) { in init_gpio_ne()
2215 if (i == (init->offset + count)) { in init_gpio_ne()
2217 if (init_exec(init)) in init_gpio_ne()
2224 init->offset += count; in init_gpio_ne()
2302 nvbios_exec(struct nvbios_init *init) in nvbios_exec() argument
2304 struct nvkm_bios *bios = init->subdev->device->bios; in nvbios_exec()
2306 init->nested++; in nvbios_exec()
2307 while (init->offset) { in nvbios_exec()
2308 u8 opcode = nvbios_rd08(bios, init->offset); in nvbios_exec()
2315 init_opcode[opcode].exec(init); in nvbios_exec()
2317 init->nested--; in nvbios_exec()
2333 init.execute = execute ? 1 : 0; in nvbios_post()
2342 init.execute = execute ? 1 : 0; in nvbios_post()