/******************************************************************************
 * CHECK IF SECURE BOOT IS NEEDED
******************************************************************************/
int sec_boot_enabled (void)
{
    switch(rom_info.m_SEC_CTRL.m_sec_boot)
    {
        case ATTR_SBOOT_ENABLE:
            SMSG(bMsg,"[%s] SBOOT is enabled\n",MOD);
            SMSG(bMsg,"0x%x, SB-FORCE\n",ATTR_SBOOT_ENABLE);            
            return 1;

        /* secure boot can't be disabled on security chip */
        case ATTR_SBOOT_DISABLE:
        case ATTR_SBOOT_ONLY_ENABLE_ON_SCHIP:
            SMSG(bMsg,"[%s] SBOOT is only enabled on S-CHIP\n",MOD);            
            if(TRUE == masp_hal_sbc_enabled())
            {
                SMSG(true,"0x%x, SB-SC\n",ATTR_SBOOT_ONLY_ENABLE_ON_SCHIP);
                return 1;
            }
            else
            {
                SMSG(true,"0x%x, SB-NSC\n",ATTR_SBOOT_ONLY_ENABLE_ON_SCHIP);
                return 0;
            }
       default:
            SMSG(true,"[%s] invalid sboot config (SB-0x%x)\n",MOD,rom_info.m_SEC_CTRL.m_sec_boot);
            SEC_ASSERT(0);
    }

    return 0;

}
Esempio n. 2
0
/******************************************************************************
 * CHECK IF SECURE USBDL IS ENABLED
 ******************************************************************************/
int sec_usbdl_enabled(void)
{
	switch (rom_info.m_SEC_CTRL.m_sec_usb_dl) {
	case ATTR_SUSBDL_ENABLE:
		SMSG(bMsg, "[%s] SUSBDL is enabled\n", MOD);
		SMSG(bMsg, "0x%x, SD-FORCE\n", ATTR_SUSBDL_ENABLE);
		return 1;

		/* SUSBDL can't be disabled on security chip */
	case ATTR_SUSBDL_DISABLE:
	case ATTR_SUSBDL_ONLY_ENABLE_ON_SCHIP:
		SMSG(bMsg, "[%s] SUSBDL is only enabled on S-CHIP\n", MOD);
		if (TRUE == masp_hal_sbc_enabled()) {
			SMSG(true, "0x%x, SD-SC\n", ATTR_SUSBDL_ONLY_ENABLE_ON_SCHIP);
			return 1;
		} else {
			SMSG(true, "0x%x, SD-NSC\n", ATTR_SUSBDL_ONLY_ENABLE_ON_SCHIP);
			return 0;
		}
	default:
		SMSG(true, "[%s] invalid susbdl config (SD-0x%x)\n", MOD,
		     rom_info.m_SEC_CTRL.m_sec_usb_dl);
		SEC_ASSERT(0);
		return 1;
	}
}
Esempio n. 3
0
/******************************************************************************
 * CHECK IF SECURITY CHIP IS ENABLED
******************************************************************************/
int sec_schip_enabled(void)
{
	if (TRUE == masp_hal_sbc_enabled()) {
		SMSG(true, "SC\n");
		return 1;
	} else {
		SMSG(true, "NSC\n");
		return 0;
	}

	return 0;
}
/******************************************************************************
 * CHECK IF SECROIMG AC IS ENABLED
 ******************************************************************************/
bool sec_secro_ac (void)
{
    /* PLEASE NOTE THAT !!!!!!!!!!!!!!!!!!
       SECRO AC is only effected when SUSBDL is on */
    if(TRUE == sec_usbdl_enabled())
    {    
        return TRUE;
    }
    /* If security chip, secroimage must be encrypted */
    else if(TRUE == masp_hal_sbc_enabled())
    {
        return TRUE;
    }
    else
    {
        return FALSE;
    }
}