From da716b920073acbda8ab78722fd126094547019a Mon Sep 17 00:00:00 2001 From: Rene Straub Date: Wed, 30 Oct 2019 19:40:48 +0100 Subject: [PATCH] nmhw: make NM packed bootloader configurable - define CONFIG_NM_BOOTLOADER_FORMAT to support NM packed u-boot --- common/spl/spl_mmc.c | 9 ++++++++- include/configs/am335x_nrhw24.h | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index d11372b4f8..620035e12c 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -23,6 +23,7 @@ DECLARE_GLOBAL_DATA_PTR; #define UBOOT_MIN_SIZE_BYTES (128*1024) #define UBOOT_MAX_SIZE_BYTES (2500*1024) +#if defined(CONFIG_NM_BOOTLOADER_FORMAT) static int image_nm_header_ok(const struct nm_header *header) { @@ -133,6 +134,8 @@ end: return 0; } +#endif /* CONFIG_NM_BOOTLOADER_FORMAT) */ + static int mmc_load_legacy(struct mmc *mmc, ulong sector, struct image_header *header) { @@ -485,23 +488,27 @@ int spl_mmc_load_image(u32 boot_device) return err; #if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR) + +#if defined(CONFIG_NM_BOOTLOADER_FORMAT) /* Try to load NetModule packed bootloader from main location */ err = mmc_load_image_raw_sector_netmodule(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); if (!err) return err; /* found -> ok */ - +#endif /* Try to load bootloader from main location */ err = mmc_load_image_raw_sector(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); if (!err) return err; /* found -> ok */ +#if defined(CONFIG_NM_BOOTLOADER_FORMAT) /* Try to load NetModule packed bootloader from alternate location */ err = mmc_load_image_raw_sector_netmodule(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR_ALTERNATE); if (!err) return err; /* found -> ok */ +#endif /* Try to load regular bootloader from alternate location */ err = mmc_load_image_raw_sector(mmc, diff --git a/include/configs/am335x_nrhw24.h b/include/configs/am335x_nrhw24.h index 9e1d14e461..aaa5afb6db 100644 --- a/include/configs/am335x_nrhw24.h +++ b/include/configs/am335x_nrhw24.h @@ -281,6 +281,9 @@ int eth_phy_timeout(void); #ifdef CONFIG_NRSW +/* support for NM packed bootloader */ +#define CONFIG_NM_BOOTLOADER_FORMAT + /* password protected login */ #define CONFIG_CRYPT #define CONFIG_NM_LOGIN