Merge "ARM: qca: Enabled config CONFIG_SYS_VSNPRINTF"
diff --git a/board/qca/arm/common/cmd_bootqca.c b/board/qca/arm/common/cmd_bootqca.c
index 0e01553..95353de 100644
--- a/board/qca/arm/common/cmd_bootqca.c
+++ b/board/qca/arm/common/cmd_bootqca.c
@@ -106,8 +106,7 @@
}
-static int do_dumpqca_data(cmd_tbl_t *cmdtp, int flag, int argc,
- char *const argv[])
+static int do_dumpqca_data(void)
{
char *serverip = NULL;
/* dump to root of TFTP server if none specified */
@@ -120,18 +119,12 @@
struct dumpinfo_t *dumpinfo = dumpinfo_n;
int dump_entries = dump_entries_n;
- if (argc == 2) {
- serverip = argv[1];
- printf("Using given serverip %s\n", serverip);
- setenv("serverip", serverip);
+ serverip = getenv("serverip");
+ if (serverip != NULL) {
+ printf("Using serverip from env %s\n", serverip);
} else {
- serverip = getenv("serverip");
- if (serverip != NULL) {
- printf("Using serverip from env %s\n", serverip);
- } else {
- printf("\nServer ip not found, run dhcp or configure\n");
- return CMD_RET_FAILURE;
- }
+ printf("\nServer ip not found, run dhcp or configure\n");
+ return CMD_RET_FAILURE;
}
ret = qca_scm_call(SCM_SVC_FUSE,
@@ -195,10 +188,6 @@
return CMD_RET_SUCCESS;
}
-U_BOOT_CMD(dumpipq_data, 2, 0, do_dumpqca_data,
- "dumpipq_data crashdump collection from memory",
- "dumpipq_data [serverip] - Crashdump collection from memory vi tftp\n");
-
/**
* Inovke the dump routine and in case of failure, do not stop unless the user
* requested to stop
@@ -208,7 +197,7 @@
{
uint64_t etime;
- if (run_command("dumpipq_data", 0) != CMD_RET_SUCCESS) {
+ if (do_dumpqca_data() != CMD_RET_SUCCESS) {
printf("\nAuto crashdump saving failed!"
"\nPress any key within 10s to take control of U-Boot");
@@ -393,20 +382,27 @@
*/
int soc_version = 0;
- const char *config = fdt_getprop(gd->fdt_blob, 0, "config_name", NULL);
+ const char *config = getenv("config_name");
- if(config == NULL) {
- printf("Failed to get config_name\n");
- return -1;
- }
+ if (config) {
+ printf("Manual device tree config selected!\n");
+ snprintf(dtb_config_name, strlen(dtb_config_name), config);
+ } else {
+ config = fdt_getprop(gd->fdt_blob, 0, "config_name", NULL);
- sprintf((char *)dtb_config_name, "%s", config);
+ if(config == NULL) {
+ printf("Failed to get config_name\n");
+ return -1;
+ }
- ipq_smem_get_socinfo_version((uint32_t *)&soc_version);
- if(SOCINFO_VERSION_MAJOR(soc_version) >= 2) {
- sprintf(dtb_config_name + strlen("config@"), "v%d.0-%s",
- SOCINFO_VERSION_MAJOR(soc_version),
- config + strlen("config@"));
+ sprintf((char *)dtb_config_name, "%s", config);
+
+ ipq_smem_get_socinfo_version((uint32_t *)&soc_version);
+ if(SOCINFO_VERSION_MAJOR(soc_version) >= 2) {
+ sprintf(dtb_config_name + strlen("config@"), "v%d.0-%s",
+ SOCINFO_VERSION_MAJOR(soc_version),
+ config + strlen("config@"));
+ }
}
if (fit_conf_get_node((void *)addr, dtb_config_name) >= 0) {