Skip to contentSkip to conversation

intel_opregion_decode: add new ASLE fields

PATCH In review Jani Nikula 1 participant 6 messages Dec 21, 2015 – Dec 22, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 intel_opregion_decode: add new ASLE fields

---
 tools/intel_opregion_decode.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/intel_opregion_decode.c +5 -1
index b19566108ed7..c65828ae2900 100644
@@ -122,7 +122,9 @@ struct opregion_asle {
 	uint8_t fdss[8];
 	uint32_t fdsp;
 	uint32_t stat;
-	uint8_t rsvd[86];
+	uint64_t rvda;		/* Physical address of raw vbt data */
+	uint32_t rvds;		/* Size of raw vbt data */
+	uint8_t rsvd[58];
 } __attribute__((packed));
 
 /* OpRegion mailbox #4: VBT */
@@ -308,6 +310,8 @@ static void decode_asle(const void *buffer)
 
 	printf("\tfdsp:\t0x%08x\n", asle->fdsp);
 	printf("\tstat:\t0x%08x\n", asle->stat);
+	printf("\trvda:\t0x%016lx\n", asle->rvda);
+	printf("\trvds:\t0x%08x\n", asle->rvds);
 
 	printf("\n");
 }
Signature · 6 lines
2.1.4

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

PATCH 2/5 intel_bios_reader: check mipi sequence block version

Bail out on v3+, we don't support that just yet.

---
 tools/intel_bios_reader.c | 5 +++++
 1 file changed, 5 insertions(+)
tools/intel_bios_reader.c +5 -0
index e308eaa081d6..09ca50d44a77 100644
@@ -1036,6 +1036,11 @@ static void dump_mipi_sequence(const struct bdb_block *block)
 		return;
 	}
 
