[Nouveau] [PATCH v2 3/7] volt: parse the boost voltage entry

Karol Herbst nouveau at karolherbst.de
Wed Dec 2 08:24:30 PST 2015


---
 drm/nouveau/include/nvkm/subdev/bios/vmap.h | 1 +
 drm/nouveau/include/nvkm/subdev/volt.h      | 2 ++
 drm/nouveau/nvkm/subdev/bios/vmap.c         | 5 ++++-
 drm/nouveau/nvkm/subdev/volt/base.c         | 8 ++++++++
 4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/drm/nouveau/include/nvkm/subdev/bios/vmap.h b/drm/nouveau/include/nvkm/subdev/bios/vmap.h
index 6633c6d..1e170c7 100644
--- a/drm/nouveau/include/nvkm/subdev/bios/vmap.h
+++ b/drm/nouveau/include/nvkm/subdev/bios/vmap.h
@@ -1,6 +1,7 @@
 #ifndef __NVBIOS_VMAP_H__
 #define __NVBIOS_VMAP_H__
 struct nvbios_vmap {
+	u8  boost;
 };
 
 u16 nvbios_vmap_table(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len);
diff --git a/drm/nouveau/include/nvkm/subdev/volt.h b/drm/nouveau/include/nvkm/subdev/volt.h
index 32c1a22..085f65f 100644
--- a/drm/nouveau/include/nvkm/subdev/volt.h
+++ b/drm/nouveau/include/nvkm/subdev/volt.h
@@ -15,6 +15,8 @@ struct nvkm_volt {
 
 	u32 max_voltage;
 	u32 min_voltage;
+
+	u32 boost_max_voltage;
 };
 
 int nvkm_volt_map(struct nvkm_volt *volt, u8 id);
diff --git a/drm/nouveau/nvkm/subdev/bios/vmap.c b/drm/nouveau/nvkm/subdev/bios/vmap.c
index 2f13db7..9b0ab33 100644
--- a/drm/nouveau/nvkm/subdev/bios/vmap.c
+++ b/drm/nouveau/nvkm/subdev/bios/vmap.c
@@ -60,8 +60,11 @@ nvbios_vmap_parse(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len,
 	u16 vmap = nvbios_vmap_table(bios, ver, hdr, cnt, len);
 	memset(info, 0x00, sizeof(*info));
 	switch (!!vmap * *ver) {
-	case 0x10:
 	case 0x20:
+		info->boost = nvbios_rd08(bios, vmap + 0x7);
+		break;
+	case 0x10:
+		info->boost = 0xff;
 		break;
 	}
 	return vmap;
diff --git a/drm/nouveau/nvkm/subdev/volt/base.c b/drm/nouveau/nvkm/subdev/volt/base.c
index 7104168..763ec0b 100644
--- a/drm/nouveau/nvkm/subdev/volt/base.c
+++ b/drm/nouveau/nvkm/subdev/volt/base.c
@@ -194,8 +194,16 @@ nvkm_volt_ctor(const struct nvkm_volt_func *func, struct nvkm_device *device,
 
 	/* Assuming the non-bios device should build the voltage table later */
 	if (bios) {
+		u8 ver, hdr, cnt, len;
+		struct nvbios_vmap vmap;
+
 		nvkm_volt_parse_bios(bios, volt);
 		nvkm_debug(&volt->subdev, "min: %iuv max: %iuv\n", volt->min_voltage, volt->max_voltage);
+
+		if (nvbios_vmap_parse(bios, &ver, &hdr, &cnt, &len, &vmap) && vmap.boost != 0xff) {
+			volt->boost_max_voltage = nvkm_volt_map(volt, vmap.boost);
+			nvkm_debug(&volt->subdev, "max boost voltage: %iuv\n", volt->boost_max_voltage);
+		}
 	}
 
 	if (volt->vid_nr) {
-- 
2.6.3



More information about the Nouveau mailing list