summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8542be9)
raw | patch | inline | side by side (parent: 8542be9)
author | Sinthu Raja M <x0257345@ti.com> | |
Thu, 6 Sep 2018 12:24:08 +0000 (17:54 +0530) | ||
committer | Madan Srinivas <a0756974@ti.com> | |
Fri, 7 Dec 2018 21:13:32 +0000 (16:13 -0500) |
Add eMMc multi partition support to read app and execute the same
from any available partition not more than 4.
PRSDK-4440 Build scrip update for eMMc boot
Update build script for eMMC boot to enable yocto build for eMMc
binaries.
PRSDK-4440 Remove Multi-partition macro
Remove multi-partition macro.
Update code to use fatfs library which is common for single and
multi-partition library.
PRSDK-4440 Enable multi-partition support for MMCSD boot
Enable multi-partition support for MMCSD boot as a default mode
from any available partition not more than 4.
PRSDK-4440 Build scrip update for eMMc boot
Update build script for eMMC boot to enable yocto build for eMMc
binaries.
PRSDK-4440 Remove Multi-partition macro
Remove multi-partition macro.
Update code to use fatfs library which is common for single and
multi-partition library.
PRSDK-4440 Enable multi-partition support for MMCSD boot
Enable multi-partition support for MMCSD boot as a default mode
board/evmAM572x/build/makefile | patch | blob | history | |
build/sbl_am57xx.sh | patch | blob | history | |
soc/am57xx/sbl_slave_core_boot.c | patch | blob | history | |
src/mmcsd/sbl_mmcsd.c | patch | blob | history |
index 2c849a7b63a0aed8e645c23a25d94c07e11c5411..e0f0c91a354764f03c12b29a40092e8283c464b9 100644 (file)
# BOOTMODE specific CFLAGS
ifeq ($(BOOTMODE), mmcsd)
INTERNALDEFS += -DBOOT_MMCSD
+else ifeq ($(BOOTMODE), emmc)
+ INTERNALDEFS += -DBOOT_EMMC
+endif
+
+ifeq ($(BOOTMODE), $(filter $(BOOTMODE), mmcsd emmc))
SBL_MMCSD_DIR = $(SBL_SRC_DIR)/src/mmcsd
INCDIR := $(CSL_DIR);$(PDK_INSTALL_PATH);$(BOARD_DIR);$(SBL_INC_DIR);$(SBL_LIB_INC_DIR);$(SBL_MMCSD_DIR);$(SBL_SOC_DIR);$(SBL_SRC_DIR)/soc
PERIPHERAL_LIB = $(UART_LIB) $(I2C_LIB) $(MMCSD_LIB) $(FATFS_LIB) $(CSL_LIB) $(CSL_INIT_LIB) $(OSAL_LIB) $(PM_HAL_LIB)
VPATH=$(SRCDIR):$(SRCDIR)/$(BOARD):$(SBL_SRC_DIR)/soc/am57xx:$(SBL_SRC_DIR)/src/$(BOOTMODE):$(SBL_SRC_DIR)/src/rprc:$(SBL_SRC_DIR)/board/src:$(PDK_INSTALL_PATH)/ti/drv/uart/soc/am572x:$(PDK_INSTALL_PATH)/ti/drv/mmcsd/soc/am57xx:$(PDK_INSTALL_PATH)/ti/drv/spi/soc/am572x
+ifeq ($(BOOTMODE), emmc)
+VPATH+=:$(SBL_SRC_DIR)/src/mmcsd
+endif
#List the Source Files
SRC_C = \
sbl_main.c \
SRC_DRV = \
UART_soc.c
-ifeq ($(BOOTMODE), mmcsd)
+ifeq ($(BOOTMODE), $(filter $(BOOTMODE), mmcsd emmc))
SRC_C += sbl_mmcsd.c
SRC_DRV += MMCSD_soc.c
endif
CFLAGS += -Wall -O2
SRC_CFLAGS = -I. $(CFLAGS) -g -gdwarf-3 -gstrict-dwarf -Wall
+
# Make Rule for the SRC Files
SRC_OBJS = $(patsubst %.c, $(SBLOBJDIR)/%.$(OBJEXT), $(SRC_C))
ENTRY_OBJ = $(patsubst %.S, $(SBLOBJDIR)/%.$(ASMOBJEXT), $(ENTRY_SRC))
diff --git a/build/sbl_am57xx.sh b/build/sbl_am57xx.sh
index 64b9b1193c1b52437abb7339ac4875ea8668b483..002939d786521bc1d482ec86668d40eb37ae95c2 100755 (executable)
--- a/build/sbl_am57xx.sh
+++ b/build/sbl_am57xx.sh
make all BOARD=idkAM571x SOC=AM571x BOOTMODE=mmcsd
make all BOARD=idkAM571x SOC=AM571x BOOTMODE=qspi
make all BOARD=evmAM572x SOC=AM572x BOOTMODE=mmcsd
+make all BOARD=evmAM572x SOC=AM572x BOOTMODE=emmc
make flashwriter BOARD=idkAM572x SOC=AM572x
make flashwriter BOARD=idkAM571x SOC=AM571x
make flashwriter BOARD=idkAM574x SOC=AM574x
index d9bfd9c2b898813f1a6e5e1e0db920a66232ea05..4d70128d152d25de4f5c339737dbbfc437359ac3 100644 (file)
*/
/*
- * Copyright (C) 2015-2017 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2015-2018 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
{
int32_t retval = 0;
-#if defined(BOOT_MMCSD)
+#if defined(BOOT_MMCSD) || defined(BOOT_EMMC)
/* MMCSD Boot Mode Image Copy function. */
if (SBL_MMCBootImage(pEntry) != 1U)
#elif defined(BOOT_QSPI)
diff --git a/src/mmcsd/sbl_mmcsd.c b/src/mmcsd/sbl_mmcsd.c
index 2e711522210513067297cd4d9cf4b1dc40e5d948..1fb21863420ba0149a04ce06f440f012611b3190 100644 (file)
--- a/src/mmcsd/sbl_mmcsd.c
+++ b/src/mmcsd/sbl_mmcsd.c
*/
/*
- * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2015 - 2018 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#include "sbl_sec.h"
#endif
+#define MMCSD_INSTANCE_SDCARD 0U
+#define MMCSD_INSTANCE_EMMC 1U
+
+#ifdef BOOT_EMMC
+#define MMCSD_INSTANCE MMCSD_INSTANCE_EMMC
+#else
+#define MMCSD_INSTANCE MMCSD_INSTANCE_SDCARD
+#endif
+
/**
* \brief SBL_FileRead function reads N bytes from SD card and
* advances the cursor.
&FATFS_initCfg[2]
},
- {NULL, NULL, NULL},
-
{NULL, NULL, NULL}
};
int32_t SBL_MMCBootImage(sblEntryPoint_t *pEntry)
{
int32_t retVal = E_PASS;
- const TCHAR *fileName = "/app";
+ uint16_t pIndex = 0;
+ char fileName[7];
FIL fp;
FRESULT fresult;
MMCSDInitCfg[1].cardType = MMCSD_CARD_SD;
#endif
- if (sbl_fatfsHandle)
- {
- }
- else
+ if (!sbl_fatfsHandle)
{
/* Initialization of the driver. */
FATFS_init();
/* MMCSD FATFS initialization */
- FATFS_open(0U, NULL, &sbl_fatfsHandle);
+ fresult = (FRESULT)FATFS_open(MMCSD_INSTANCE, NULL, &sbl_fatfsHandles);
}
- fresult = f_open(&fp, fileName, ((BYTE)FA_READ));
+
+ for(pIndex = 0; pIndex < _VOLUMES; pIndex++)
+ {
+ /*Search file name in the indexed partition*/
+ snprintf(fileName, sizeof(fileName),"%d:/app", pIndex);
+ fresult = f_open(&fp, fileName, (uint8_t) FA_READ);
+
+ if(fresult == FR_OK)
+ {
+ break;
+ }
+ }
+
if (fresult != FR_OK)
{
UART_printf("\n SD Boot - File open fails \n");