This source file includes following definitions.
- nvbios_ramcfg_strap
- nvbios_ramcfg_count
- nvbios_ramcfg_index
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #include <subdev/bios.h>
25 #include <subdev/bios/bit.h>
26 #include <subdev/bios/ramcfg.h>
27 #include <subdev/bios/M0203.h>
28
29 static u8
30 nvbios_ramcfg_strap(struct nvkm_subdev *subdev)
31 {
32 return (nvkm_rd32(subdev->device, 0x101000) & 0x0000003c) >> 2;
33 }
34
35 u8
36 nvbios_ramcfg_count(struct nvkm_bios *bios)
37 {
38 struct bit_entry bit_M;
39
40 if (!bit_entry(bios, 'M', &bit_M)) {
41 if (bit_M.version == 1 && bit_M.length >= 5)
42 return nvbios_rd08(bios, bit_M.offset + 2);
43 if (bit_M.version == 2 && bit_M.length >= 3)
44 return nvbios_rd08(bios, bit_M.offset + 0);
45 }
46
47 return 0x00;
48 }
49
50 u8
51 nvbios_ramcfg_index(struct nvkm_subdev *subdev)
52 {
53 struct nvkm_bios *bios = subdev->device->bios;
54 u8 strap = nvbios_ramcfg_strap(subdev);
55 u32 xlat = 0x00000000;
56 struct bit_entry bit_M;
57 struct nvbios_M0203E M0203E;
58 u8 ver, hdr;
59
60 if (!bit_entry(bios, 'M', &bit_M)) {
61 if (bit_M.version == 1 && bit_M.length >= 5)
62 xlat = nvbios_rd16(bios, bit_M.offset + 3);
63 if (bit_M.version == 2 && bit_M.length >= 3) {
64
65
66
67
68 if (bit_M.length >= 7 &&
69 nvbios_M0203Em(bios, strap, &ver, &hdr, &M0203E))
70 return M0203E.group;
71 xlat = nvbios_rd16(bios, bit_M.offset + 1);
72 }
73 }
74
75 if (xlat)
76 strap = nvbios_rd08(bios, xlat + strap);
77 return strap;
78 }