Skip to contentSkip to conversation

tools/intel_bios_reader: Print the child dev handle

PATCH New [email protected] 1 participant 3 messages Sep 11, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 tools/intel_bios_reader: Print the child dev handle

From: Ville Syrjälä <[email protected]>

---
 tools/intel_bios.h        |  8 ++++++++
 tools/intel_bios_reader.c | 28 ++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
tools/intel_bios.h +8 -0
index 64e723d..cd6abf9 100644
@@ -134,6 +134,14 @@ struct bdb_general_features {
 #define	GPIO_PIN_ADD_DDC	0x04	/* "ADDCARD DDC GPIO pins" */
 #define	GPIO_PIN_ADD_DDC_I2C	0x06	/* "ADDCARD DDC/I2C GPIO pins" */
 
+#define DEVICE_HANDLE_CRT	0x01
+#define DEVICE_HANDLE_EFP1	0x04
+#define DEVICE_HANDLE_EFP2	0x40
+#define DEVICE_HANDLE_EFP3	0x20
+#define DEVICE_HANDLE_EFP4	0x10
+#define DEVICE_HANDLE_LPF1	0x08
+#define DEVICE_HANDLE_LFP2	0x80
+
 /* Pre 915 */
 #define DEVICE_TYPE_NONE	0x00
 #define DEVICE_TYPE_CRT		0x01
tools/intel_bios_reader.c +28 -0
index bb6139e..19c988b 100644
@@ -255,6 +255,32 @@ static const char *child_device_type(unsigned short type)
 }
 
 static const struct {
+	unsigned char handle;
+	const char *name;
+} child_device_handles[] = {
+	{ DEVICE_HANDLE_CRT, "CRT" },
+	{ DEVICE_HANDLE_EFP1, "EFP 1 (HDMI/DVI/DP)" },
+	{ DEVICE_HANDLE_EFP2, "EFP 2 (HDMI/DVI/DP)" },
+	{ DEVICE_HANDLE_EFP3, "EFP 3 (HDMI/DVI/DP)" },
+	{ DEVICE_HANDLE_EFP4, "EFP 4 (HDMI/DVI/DP)" },
+	{ DEVICE_HANDLE_LPF1, "LFP 1 (eDP)" },
+	{ DEVICE_HANDLE_LFP2, "LFP 2 (eDP)" },
+};
+static const int num_child_device_handles =
+	sizeof(child_device_handles) / sizeof(child_device_handles[0]);
+
+static const char *child_device_handle(unsigned char handle)
+{
+	int i;
+
+	for (i = 0; i < num_child_device_handles; i++)
+		if (child_device_handles[i].handle == handle)
+			return child_device_handles[i].name;
+
+	return "unknown";
+}
+
+static const struct {
 	unsigned short type;
 	const char *name;
 } efp_ports[] = {
@@ -324,6 +350,8 @@ static void dump_child_device(struct child_device_config *child)
 		struct efp_child_device_config *efp =
 			(struct efp_child_device_config *)child;
 		printf("\tEFP device info:\n");
+		printf("\t\tDevice handle: 0x%04x (%s)\n", efp->handle,
+		       child_device_handle(efp->handle));
 		printf("\t\tDevice type: 0x%04x (%s)\n", efp->device_type,
 		       child_device_type(efp->device_type));
 		printf("\t\tPort: 0x%02x (%s)\n", efp->port,
Signature · 6 lines
2.4.6

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 2/3 tools/intel_bios_reader: Decode the device type bits

From: Ville Syrjälä <[email protected]>

Each bit in the device type is supposed to mean something. Decode their meaning.

---
 tools/intel_bios.h        | 18 ++++++++++++++++++
 tools/intel_bios_reader.c | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)
tools/intel_bios.h +18 -0
index cd6abf9..a97797f 100644
@@ -142,6 +142,24 @@ struct bdb_general_features {
 #define DEVICE_HANDLE_LPF1	0x08
 #define DEVICE_HANDLE_LFP2	0x80
 
+/* device type bits */
+#define DEVICE_TYPE_CLASS_EXTENSION	15
+#define DEVICE_TYPE_POWER_MANAGEMENT	14
+#define DEVICE_TYPE_HOTPLUG_SIGNALING	13
+#define DEVICE_TYPE_INTERNAL_CONNECTOR	12
+#define DEVICE_TYPE_NOT_HDMI_OUTPUT	11
+#define DEVICE_TYPE_MIPI_OUTPUT		10
+#define DEVICE_TYPE_COMPOSITE_OUTPUT	9
+#define DEVICE_TYPE_DIAL_CHANNEL	8
+#define DEVICE_TYPE_CONTENT_PROTECTION	7
+#define DEVICE_TYPE_HIGH_SPEED_LINK	6
+#define DEVICE_TYPE_LVDS_SIGNALING	5
+#define DEVICE_TYPE_TMDS_DVI_SIGNALING	4
+#define DEVICE_TYPE_VIDEO_SIGNALING	3
+#define DEVICE_TYPE_DISPLAYPORT_OUTPUT	2
+#define DEVICE_TYPE_DIGITAL_OUTPUT	1
+#define DEVICE_TYPE_ANALOG_OUTPUT	0
+
 /* Pre 915 */
 #define DEVICE_TYPE_NONE	0x00
 #define DEVICE_TYPE_CRT		0x01
tools/intel_bios_reader.c +32 -0
index 19c988b..459b547 100644
@@ -254,6 +254,37 @@ static const char *child_device_type(unsigned short type)
 	return "unknown";
 }
 
+static const char * const child_device_type_bits[] = {
+	[DEVICE_TYPE_CLASS_EXTENSION] = "Class extension",
+	[DEVICE_TYPE_POWER_MANAGEMENT] = "Power management",
+	[DEVICE_TYPE_HOTPLUG_SIGNALING] = "Hotplug signaling",
+	[DEVICE_TYPE_INTERNAL_CONNECTOR] = "Internal connector",
+	[DEVICE_TYPE_NOT_HDMI_OUTPUT] = "HDMI output", /* decoded as inverse */
+	[DEVICE_TYPE_MIPI_OUTPUT] = "MIPI output",
+	[DEVICE_TYPE_COMPOSITE_OUTPUT] = "Composite output",
+	[DEVICE_TYPE_DIAL_CHANNEL] = "Dual channel",
+	[DEVICE_TYPE_CONTENT_PROTECTION] = "Content protection",
+	[DEVICE_TYPE_HIGH_SPEED_LINK] = "High speel link",
+	[DEVICE_TYPE_LVDS_SIGNALING] = "LVDS signaling",
+	[DEVICE_TYPE_TMDS_DVI_SIGNALING] = "TMDS/DVI signaling",
+	[DEVICE_TYPE_VIDEO_SIGNALING] = "Video signaling",
+	[DEVICE_TYPE_DISPLAYPORT_OUTPUT] = "DisplayPort output",
+	[DEVICE_TYPE_DIGITAL_OUTPUT] = "Digital output",
+	[DEVICE_TYPE_ANALOG_OUTPUT] = "Analog output",
+};
+
+static void dump_child_device_type_bits(uint16_t type)
+{
+	int bit;
+
+	type ^= 1 << DEVICE_TYPE_NOT_HDMI_OUTPUT;
+
+	for (bit = 15; bit >= 0; bit--) {
+		if (type & (1 << bit))
+			printf("\t\t\t%s\n", child_device_type_bits[bit]);
+	}
+}
+
 static const struct {
 	unsigned char handle;
 	const char *name;
@@ -354,6 +385,7 @@ static void dump_child_device(struct child_device_config *child)
 		       child_device_handle(efp->handle));
 		printf("\t\tDevice type: 0x%04x (%s)\n", efp->device_type,
 		       child_device_type(efp->device_type));
+		dump_child_device_type_bits(efp->device_type);
 		printf("\t\tPort: 0x%02x (%s)\n", efp->port,
 		       efp_port(efp->port));
 		printf("\t\tDDC pin: 0x%02x\n", efp->ddc_pin);
Signature · 6 lines
2.4.6

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH 3/3 tools/intel_bios_reader: Add MIPI device type

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

Decode the MIPI [sic] device type.

---
 tools/intel_bios.h        | 1 +
 tools/intel_bios_reader.c | 1 +
 2 files changed, 2 insertions(+)
tools/intel_bios.h +1 -0
index a97797f..6135a2b 100644
@@ -197,6 +197,7 @@ struct bdb_general_features {
 #define DEVICE_TYPE_HDMI_DVI		0x60d2
 #define DEVICE_TYPE_DVI			0x68d2
 #define DEVICE_TYPE_eDP			0x78C6
+#define DEVICE_TYPE_MIPI		0x7cc2
 
 #define DEVICE_CFG_NONE		0x00
 #define DEVICE_CFG_12BIT_DVOB	0x01
tools/intel_bios_reader.c +1 -0
index 459b547..e308eaa 100644
@@ -239,6 +239,7 @@ static const struct {
 	{ DEVICE_TYPE_HDMI_DVI, "HDMI/DVI" },
 	{ DEVICE_TYPE_DVI, "DVI" },
 	{ DEVICE_TYPE_eDP, "eDP" },
+	{ DEVICE_TYPE_MIPI, "MIPI" },
 };
 static const int num_child_device_types =
 	sizeof(child_device_types) / sizeof(child_device_types[0]);
Signature · 6 lines
2.4.6

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx