plat/marvell/a8k/common/mss/mss_scp_bootloader.c
/* Load CM3 image (single_img) to CM3 pointed by cm3_type */
Load CM3 image (single_img) to CM3 pointed by cm3_type
Load CM3 image ( single_img ) to CM3 pointed by cm3_type
static int load_img_to_cm3(enum cm3_t cm3_type, uintptr_t single_img, uint32_t image_size)
{
	_Bool has_cp1 = 0;
	int ret;
	if (cp110_device_id_get() == MVEBU_80X0_DEV_ID)
		has_cp1 = 1;
	switch (cm3_type) {
	case MSS_AP:
		NOTICE("Load image to AP MSS\n");
		ret = mss_ap_load_image(single_img, image_size);
		if (ret != 0)
			return ret;
		break;
	case MSS_CP0:
		NOTICE("Load image to CP0 MSS\n");
		ret = mss_image_load(single_img, image_size, CP_MSS_REG_BASE(0));
		if (ret != 0) {
			ERROR("SCP Image load failed\n");
			return -1;
		}
		break;
	case MSS_CP1:
		if (!has_cp1) {
			NOTICE("Skipping MSS CP1 related image\n");
			break;
		}
		NOTICE("Load image to CP1 MSS\n");
		ret = mss_image_load(single_img, image_size, CP_MSS_REG_BASE(1));
		if (ret != 0) {
			ERROR("SCP Image load failed\n");
			return -1;
		}
		break;
	case MG_CP0:
		NOTICE("Load image to CP0 MG not supported\n");
		break;
	case MG_CP1:
		if (!has_cp1) {
			NOTICE("Skipping MG CP1 related image\n");
			break;
		}
		NOTICE("Load image to CP1 MG not supported\n");
		break;
	default:
		ERROR("SCP_BL2 wrong img format (cm3_type=%d)\n", cm3_type);
		break;
	}
	return 0;
}
static int load_img_to_cm3 ( enum cm3_t cm3_type , uintptr_t single_img , uint32_t image_size ) { _Bool has_cp1 = 0 ; int ret ; if ( cp110_device_id_get ( ) == MVEBU_80X0_DEV_ID ) has_cp1 = 1 ; switch ( cm3_type ) { case MSS_AP : NOTICE ( " \n " ) ; ret = mss_ap_load_image ( single_img , image_size ) ; if ( ret != 0 ) return ret ; break ; case MSS_CP0 : NOTICE ( " \n " ) ; ret = mss_image_load ( single_img , image_size , CP_MSS_REG_BASE ( 0 ) ) ; if ( ret != 0 ) { ERROR ( " \n " ) ; return -1 ; } break ; case MSS_CP1 : if ( ! has_cp1 ) { NOTICE ( " \n " ) ; break ; } NOTICE ( " \n " ) ; ret = mss_image_load ( single_img , image_size , CP_MSS_REG_BASE ( 1 ) ) ; if ( ret != 0 ) { ERROR ( " \n " ) ; return -1 ; } break ; case MG_CP0 : NOTICE ( " \n " ) ; break ; case MG_CP1 : if ( ! has_cp1 ) { NOTICE ( " \n " ) ; break ; } NOTICE ( " \n " ) ; break ; default : ERROR ( " \n " , cm3_type ) ; break ; } return 0 ; }
Load CM3 image (single_img) to CM3 pointed by cm3_type
Load CM3 image ( single_img ) to CM3 pointed by cm3_type
/* TODO: */ /* TODO: */