tools: kwboot: Inject baudrate change back code after data part
authorPali Rohár <pali@kernel.org>
Mon, 25 Oct 2021 13:12:56 +0000 (15:12 +0200)
committerStefan Roese <sr@denx.de>
Wed, 3 Nov 2021 05:45:27 +0000 (06:45 +0100)
commit063cb352814b5363aebb4c733a41b951787b1f5f
treef5626192387f659ce5bb73ba6129db3a84f30d50
parentad9a3ac5005e7b70a50b621a5340cead6fcc673f
tools: kwboot: Inject baudrate change back code after data part

Some vendor U-Boot kwbimage binaries (e.g. those for A375) have load
address set to zero. Therefore it is not possible to inject code which
changes baudrate back to 115200 Bd before the data part.

So instead inject it after the data part and change kwbimage execution
address to that offset. Also store original execution address into
baudrate change code, so after it changes baudrate back to 115200 Bd, it
can jump to orignal address.

Signed-off-by: Pali Rohár <pali@kernel.org>
[ refactored ]
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
tools/kwboot.c