diff --git a/configs/sama5d4-ek/src/sam_bringup.c b/configs/sama5d4-ek/src/sam_bringup.c index ab6f4de18e..b1c795fb83 100644 --- a/configs/sama5d4-ek/src/sam_bringup.c +++ b/configs/sama5d4-ek/src/sam_bringup.c @@ -50,6 +50,8 @@ # include #endif +#include + #include "sama5d4-ek.h" /**************************************************************************** @@ -58,10 +60,14 @@ /* Debug ********************************************************************/ -#ifdef CONFIG_CPP_HAVE_VARARGS -# define message(...) syslog(__VA_ARGS__) +#ifdef CONFIG_BOARD_INITIALIZE +# define message lldbg #else -# define message syslog +# ifdef CONFIG_CPP_HAVE_VARARGS +# define message(...) syslog(__VA_ARGS__) +# else +# define message syslog +# endif #endif /**************************************************************************** @@ -78,9 +84,9 @@ int sam_bringup(void) { -#if defined(HAVE_NAND) || defined(HAVE_AT25) || defined(HAVE_HSMCI) || \ +#if defined(HAVE_NAND) || defined(HAVE_AT25) || defined(HAVE_HSMCI) || \ defined(HAVE_USBHOST) || defined(HAVE_USBMONITOR) || defined(HAVE_WM8904) || \ - defined(HAVE_AUTOMOUNTER) + defined(HAVE_AUTOMOUNTER) || defined(HAVE_ELF) int ret; #endif @@ -212,6 +218,17 @@ int sam_bringup(void) } #endif +#ifdef HAVE_ELF + /* Initialize the ELF binary loader */ + + message("Initializing the ELF binary loader\n"); + ret = elf_initialize(); + if (ret < 0) + { + message("ERROR: Initialization of the ELF loader failed: %d\n", ret); + } +#endif + /* If we got here then perhaps not all initialization was successful, but * at least enough succeeded to bring-up NSH with perhaps reduced * capabilities. diff --git a/configs/sama5d4-ek/src/sama5d4-ek.h b/configs/sama5d4-ek/src/sama5d4-ek.h index ee898be3e8..dbcc0987fd 100644 --- a/configs/sama5d4-ek/src/sama5d4-ek.h +++ b/configs/sama5d4-ek/src/sama5d4-ek.h @@ -68,6 +68,7 @@ #define HAVE_WM8904 1 #define HAVE_AUDIO_NULL 1 #define HAVE_PMIC 1 +#define HAVE_ELF 1 /* HSMCI */ /* Can't support MMC/SD if the card interface(s) are not enable */ @@ -455,6 +456,12 @@ # undef HAVE_PMIC /* REVISIT: Disable anyway because it does not yet work */ #endif +/* ELF */ + +#if defined(CONFIG_BINFMT_DISABLE) || !defined(CONFIG_ELF) +# undef HAVE_ELF +#endif + /* LEDs *****************************************************************************/ /* There are 3 LEDs on the SAMA5D4-EK: *