aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2017-07-23 22:19:20 +0200
committerRafał Miłecki <rafal@milecki.pl>2017-07-31 11:43:42 +0200
commit35ddef8455d9c4719b77735813d506130b5c4144 (patch)
treeb1a8d3f9a0184707c16a592d2eba29599db7839a /tools
parentd181cbbfb078cfb2db3b00091dbfc4de357ce4f3 (diff)
downloadupstream-35ddef8455d9c4719b77735813d506130b5c4144.tar.gz
upstream-35ddef8455d9c4719b77735813d506130b5c4144.tar.bz2
upstream-35ddef8455d9c4719b77735813d506130b5c4144.zip
firmware-utils: mktplinkfw2: fix info for images with LE kernel LA/EP
With this change endianness is also respected when reading firmware info. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'tools')
-rw-r--r--tools/firmware-utils/src/mktplinkfw2.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/firmware-utils/src/mktplinkfw2.c b/tools/firmware-utils/src/mktplinkfw2.c
index 905220538b..f7bfed875f 100644
--- a/tools/firmware-utils/src/mktplinkfw2.c
+++ b/tools/firmware-utils/src/mktplinkfw2.c
@@ -793,6 +793,13 @@ static int inspect_fw(void)
goto out_free_buf;
hdr = (struct fw_header *)buf;
+ board = find_board_by_hwid(ntohl(hdr->hw_id));
+
+ if (board && board->flags & FLAG_LE_KERNEL_LA_EP) {
+ hdr->kernel_la = bswap_32(hdr->kernel_la);
+ hdr->kernel_ep = bswap_32(hdr->kernel_ep);
+ }
+
inspect_fw_pstr("File name", inspect_info.file_name);
inspect_fw_phexdec("File size", inspect_info.file_size);
@@ -838,7 +845,6 @@ static int inspect_fw(void)
inspect_fw_pstr("Firmware version", hdr->fw_version);
- board = find_board_by_hwid(ntohl(hdr->hw_id));
if (board) {
layout = find_layout(board->layout_id);
inspect_fw_phexpost("Hardware ID",