[PATCH 3/3] Dump MTS information by bct_dump utility.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The MTS is only for Tegra132 now.

Signed-off-by: Vince Hsu <vinceh@xxxxxxxxxx>
---
 src/bct_dump.c | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/src/bct_dump.c b/src/bct_dump.c
index 6735c355761a..4e8cb42b1dce 100644
--- a/src/bct_dump.c
+++ b/src/bct_dump.c
@@ -73,6 +73,16 @@ static value_data const bl_values[] = {
 	{ token_bl_attribute,   "Attributes   = ", format_u32_hex8 },
 };
 
+static value_data const mts_values[] = {
+	{ token_mts_info_version,      "Version      = ", format_u32_hex8 },
+	{ token_mts_info_start_block,  "Start block  = ", format_u32 },
+	{ token_mts_info_start_page,   "Start page   = ", format_u32 },
+	{ token_mts_info_length,       "Length       = ", format_u32 },
+	{ token_mts_info_load_address, "Load address = ", format_u32_hex8 },
+	{ token_mts_info_entry_point,  "Entry point  = ", format_u32_hex8 },
+	{ token_mts_info_attribute,    "Attributes   = ", format_u32_hex8 },
+};
+
 /*****************************************************************************/
 static void format_u32_hex8(char const * message, void * data)
 {
@@ -177,6 +187,7 @@ int main(int argc, char *argv[])
 	u_int32_t bootloaders_used;
 	u_int32_t parameters_used;
 	u_int32_t sdram_used;
+	u_int32_t mts_used;
 	nvboot_dev_type type;
 	param_types data;
 	int i;
@@ -234,6 +245,35 @@ int main(int argc, char *argv[])
 		}
 	}
 
+	/* Display mts values */
+	e = g_soc_config->get_value(token_mts_used,
+				     &mts_used,
+				     context.bct);
+
+	if ((e == 0) && (mts_used> 0)) {
+		int mts_count = sizeof(mts_values) / sizeof(mts_values[0]);
+
+		printf("#\n"
+		       "# These values are set by cbootimage using the\n"
+		       "# mts provided by the Mts=... or MtsPreboot=...\n"
+		       "# configuration option.\n"
+		       "#\n");
+
+		for (i = 0; i < mts_used; ++i) {
+			for (j = 0; j < mts_count; ++j) {
+				e = g_soc_config->get_mts_info(&context,
+								   i,
+							       mts_values[j].id,
+							       &(data.val));
+				printf("# Mts[%d].", i);
+
+				if (e)
+					data.val = -1;
+
+				mts_values[j].format(mts_values[j].message, &data);
+			}
+		}
+	}
 	/* Display flash device parameters */
 	e = g_soc_config->get_value(token_num_param_sets,
 				     &parameters_used,
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux