aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firmware-utils
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2017-07-23 22:19:21 +0200
committerRafał Miłecki <rafal@milecki.pl>2017-07-31 11:43:42 +0200
commit993c740255ae5f170f8b6b96083e457e1546fae1 (patch)
tree88589419811fb34250f4b67f777d73413d0351c1 /tools/firmware-utils
parent35ddef8455d9c4719b77735813d506130b5c4144 (diff)
downloadupstream-993c740255ae5f170f8b6b96083e457e1546fae1.tar.gz
upstream-993c740255ae5f170f8b6b96083e457e1546fae1.tar.bz2
upstream-993c740255ae5f170f8b6b96083e457e1546fae1.zip
firmware-utils: mktplinkfw2: respect -e option when reading fw info
When -e option it specified a corresponding flag is set in the custom_board. By using custom_board as fallback -e option gets respected for unknown boards. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'tools/firmware-utils')
-rw-r--r--tools/firmware-utils/src/mktplinkfw2.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/firmware-utils/src/mktplinkfw2.c b/tools/firmware-utils/src/mktplinkfw2.c
index f7bfed875f..56330c011e 100644
--- a/tools/firmware-utils/src/mktplinkfw2.c
+++ b/tools/firmware-utils/src/mktplinkfw2.c
@@ -794,8 +794,10 @@ static int inspect_fw(void)
hdr = (struct fw_header *)buf;
board = find_board_by_hwid(ntohl(hdr->hw_id));
+ if (!board)
+ board = &custom_board;
- if (board && board->flags & FLAG_LE_KERNEL_LA_EP) {
+ if (board->flags & FLAG_LE_KERNEL_LA_EP) {
hdr->kernel_la = bswap_32(hdr->kernel_la);
hdr->kernel_ep = bswap_32(hdr->kernel_ep);
}
@@ -845,7 +847,7 @@ static int inspect_fw(void)
inspect_fw_pstr("Firmware version", hdr->fw_version);
- if (board) {
+ if (board != &custom_board) {
layout = find_layout(board->layout_id);
inspect_fw_phexpost("Hardware ID",
ntohl(hdr->hw_id), board->id);
@@ -872,7 +874,7 @@ static int inspect_fw(void)
ntohl(hdr->kernel_ofs));
inspect_fw_phexdec("Kernel data length",
ntohl(hdr->kernel_len));
- if (board) {
+ if (board != &custom_board) {
inspect_fw_phexdef("Kernel load address",
ntohl(hdr->kernel_la),
layout ? layout->kernel_la : 0xffffffff);