cros_bundle_firmware: Make fdt TEXT_BASE unsigned
This fixes a false warning that gets emitted when using
cros_bundle_firmware. Even if the fdt TEXT_BASE and the image TEXT_BASE
match, the mismatch warning will still appear due to the image TEXT_BASE
being unsigned, and the fdt TEXT_BASE being signed. Since we are talking
about base addresses, it makes sense to do the compare within the unsigned
domain.
BUG=none
TEST=Was able to use cros_bundle_firmware to flash my board, without
seeing the misleading warning.
Change-Id: I91a12fec5eb25cf7f3fb2450a620e7f703b3c3ff
Signed-off-by: Andrew Chew <achew@nvidia.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/41161
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/host/lib/bundle_firmware.py b/host/lib/bundle_firmware.py
index 920fd84..36f9bb5 100644
--- a/host/lib/bundle_firmware.py
+++ b/host/lib/bundle_firmware.py
@@ -621,7 +621,9 @@
value (which we will move to).
"""
data = self._tools.ReadFile(fname)
- fdt_text_base = fdt.GetInt('/chromeos-config', 'textbase', 0)
+ # The value that comes back from fdt.GetInt is signed, which makes no
+ # sense for an address base. Force it to unsigned.
+ fdt_text_base = fdt.GetInt('/chromeos-config', 'textbase', 0) & 0xffffffff
text_base = self.DecodeTextBase(data)
text_base_str = '%#x' % text_base if text_base else 'None'
self._out.Info('TEXT_BASE: fdt says %#x, %s says %s' % (fdt_text_base,