Fix the offset passed into 'google,board-rev-map'
We were accidentally passing in the offset for 'google,board-rev-map'
as the offset from right after the "params" field. This is a little
awkward, so instead change it to calculate based on the start of the
machine parameters.
BRANCH=pit
BUG=chrome-os-partner:23024
TEST=With other CLs, SPL can now find the proper revision
Change-Id: I105dc2a8c5f2c3b6d673fb83bdb8ea1f36386c65
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/173238
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
diff --git a/host/lib/exynos.py b/host/lib/exynos.py
index 340f029..33903f8 100644
--- a/host/lib/exynos.py
+++ b/host/lib/exynos.py
@@ -111,15 +111,6 @@
(size, pos, size, len(self._spl_data)
- pos, len(self._spl_data)))
- # Move past the header and read the parameter list, which is terminated
- # with \0.
- pos += 12
- param_list = struct.unpack('<%ds' % (len(self._spl_data) - pos),
- self._spl_data[pos:])[0]
- param_len = param_list.find('\0')
- param_list = param_list[:param_len]
- pos += (param_len + 4) & ~3
-
#
# A dictionary of functions processing machine parameters. This is being
# introduced after more than 20 parameters have been already defined and
@@ -147,6 +138,15 @@
't': [self._MpRevMap, pos]
}
+ # Move past the header and read the parameter list, which is terminated
+ # with \0.
+ pos += 12
+ param_list = struct.unpack('<%ds' % (len(self._spl_data) - pos),
+ self._spl_data[pos:])[0]
+ param_len = param_list.find('\0')
+ param_list = param_list[:param_len]
+ pos += (param_len + 4) & ~3
+
# Use this to detect a missing value from the fdt.
not_given = 'not-given-invalid-value'