public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Vince Hsu <vinceh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: AMartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
	swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org,
	TWarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
	vinceh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [cbootimage PATCH V3 3/3] Dump MTS information by bct_dump utility.
Date: Wed, 16 Jul 2014 10:37:17 +0800	[thread overview]
Message-ID: <1405478237-19178-3-git-send-email-vinceh@nvidia.com> (raw)
In-Reply-To: <1405478237-19178-1-git-send-email-vinceh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

The MTS is only for Tegra132 now.

Signed-off-by: Vince Hsu <vinceh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Acked-by: Allen Martin <amartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

---
Changes from v2:
	- Add ack from Allen
Changes from v1:
	- Rename start_block/load_address as start_blk/load_addr
---
---
 src/bct_dump.c | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/src/bct_dump.c b/src/bct_dump.c
index 6735c355761a..e2181b251ff9 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_blk,    "Start block  = ", format_u32 },
+	{ token_mts_info_start_page,   "Start page   = ", format_u32 },
+	{ token_mts_info_length,       "Length       = ", format_u32 },
+	{ token_mts_info_load_addr,    "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

  parent reply	other threads:[~2014-07-16  2:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16  2:37 [cbootimage PATCH V3 1/3] Rename last_bl_blk to last_blk Vince Hsu
     [not found] ` <1405478237-19178-1-git-send-email-vinceh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-07-16  2:37   ` [cbootimage PATCH V3 2/3] Add Tegra132 support for the cbootimage utility Vince Hsu
     [not found]     ` <1405478237-19178-2-git-send-email-vinceh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-07-16  4:18       ` Allen Martin
2014-07-16  2:37   ` Vince Hsu [this message]
2014-07-16  4:58   ` [cbootimage PATCH V3 1/3] Rename last_bl_blk to last_blk Allen Martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1405478237-19178-3-git-send-email-vinceh@nvidia.com \
    --to=vinceh-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
    --cc=AMartin-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=TWarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox