summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 712b6d2)
raw | patch | inline | side by side (parent: 712b6d2)
author | Lokesh Vutla <lokeshvutla@ti.com> | |
Wed, 11 Sep 2019 08:17:46 +0000 (13:47 +0530) | ||
committer | Lokesh Vutla <lokeshvutla@ti.com> | |
Wed, 11 Sep 2019 08:46:53 +0000 (14:16 +0530) |
User might want to spoof a host_id than using the default
host id. So provide a command line argument to pass host id.
Be careful while using this argument, firewalls are enabled.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
host id. So provide a command line argument to pass host id.
Be careful while using this argument, firewalls are enabled.
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
common/help.c | patch | blob | history | |
common/k3conf.c | patch | blob | history | |
common/socinfo.c | patch | blob | history | |
include/socinfo.h | patch | blob | history |
diff --git a/common/help.c b/common/help.c
index 078f5a2ab1eb23aa303e88fab2a1b28779b762b3..92ec38076799fe4b7ee4b57b1a21bca0557dd961 100644 (file)
--- a/common/help.c
+++ b/common/help.c
printf("\tk3conf - TI K3 Configuration Diagnostic Tool\n");
printf("\nSYNOPSIS\n");
- printf("\tk3conf [--version] [--help] [--cpuinfo] <command> [<args>]\n");
+ printf("\tk3conf [--host <id>] [--version] [--help] [--cpuinfo] <command> [<args>]\n");
if (cat == HELP_USAGE)
printf("\n\tSee 'k3conf --help' for more information.\n\n");
}
" to any other area.\n");
printf("\nOPTIONS\n");
+ printf("\t--host <id>\n");
+ printf("\t Use this host id for communicating with sysfw\n\n");
+
printf("\t--help\n");
printf("\t Print k3conf help.\n");
diff --git a/common/k3conf.c b/common/k3conf.c
index 0e068c14cfc9993e1d4d9c095ec320509e1515d2..d95a950c2a19e22a1ac6fc2ac111753564748499 100644 (file)
--- a/common/k3conf.c
+++ b/common/k3conf.c
#include <autoadjust_table.h>
#include <k3conf.h>
+#ifdef DEBUG
+#define dprintf(format, ...) printf(format, ## __VA_ARGS__)
+#else
+#define dprintf(format, ...)
+#endif
+
void k3conf_print_version(FILE *stream)
{
char table[TABLE_MAX_ROW][TABLE_MAX_COL][TABLE_MAX_ELT_LEN];
int main(int argc, char *argv[])
{
+ uint32_t host_id;
int ret = 0;
/* Scan user arguments for options */
goto main_exit;
}
- if (soc_init())
+ host_id = DEFAULT_HOST_ID;
+ if (!strcmp(argv[0], "--host")) {
+ argc--; argv++;
+ ret = sscanf(argv[0], "%u", &host_id);
+ if (ret != 1) {
+ fprintf(stderr, "Invalid host id %s\n", argv[0]);
+ return -1;
+ }
+ dprintf("%s: host_id from user = %d\n", __func__,
+ soc_info.host_id);
+ argc--; argv++;
+ }
+
+ if (soc_init(host_id))
goto main_exit;
if (!strcmp(argv[0], "--help")) {
diff --git a/common/socinfo.c b/common/socinfo.c
index d2b60d8fccb8735bcc14305383424e4eac00eae1..0d96a6b813a627ce0a6aaf234809787a6e374195 100644 (file)
--- a/common/socinfo.c
+++ b/common/socinfo.c
sci_info->num_clocks = J721E_MAX_CLOCKS;
}
-int soc_init(void)
+int soc_init(uint32_t host_id)
{
memset(&soc_info, 0, sizeof(soc_info));
strcat(soc_info.soc_full_name, " PG");
strcat(soc_info.soc_full_name, soc_revision[soc_info.rev]);
- soc_info.host_id = DEFAULT_HOST_ID;
+ soc_info.host_id = host_id;
if (soc_info.soc == AM654)
am654_init();
diff --git a/include/socinfo.h b/include/socinfo.h
index 719e8f55fae38c52ce2d642baa251ba3585294c5..be0293298d36b9af4e990b026f46deef66624004 100644 (file)
--- a/include/socinfo.h
+++ b/include/socinfo.h
};
extern struct k3conf_soc_info soc_info;
-int soc_init(void);
+int soc_init(uint32_t host_id);
int soc_is_j721e(void);
int soc_is_am654(void);