Lines Matching refs:bios
32 nvbios_addr(struct nvkm_bios *bios, u32 *addr, u8 size) in nvbios_addr() argument
36 if (*addr > bios->image0_size && bios->imaged_addr) { in nvbios_addr()
37 *addr -= bios->image0_size; in nvbios_addr()
38 *addr += bios->imaged_addr; in nvbios_addr()
41 if (unlikely(*addr + size >= bios->size)) { in nvbios_addr()
42 nvkm_error(&bios->subdev, "OOB %d %08x %08x\n", size, p, *addr); in nvbios_addr()
50 nvbios_rd08(struct nvkm_bios *bios, u32 addr) in nvbios_rd08() argument
52 if (likely(nvbios_addr(bios, &addr, 1))) in nvbios_rd08()
53 return bios->data[addr]; in nvbios_rd08()
58 nvbios_rd16(struct nvkm_bios *bios, u32 addr) in nvbios_rd16() argument
60 if (likely(nvbios_addr(bios, &addr, 2))) in nvbios_rd16()
61 return get_unaligned_le16(&bios->data[addr]); in nvbios_rd16()
66 nvbios_rd32(struct nvkm_bios *bios, u32 addr) in nvbios_rd32() argument
68 if (likely(nvbios_addr(bios, &addr, 4))) in nvbios_rd32()
69 return get_unaligned_le32(&bios->data[addr]); in nvbios_rd32()
99 nvbios_memcmp(struct nvkm_bios *bios, u32 addr, const char *str, u32 len) in nvbios_memcmp() argument
104 c1 = nvbios_rd08(bios, addr++); in nvbios_memcmp()
113 nvbios_extend(struct nvkm_bios *bios, u32 length) in nvbios_extend() argument
115 if (bios->size < length) { in nvbios_extend()
116 u8 *prev = bios->data; in nvbios_extend()
117 if (!(bios->data = kmalloc(length, GFP_KERNEL))) { in nvbios_extend()
118 bios->data = prev; in nvbios_extend()
121 memcpy(bios->data, prev, bios->size); in nvbios_extend()
122 bios->size = length; in nvbios_extend()
132 struct nvkm_bios *bios = nvkm_bios(subdev); in nvkm_bios_dtor() local
133 kfree(bios->data); in nvkm_bios_dtor()
134 return bios; in nvkm_bios_dtor()
145 struct nvkm_bios *bios; in nvkm_bios_new() local
150 if (!(bios = *pbios = kzalloc(sizeof(*bios), GFP_KERNEL))) in nvkm_bios_new()
152 nvkm_subdev_ctor(&nvkm_bios, device, index, &bios->subdev); in nvkm_bios_new()
154 ret = nvbios_shadow(bios); in nvkm_bios_new()
161 if (nvbios_image(bios, idx++, &image)) { in nvkm_bios_new()
162 bios->image0_size = image.size; in nvkm_bios_new()
163 while (nvbios_image(bios, idx++, &image)) { in nvkm_bios_new()
165 bios->imaged_addr = image.base; in nvkm_bios_new()
172 bios->bmp_offset = nvbios_findstr(bios->data, bios->size, in nvkm_bios_new()
174 if (bios->bmp_offset) { in nvkm_bios_new()
175 nvkm_debug(&bios->subdev, "BMP version %x.%x\n", in nvkm_bios_new()
176 bmp_version(bios) >> 8, in nvkm_bios_new()
177 bmp_version(bios) & 0xff); in nvkm_bios_new()
180 bios->bit_offset = nvbios_findstr(bios->data, bios->size, in nvkm_bios_new()
182 if (bios->bit_offset) in nvkm_bios_new()
183 nvkm_debug(&bios->subdev, "BIT signature found\n"); in nvkm_bios_new()
186 if (!bit_entry(bios, 'i', &bit_i) && bit_i.length >= 4) { in nvkm_bios_new()
187 bios->version.major = nvbios_rd08(bios, bit_i.offset + 3); in nvkm_bios_new()
188 bios->version.chip = nvbios_rd08(bios, bit_i.offset + 2); in nvkm_bios_new()
189 bios->version.minor = nvbios_rd08(bios, bit_i.offset + 1); in nvkm_bios_new()
190 bios->version.micro = nvbios_rd08(bios, bit_i.offset + 0); in nvkm_bios_new()
191 bios->version.patch = nvbios_rd08(bios, bit_i.offset + 4); in nvkm_bios_new()
193 if (bmp_version(bios)) { in nvkm_bios_new()
194 bios->version.major = nvbios_rd08(bios, bios->bmp_offset + 13); in nvkm_bios_new()
195 bios->version.chip = nvbios_rd08(bios, bios->bmp_offset + 12); in nvkm_bios_new()
196 bios->version.minor = nvbios_rd08(bios, bios->bmp_offset + 11); in nvkm_bios_new()
197 bios->version.micro = nvbios_rd08(bios, bios->bmp_offset + 10); in nvkm_bios_new()
200 nvkm_info(&bios->subdev, "version %02x.%02x.%02x.%02x.%02x\n", in nvkm_bios_new()
201 bios->version.major, bios->version.chip, in nvkm_bios_new()
202 bios->version.minor, bios->version.micro, bios->version.patch); in nvkm_bios_new()