1 #ifndef __NVKM_BIOS_H__
2 #define __NVKM_BIOS_H__
3 #include <core/subdev.h>
4 
5 struct nvkm_bios {
6 	struct nvkm_subdev subdev;
7 	u32 size;
8 	u8 *data;
9 
10 	u32 image0_size;
11 	u32 imaged_addr;
12 
13 	u32 bmp_offset;
14 	u32 bit_offset;
15 
16 	struct {
17 		u8 major;
18 		u8 chip;
19 		u8 minor;
20 		u8 micro;
21 		u8 patch;
22 	} version;
23 };
24 
25 u8  nvbios_checksum(const u8 *data, int size);
26 u16 nvbios_findstr(const u8 *data, int size, const char *str, int len);
27 int nvbios_memcmp(struct nvkm_bios *, u32 addr, const char *, u32 len);
28 u8  nvbios_rd08(struct nvkm_bios *, u32 addr);
29 u16 nvbios_rd16(struct nvkm_bios *, u32 addr);
30 u32 nvbios_rd32(struct nvkm_bios *, u32 addr);
31 
32 int nvkm_bios_new(struct nvkm_device *, int, struct nvkm_bios **);
33 #endif
34