+	printf("\tSequence block version v%u\n", sequence->version);
+
+	if (sequence->version >= 3)
+		return;
+
 	block_size = get_blocksize(sequence);
 
 	/*
Signature · 6 lines
2.1.4

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

PATCH 3/5 intel_bios_reader: rewrite the mipi sequence block dumping

In reply to Jani Nikula

Simplify things a lot, make it correct, don't pass random pointers to free() on errors, etc.

---
 tools/intel_bios.h        |  19 ++--
 tools/intel_bios_reader.c | 224 +++++++++++++---------------------------------
 2 files changed, 78 insertions(+), 165 deletions(-)
tools/intel_bios.h +14 -5
index 6135a2b47055..b7ebd48ef7e7 100644
@@ -763,22 +763,31 @@ struct bdb_mipi_sequence {
 	uint8_t data[0];
 } __attribute__ ((packed));
 
-/* MIPI Sequnece Block definitions */
-enum MIPI_SEQ {
-	MIPI_SEQ_UNDEFINED = 0,
+/* MIPI Sequence Block definitions */
+enum mipi_seq {
+	MIPI_SEQ_END = 0,
 	MIPI_SEQ_ASSERT_RESET,
 	MIPI_SEQ_INIT_OTP,
 	MIPI_SEQ_DISPLAY_ON,
 	MIPI_SEQ_DISPLAY_OFF,
 	MIPI_SEQ_DEASSERT_RESET,
+	MIPI_SEQ_BACKLIGHT_ON,		/* sequence block v2+ */
+	MIPI_SEQ_BACKLIGHT_OFF,		/* sequence block v2+ */
+	MIPI_SEQ_TEAR_ON,		/* sequence block v2+ */
+	MIPI_SEQ_TEAR_OFF,		/* sequence block v3+ */
+	MIPI_SEQ_POWER_ON,		/* sequence block v3+ */
+	MIPI_SEQ_POWER_OFF,		/* sequence block v3+ */
 	MIPI_SEQ_MAX
 };
 
-enum MIPI_SEQ_ELEMENT {
-	MIPI_SEQ_ELEM_UNDEFINED = 0,
+enum mipi_seq_element {
+	MIPI_SEQ_ELEM_END = 0,
 	MIPI_SEQ_ELEM_SEND_PKT,
 	MIPI_SEQ_ELEM_DELAY,
 	MIPI_SEQ_ELEM_GPIO,
+	MIPI_SEQ_ELEM_I2C,		/* sequence block v2+ */
+	MIPI_SEQ_ELEM_SPI,		/* sequence block v3+ */
+	MIPI_SEQ_ELEM_PMIC,		/* sequence block v3+ */
 	MIPI_SEQ_ELEM_MAX
 };
 
tools/intel_bios_reader.c +64 -160

308 lines not on this page · raw message

Signature · 6 lines
2.1.4

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

PATCH 4/5 intel_bios_reader: improve element dumpers

In reply to Jani Nikula

Try to print something useful and helpful for the user.

---
 tools/intel_bios_reader.c | 43 ++++++++++++++++++++++++-------------------
 1 file changed, 24 insertions(+), 19 deletions(-)
tools/intel_bios_reader.c +24 -19
index 1b1cb6bc8ebf..7c3e1bcaa387 100644
@@ -851,41 +851,46 @@ static void dump_mipi_config(const struct bdb_block *block)
 
 static const uint8_t *mipi_dump_send_packet(const uint8_t *data)
 {
-	uint8_t type, byte, count;
-	uint16_t len;
+	uint8_t flags, type;
+	uint16_t len, i;
 
-	byte = *data++;
-	/* get packet type and increment the pointer */
+	flags = *data++;
 	type = *data++;
-
 	len = *((uint16_t *) data);
 	data += 2;
-	printf("\t\t SEND COMMAND: ");
-	printf("0x%x 0x%x 0x%x", byte, type, len);
-	for (count = 0; count < len; count++)
-		printf(" 0x%x",*(data+count));
+
+	printf("\t\tSend DCS: Port %s, VC %d, %s, Type %02x, Length %u, Data",
+	       (flags >> 3) & 1 ? "C" : "A",
+	       (flags >> 1) & 3,
+	       flags & 1 ? "HS" : "LP",
+	       type,
+	       len);
+	for (i = 0; i < len; i++)
+		printf(" %02x", *data++);
 	printf("\n");
-	data += len;
+
 	return data;
 }
 
 static const uint8_t *mipi_dump_delay(const uint8_t *data)
 {
-	printf("\t\t Delay : 0x%x 0x%x 0x%x 0x%x\n", data[0], data[1], data[2], data[3]);
-	data += 4;
-	return data;
+	printf("\t\tDelay: %u us\n", *((const uint32_t *)data));
+
+	return data + 4;
 }
 
 static const uint8_t *mipi_dump_gpio(const uint8_t *data)
 {
-	uint8_t gpio, action;
+	uint8_t index, flags;
+
+	index = *data++;
+	flags = *data++;
 
-	printf("\t\t GPIO value:");
-	gpio = *data++;
+	printf("\t\tGPIO index %u, source %d, set %d\n",
+	       index,
+	       (flags >> 1) & 3,
+	       flags & 1);
 
-	/* pull up/down */
-	action = *data++;
-	printf(" 0x%x 0x%x\n", gpio, action);
 	return data;
 }
 
Signature · 6 lines
2.1.4

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

PATCH 5/5 intel_bios_reader: add dumping of i2c element in mipi sequence

In reply to Jani Nikula

Due to the clever way the whole sequence block is specified without forward compatibility, it's not possible to dump most blocks without this.

---
 tools/intel_bios_reader.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
tools/intel_bios_reader.c +23 -0
index 7c3e1bcaa387..b31f648f0607 100644
@@ -894,12 +894,35 @@ static const uint8_t *mipi_dump_gpio(const uint8_t *data)
 	return data;
 }
 
+static const uint8_t *mipi_dump_i2c(const uint8_t *data)
+{
+	uint8_t flags, index, bus, offset, len, i;
+	uint16_t address;
+
+	flags = *data++;
+	index = *data++;
+	bus = *data++;
+	address = *((uint16_t *) data);
+	data += 2;
+	offset = *data++;
+	len = *data++;
+
+	printf("\t\tSend I2C: Flags %02x, Index %02x, Bus %02x, Address %04x, Offset %02x, Length %u, Data",
+	       flags, index, bus, address, offset, len);
+	for (i = 0; i < len; i++)
+		printf(" %02x", *data++);
+	printf("\n");
+
+	return data;
+}
+
 typedef const uint8_t * (*fn_mipi_elem_dump)(const uint8_t *data);
 
 static const fn_mipi_elem_dump dump_elem[] = {
 	[MIPI_SEQ_ELEM_SEND_PKT] = mipi_dump_send_packet,
 	[MIPI_SEQ_ELEM_DELAY] = mipi_dump_delay,
 	[MIPI_SEQ_ELEM_GPIO] = mipi_dump_gpio,
+	[MIPI_SEQ_ELEM_I2C] = mipi_dump_i2c,
 };
 
 static const char * const seq_name[] = {
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw
In reply to Jani Nikula

I don't expect anyone to be interested, so I pushed the lot.

BR,
Jani.

Quoted 29 lines · Jani Nikula
---
 tools/intel_opregion_decode.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tools/intel_opregion_decode.c +5 -1
index b19566108ed7..c65828ae2900 100644
@@ -122,7 +122,9 @@ struct opregion_asle {
 	uint8_t fdss[8];
 	uint32_t fdsp;
 	uint32_t stat;
-	uint8_t rsvd[86];
+	uint64_t rvda;		/* Physical address of raw vbt data */
+	uint32_t rvds;		/* Size of raw vbt data */
+	uint8_t rsvd[58];
 } __attribute__((packed));
 
 /* OpRegion mailbox #4: VBT */
@@ -308,6 +310,8 @@ static void decode_asle(const void *buffer)
 
 	printf("\tfdsp:\t0x%08x\n", asle->fdsp);
 	printf("\tstat:\t0x%08x\n", asle->stat);
+	printf("\trvda:\t0x%016lx\n", asle->rvda);
+	printf("\trvds:\t0x%08x\n", asle->rvds);
 
 	printf("\n");
 }
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx