summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2017-08-25 16:10:53 +0300
committerJani Nikula <jani.nikula@intel.com>2017-08-29 17:26:19 +0300
commite1db4c4e0e708f01c63fc6c790059caed8153f14 (patch)
tree8e61d22886435606cd708d2c0d4df16b81be178c
parentdff8b304e3fcf1f3fe4103113240ab7a2a92d3ca (diff)
tools/intel_vbt_decode: migrate psr dumping to kernel struct
No functional changes. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r--tools/intel_bios.h15
-rw-r--r--tools/intel_vbt_decode.c26
-rw-r--r--tools/intel_vbt_defs.h18
3 files changed, 32 insertions, 27 deletions
diff --git a/tools/intel_bios.h b/tools/intel_bios.h
index 3f441a6d..f4b0b979 100644
--- a/tools/intel_bios.h
+++ b/tools/intel_bios.h
@@ -163,21 +163,6 @@ struct bdb_edp { /* 155 */
struct edp_full_link_params full_link_params[16]; /* 199 */
} __attribute__ ((packed));
-struct psr_params {
- uint8_t full_link:1;
- uint8_t require_aux_to_wakeup:1;
- uint8_t rsvd1:6;
- uint8_t idle_frames:4;
- uint8_t lines_to_wait:3;
- uint8_t rsvd2:1;
- uint16_t tp1_wakeup_time;
- uint16_t tp2_tp3_wakeup_time;
-} __attribute__ ((packed));
-
-struct bdb_psr {
- struct psr_params psr[16];
-} __attribute__ ((packed));
-
/* Block 52 contains MiPi Panel info
* 6 such enteries will there. Index into correct
* entery is based on the panel_index in #40 LFP
diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 4b3ec62a..8330b856 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -891,7 +891,7 @@ static void dump_edp(struct context *context,
static void dump_psr(struct context *context,
const struct bdb_block *block)
{
- const struct bdb_psr *psr = block->data;
+ const struct bdb_psr *psr_block = block->data;
int i;
/* The same block ID was used for something else before? */
@@ -899,41 +899,43 @@ static void dump_psr(struct context *context,
return;
for (i = 0; i < 16; i++) {
+ const struct psr_table *psr = &psr_block->psr_table[i];
+
if (i != context->panel_type && !context->dump_all_panel_types)
continue;
printf("\tPanel %d%s\n", i, context->panel_type == i ? " *" : "");
- printf("\t\tFull link: %s\n", YESNO(psr->psr[i].full_link));
- printf("\t\tRequire AUX to wakeup: %s\n", YESNO(psr->psr[i].require_aux_to_wakeup));
+ printf("\t\tFull link: %s\n", YESNO(psr->full_link));
+ printf("\t\tRequire AUX to wakeup: %s\n", YESNO(psr->require_aux_to_wakeup));
- switch (psr->psr[i].lines_to_wait) {
+ switch (psr->lines_to_wait) {
case 0:
case 1:
printf("\t\tLines to wait before link standby: %d\n",
- psr->psr[i].lines_to_wait);
+ psr->lines_to_wait);
break;
case 2:
case 3:
printf("\t\tLines to wait before link standby: %d\n",
- 1 << psr->psr[i].lines_to_wait);
+ 1 << psr->lines_to_wait);
break;
default:
printf("\t\tLines to wait before link standby: (unknown) (0x%x)\n",
- psr->psr[i].lines_to_wait);
+ psr->lines_to_wait);
break;
}
printf("\t\tIdle frames to for PSR enable: %d\n",
- psr->psr[i].idle_frames);
+ psr->idle_frames);
printf("\t\tTP1 wakeup time: %d usec (0x%x)\n",
- psr->psr[i].tp1_wakeup_time * 100,
- psr->psr[i].tp1_wakeup_time);
+ psr->tp1_wakeup_time * 100,
+ psr->tp1_wakeup_time);
printf("\t\tTP2/TP3 wakeup time: %d usec (0x%x)\n",
- psr->psr[i].tp2_tp3_wakeup_time * 100,
- psr->psr[i].tp2_tp3_wakeup_time);
+ psr->tp2_tp3_wakeup_time * 100,
+ psr->tp2_tp3_wakeup_time);
}
}
diff --git a/tools/intel_vbt_defs.h b/tools/intel_vbt_defs.h
index dcb6f364..a43ec2d1 100644
--- a/tools/intel_vbt_defs.h
+++ b/tools/intel_vbt_defs.h
@@ -671,7 +671,25 @@ struct bdb_driver_features {
#define EDP_VSWING_0_8V 2
#define EDP_VSWING_1_2V 3
+struct psr_table {
+ /* Feature bits */
+ u8 full_link:1;
+ u8 require_aux_to_wakeup:1;
+ u8 feature_bits_rsvd:6;
+
+ /* Wait times */
+ u8 idle_frames:4;
+ u8 lines_to_wait:3;
+ u8 wait_times_rsvd:1;
+
+ /* TP wake up time in multiple of 100 */
+ u16 tp1_wakeup_time;
+ u16 tp2_tp3_wakeup_time;
+} __packed;
+struct bdb_psr {
+ struct psr_table psr_table[16];
+} __packed;
/*
* Driver<->VBIOS interaction occurs through scratch bits in