Commit b3389285 authored by Laxman's avatar Laxman Committed by Bjorn Andersson
Browse files

firehose: support for emmc storage



Added qdl support for emmc storage on platforms with UFS support.  Use
option --s emmc or ufs as a argument to qdl command, if not specified
any option the default storage would be ufs
Tested-by: default avatarNicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: default avatarLaxman <itsmelaxman91@gmail.com>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent dc61f8f7
......@@ -265,7 +265,7 @@ static int firehose_configure_response_parser(xmlNode *node)
return max_size;
}
static int firehose_send_configure(int fd, size_t payload_size, bool skip_storage_init)
static int firehose_send_configure(int fd, size_t payload_size, bool skip_storage_init, const char *storage)
{
xmlNode *root;
xmlNode *node;
......@@ -277,7 +277,7 @@ static int firehose_send_configure(int fd, size_t payload_size, bool skip_storag
xmlDocSetRootElement(doc, root);
node = xmlNewChild(root, NULL, (xmlChar*)"configure", NULL);
xml_setpropf(node, "MemoryName", "ufs");
xml_setpropf(node, "MemoryName", storage);
xml_setpropf(node, "MaxPayloadSizeToTargetInBytes", "%d", payload_size);
xml_setpropf(node, "verbose", "%d", 0);
xml_setpropf(node, "ZLPAwareHost", "%d", 0);
......@@ -291,17 +291,17 @@ static int firehose_send_configure(int fd, size_t payload_size, bool skip_storag
return firehose_read(fd, -1, firehose_configure_response_parser);
}
static int firehose_configure(int fd, bool skip_storage_init)
static int firehose_configure(int fd, bool skip_storage_init, const char *storage)
{
int ret;
ret = firehose_send_configure(fd, max_payload_size, skip_storage_init);
ret = firehose_send_configure(fd, max_payload_size, skip_storage_init, storage);
if (ret < 0)
return ret;
/* Retry if remote proposed different size */
if (ret != max_payload_size) {
ret = firehose_send_configure(fd, ret, skip_storage_init);
ret = firehose_send_configure(fd, ret, skip_storage_init, storage);
if (ret < 0)
return ret;
......@@ -601,7 +601,7 @@ static int firehose_reset(int fd)
return firehose_read(fd, -1, firehose_nop_parser);
}
int firehose_run(int fd, const char *incdir)
int firehose_run(int fd, const char *incdir, const char *storage)
{
int bootable;
int ret;
......@@ -618,7 +618,7 @@ int firehose_run(int fd, const char *incdir)
return ret;
if(ufs_need_provisioning()) {
ret = firehose_configure(fd, true);
ret = firehose_configure(fd, true, storage);
if (ret)
return ret;
ret = ufs_provisioning_execute(fd, firehose_apply_ufs_common,
......@@ -630,7 +630,7 @@ int firehose_run(int fd, const char *incdir)
return ret;
}
ret = firehose_configure(fd, false);
ret = firehose_configure(fd, false, storage);
if (ret)
return ret;
......
......@@ -220,14 +220,14 @@ static void print_usage(void)
{
extern const char *__progname;
fprintf(stderr,
"%s [--debug] [--finalize-provisioning] [--include <PATH>] <prog.mbn> [<program> <patch> ...]\n",
"%s [--debug] [--storage <emmc|ufs>] [--finalize-provisioning] [--include <PATH>] <prog.mbn> [<program> <patch> ...]\n",
__progname);
}
int main(int argc, char **argv)
{
struct termios tios;
char *prog_mbn;
char *prog_mbn, *storage="ufs";
char *incdir = NULL;
int type;
int ret;
......@@ -240,6 +240,7 @@ int main(int argc, char **argv)
{"debug", no_argument, 0, 'd'},
{"include", required_argument, 0, 'i'},
{"finalize-provisioning", no_argument, 0, 'l'},
{"storage", required_argument, 0, 's'},
{0, 0, 0, 0}
};
......@@ -254,6 +255,9 @@ int main(int argc, char **argv)
case 'l':
qdl_finalize_provisioning = true;
break;
case 's':
storage = optarg;
break;
default:
print_usage();
return 1;
......@@ -303,7 +307,7 @@ int main(int argc, char **argv)
if (ret < 0)
goto out;
ret = firehose_run(fd, incdir);
ret = firehose_run(fd, incdir, storage);
out:
ret = tcsetattr(fd, TCSANOW, &tios);
......
......@@ -7,7 +7,7 @@
#include "program.h"
#include <libxml/tree.h>
int firehose_run(int fd, const char *incdir);
int firehose_run(int fd, const char *incdir, const char *storage);
int sahara_run(int fd, char *prog_mbn);
void print_hex_dump(const char *prefix, const void *buf, size_t len);
unsigned attr_as_unsigned(xmlNode *node, const char *attr, int *errors);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment