6/08/2012

Enumerate the SD card in DLOAD mode only on MSM8960

If OEMs don't want to enumerate the SD in SBL1,SBL2 and SBL3, below are the code changes.




1. in the core/storage/sdcc/src/bsp/surf/8960/sdcc_bsp_boot.c
add function
/*add the function to set the slot type for specified slot */
void sdcc_bsp_set_slot_type(uint32 slot_num,sdcc_bsp_slot_type slot_type )
{

sdcc_bsp_slot_config [slot_num]= slot_type;

}

change the
static sdcc_bsp_slot_type sdcc_bsp_slot_config [SDCC_BSP_NUM_SLOTS] = {
SDCC_BSP_EMBEDDED_MEM_SLOT,
SDCC_BSP_NO_SLOT,
SDCC_BSP_NO_SLOT, //change to NO_SLOT so SDC3 will not be enumerated in normal procedure
SDCC_BSP_NO_SLOT
};

2. in the sdcc_bsp.h, add

void sdcc_bsp_set_slot_type(uint32 slot_num,sdcc_bsp_slot_type slot_type);

3. in the \boot\1042_boot_image\core\boot\secboot3\msm8960\build\msm8960.sconscript, add following to make sure compiling passed

env.Append(CPPDEFINES = [
'SDCC_OSAL_H=\\"sdcc_osal_boot.h\\"',
'SDCC_PAL_H=\\"sdcc_pal_tool.h\\"',
'FEATURE_SDCC_DISABLE_DMA',
'FEATURE_SDCC_FOR_TOOLS_ENV',
])

5. In boot_images/core/boot/secboot3/msm8960/sbl3/sbl3_hw.c, add the bsp slot change here.
void sbl3_hw_init( bl_shared_data_type *bl_shared_data )
{
BL_VERIFY( ( bl_shared_data != NULL ),
BL_ERR_NULL_PTR_PASSED );
boot_log_message("sbl3_hw_init, Start");
boot_log_start_timer();
/* ----------------------------------------------------------------------
Initialize the clocks and ramp up speed.
-----------------------------------------------------------------------*/

DALSYS_InitMod(NULL);

/* Initialize interrupts */
sbl3_hw_int_init();
sbl3_hw_int_enable(SBL3_RPM_WAIT_INT);

/*changed by, change the slot for the SDC3*/
if( boot_dload_is_dload_mode_set()== TRUE)
{
sdcc_bsp_set_slot_type(2,SDCC_BSP_OPEN_SLOT);
}
boot_log_stop_timer("sbl3_hw_init, Delta");
} /* sbl3_hw_init() */

No comments:

Post a Comment