commit cdd129b5fbab9ee543ec3674694b935b48e391e3
parent b1d7299b4526c5b644de0e32087fc0072990c0f6
Author: Roberto E. Vargas Caballero <roberto@clue.aero>
Date: Mon, 12 Aug 2019 16:29:48 +0200
[rom] Create macros for base addresses
These addresses were hardcoded because they were expected
to be autogenerated, but is this is not going to happen
it is better to set these macros and remove the
hardcode values from the call.
Change-Id: Ib46cf223266937e5774cb0639e7282e8b6f36de4
Diffstat:
1 file changed, 12 insertions(+), 17 deletions(-)
diff --git a/target/native/rom.c b/target/native/rom.c
@@ -15,6 +15,12 @@
#define STACKSIZ 1792
#define HEAPSIZ 1792
+/* TODO: Move these constants to a autogenerated file */
+#define BL2BASE ((void *) 0x4022000)
+#define BL33BASE ((void *) 0x88000000)
+#define DTBBASE ((void *) 0x82000000)
+
+
typedef struct mach Mach;
char **_environ;
@@ -174,23 +180,12 @@ err0:
void
loadfip(void)
{
- if (loadimg("/fip/bl2.bin", (void *) 0x4022000, NULL) < 0) {
- kerror("bl2 missing");
- goto error;
- }
- if (loadimg("/fip/bl33.bin", (void *) 0x88000000, NULL) < 0) {
- kerror("bl33 missing");
- goto error;
- }
- if (loadimg("/fip/hw.cfg", (void *) 0x82000000, NULL) < 0) {
- kerror("dtb missing");
- goto error;
- }
-
- return;
-
-error:
- panic("loadfip");
+ if (loadimg("/fip/bl2.bin", BL2BASE, NULL) < 0)
+ panic("bl2 missing");
+ if (loadimg("/fip/bl33.bin", BL33BASE, NULL) < 0)
+ panic("bl33 missing");
+ if (loadimg("/fip/hw.cfg", DTBBASE, NULL) < 0)
+ panic("dtb missing");
}
void