plat/marvell/a8k/common/mss/mss_scp_bootloader.c
/* Load image to MSS AP and do PM related initialization
 * Note that this routine is different than other CM3 loading routines, because
 * firmware for AP is dedicated for PM and therefore some additional PM
 * initialization is required
 */
Load image to MSS AP and do PM related initialization
Note that this routine is different than other CM3 loading routines, because
firmware for AP is dedicated for PM and therefore some additional PM
initialization is required
Load image to MSS AP and do PM related initialization Note that this routine is different than other CM3 loading routines because firmware for AP is dedicated for PM and therefore some additional PM initialization is required
static int mss_ap_load_image(uintptr_t single_img, uint32_t image_size)
{
	struct mss_pm_ctrl_block *mss_pm_crtl;
	int ret;
	mss_pm_crtl = (struct mss_pm_ctrl_block *)MSS_SRAM_PM_CONTROL_BASE;
	mss_pm_crtl->ipc_version                = MV_PM_FW_IPC_VERSION;
	mss_pm_crtl->num_of_clusters            = PLAT_MARVELL_CLUSTER_COUNT;
	mss_pm_crtl->num_of_cores_per_cluster   =
						PLAT_MARVELL_CLUSTER_CORE_COUNT;
	mss_pm_crtl->num_of_cores               = PLAT_MARVELL_CLUSTER_COUNT *
						PLAT_MARVELL_CLUSTER_CORE_COUNT;
	mss_pm_crtl->pm_trace_ctrl_base_address = AP_MSS_ATF_CORE_CTRL_BASE;
	mss_pm_crtl->pm_trace_info_base_address = AP_MSS_ATF_CORE_INFO_BASE;
	mss_pm_crtl->pm_trace_info_core_size    = AP_MSS_ATF_CORE_INFO_SIZE;
	VERBOSE("MSS Control Block = 0x%x\n", MSS_SRAM_PM_CONTROL_BASE);
	VERBOSE("mss_pm_crtl->ipc_version                = 0x%x\n",
		mss_pm_crtl->ipc_version);
	VERBOSE("mss_pm_crtl->num_of_cores               = 0x%x\n",
		mss_pm_crtl->num_of_cores);
	VERBOSE("mss_pm_crtl->num_of_clusters            = 0x%x\n",
		mss_pm_crtl->num_of_clusters);
	VERBOSE("mss_pm_crtl->num_of_cores_per_cluster   = 0x%x\n",
		mss_pm_crtl->num_of_cores_per_cluster);
	VERBOSE("mss_pm_crtl->pm_trace_ctrl_base_address = 0x%x\n",
		mss_pm_crtl->pm_trace_ctrl_base_address);
	VERBOSE("mss_pm_crtl->pm_trace_info_base_address = 0x%x\n",
		mss_pm_crtl->pm_trace_info_base_address);
	VERBOSE("mss_pm_crtl->pm_trace_info_core_size    = 0x%x\n",
		mss_pm_crtl->pm_trace_info_core_size);
	VERBOSE("Send info about the SCP_BL2 image to be transferred to SCP\n");
	ret = mss_image_load(single_img, image_size, AP_MSS_REG_BASE);
	if (ret != 0) {
		ERROR("SCP Image load failed\n");
		return -1;
	}
	ret = mss_check_image_ready(mss_pm_crtl);
	if (ret != 0)
		NOTICE("SCP Image doesn't contain PM firmware\n");
	return 0;
}
static int mss_ap_load_image ( uintptr_t single_img , uint32_t image_size ) { struct mss_pm_ctrl_block * mss_pm_crtl ; int ret ; mss_pm_crtl = ( struct mss_pm_ctrl_block * ) MSS_SRAM_PM_CONTROL_BASE ; mss_pm_crtl -> ipc_version = MV_PM_FW_IPC_VERSION ; mss_pm_crtl -> num_of_clusters = PLAT_MARVELL_CLUSTER_COUNT ; mss_pm_crtl -> num_of_cores_per_cluster = PLAT_MARVELL_CLUSTER_CORE_COUNT ; mss_pm_crtl -> num_of_cores = PLAT_MARVELL_CLUSTER_COUNT * PLAT_MARVELL_CLUSTER_CORE_COUNT ; mss_pm_crtl -> pm_trace_ctrl_base_address = AP_MSS_ATF_CORE_CTRL_BASE ; mss_pm_crtl -> pm_trace_info_base_address = AP_MSS_ATF_CORE_INFO_BASE ; mss_pm_crtl -> pm_trace_info_core_size = AP_MSS_ATF_CORE_INFO_SIZE ; VERBOSE ( " \n " , MSS_SRAM_PM_CONTROL_BASE ) ; VERBOSE ( " \n " , mss_pm_crtl -> ipc_version ) ; VERBOSE ( " \n " , mss_pm_crtl -> num_of_cores ) ; VERBOSE ( " \n " , mss_pm_crtl -> num_of_clusters ) ; VERBOSE ( " \n " , mss_pm_crtl -> num_of_cores_per_cluster ) ; VERBOSE ( " \n " , mss_pm_crtl -> pm_trace_ctrl_base_address ) ; VERBOSE ( " \n " , mss_pm_crtl -> pm_trace_info_base_address ) ; VERBOSE ( " \n " , mss_pm_crtl -> pm_trace_info_core_size ) ; VERBOSE ( " \n " ) ; ret = mss_image_load ( single_img , image_size , AP_MSS_REG_BASE ) ; if ( ret != 0 ) { ERROR ( " \n " ) ; return -1 ; } ret = mss_check_image_ready ( mss_pm_crtl ) ; if ( ret != 0 ) NOTICE ( " \n " ) ; return 0 ; }
Load image to MSS AP and do PM related initialization
 Note that this routine is different than other CM3 loading routines, because
 firmware for AP is dedicated for PM and therefore some additional PM
 initialization is required
Load image to MSS AP and do PM related initialization Note that this routine is different than other CM3 loading routines because firmware for AP is dedicated for PM and therefore some additional PM initialization is required
/* TODO: add PM Control Info from platform */ /* TODO: add checksum to image */ /* check that the image was loaded successfully */