Some functions test that the given address is not NULL (0) and fail or
have a different behaviour if that's the case (e.g. hexport_r).
Let's make the RAM base address to be not zero by setting it to 2MiB if
that's the case.
2MiB is chosen because it represents the size of an ARM LPAE/v8 section.
Suggested-by: Stephen Warren <[email protected]>
Signed-off-by: Quentin Schulz <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Reviewed-by: Stephen Warren <[email protected]>
Tested-by: Stephen Warren <[email protected]>
ram_base = -1
raise Exception('Failed to find RAM bank start in `bdinfo`')
+ # We don't want ram_base to be zero as some functions test if the given
+ # address is NULL (0). Let's add 2MiB then (size of an ARM LPAE/v8 section).
+
+ if ram_base == 0:
+ ram_base += 1024 * 1024 * 2
+
return ram_base
class PersistentFileHelperCtxMgr(object):