Skip to content
Permalink
Browse files

sdp: bootcmd: add support for --dcdaddr

Allows the user to chose the DCD location in the bootcmd. This is
often the case when trying to upgrade a system that has already been
closed.

Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
  • Loading branch information
ldts authored and nxpfrankli committed Nov 25, 2019
1 parent a3e9f5b commit 003b6cb7a98ba36d78d591b5c1ef8e42423f1b90
Showing with 12 additions and 1 deletion.
  1. +5 −1 libuuu/sdp.cpp
  2. +7 −0 libuuu/sdp.h
@@ -101,7 +101,7 @@ int SDPDcdCmd::run(CmdCtx*ctx)
uint32_t size = (pdcd[1] << 8) | pdcd[2];

m_spdcmd.m_cmd = ROM_KERNEL_CMD_DCD_WRITE;
m_spdcmd.m_addr = EndianSwap(rom->free_addr);
m_spdcmd.m_addr = EndianSwap(m_dcd_addr ? m_dcd_addr : rom->free_addr);
m_spdcmd.m_count = EndianSwap(size);

HIDTrans dev;
@@ -142,6 +142,10 @@ int SDPBootCmd::run(CmdCtx *ctx)
string str;
str = "SDP: dcd -f ";
str += m_filename;
if (m_dcd_addr) {
str += " -dcdaddr ";
str += std::to_string(m_dcd_addr);
}
SDPDcdCmd dcd((char *)str.c_str());
if (dcd.parser()) return -1;
if (dcd.run(ctx)) return -1;
@@ -171,10 +171,13 @@ class SDPBootlogCmd : public SDPCmdBase
class SDPDcdCmd : public SDPCmdBase
{
public:
uint32_t m_dcd_addr;
SDPDcdCmd(char *p):SDPCmdBase(p)
{
insert_param_info("dcd", NULL, Param::e_null);
insert_param_info("-f", &m_filename, Param::e_string_filename);
insert_param_info("-dcdaddr", &m_dcd_addr, Param::e_uint32);
m_dcd_addr = 0;
}
int run(CmdCtx *);

@@ -294,14 +297,18 @@ class SDPBootCmd : public SDPCmdBase
public:
bool m_nojump;
bool m_clear_dcd;
uint32_t m_dcd_addr;
SDPBootCmd(char *p) : SDPCmdBase(p)
{
insert_param_info("boot", NULL, Param::e_null);
insert_param_info("-f", &m_filename, Param::e_string_filename);
insert_param_info("-nojump", &m_nojump, Param::e_bool);
insert_param_info("-cleardcd", &m_clear_dcd, Param::e_bool);
insert_param_info("-dcdaddr", &m_dcd_addr, Param::e_uint32);

m_nojump = false;
m_clear_dcd = false;
m_dcd_addr = 0;
}
int run(CmdCtx *p);
};

0 comments on commit 003b6cb

Please sign in to comment.
You can’t perform that action at this time.