예제 #1
0
int verify_start_modem(struct access_image_descr *access_image_descr)
{
	int ret = 0;
	u32 org;
	u32 id = 0;
	u32 buffer;
	TEEC_SharedMemory shm;
	TEEC_Operation operation;
	/* UUID for static TA */
	TEEC_UUID uuid = {
		0xBC765EDE,
		0x6724,
		0x11DF,
		{0x8E, 0x12, 0xEC, 0xDB, 0xDF, 0xD7, 0x20, 0x85}
	};

	if (access_image_descr == NULL) {
		ret = -1;
		goto out;
	}

	if (access_image_descr->elf_hdr == NULL) {
		ret = -1;
		goto out;
	}

	sec_bridge_init_bridge();

	shm.flags = TEEC_MEM_INPUT;

	shm.buffer = &buffer;
	shm.size = sizeof(buffer);

	*((u32 **)shm.buffer) = &access_image_descr->elf_hdr->e_entry;

	operation.memRefs[0] = shm;
	operation.flags = TEEC_MEMREF_0_USED;

	/* Call ISSW to verify and start modem */
	sec_bridge_call_secure_service(BASS_APP_ISSWAPI_EXECUTE_TA,
				       SEC_ROM_FORCE_CLEAN_MASK,
				       &id,
				       &uuid,
				       NULL,
				       BASS_APP_VERIFY_START_MODEM,
				       &operation,
				       &ret,
				       &org);

	/* Call ISSW to stop TA*/
	sec_bridge_call_secure_service(BASS_APP_ISSWAPI_CLOSE_TA,
				       SEC_ROM_FORCE_CLEAN_MASK,
				       &id,
				       &uuid,
				       NULL,
				       NULL);

out:
	return ret;
}
예제 #2
0
/*
 * itp_load_itp_and_modem - Loads itp and modem depending on config.
 * If itp is loaded ok it will be executed and u-boot execution will stop
 */
int itp_load_itp_and_modem(block_dev_desc_t *block_dev)
{
	int retval = 0;
	u32 loadaddress;

	debug("\nitp_load_itp_and_modem\n");

	if (sec_bridge_init_bridge()) {
		retval = 1;
		goto exit;
	}

	if (cspsa_key & ITP_LOAD_MODEM) {
		if (itp_load_toc_entry(block_dev,
				       ITP_TOC_MODEM_NAME,
				       0, /* verify_signature false */
				       &loadaddress)) {
			retval = 1;
			goto exit;
		}

		if (itp_load_ipl(block_dev)) {
			retval = 1;
			goto exit;
		}
	}

	if (cspsa_key & ITP_LOAD_ITP) {
		if (itp_load_toc_entry(block_dev,
				       ITP_TOC_ITP_NAME,
				       1, /* verify_signature true */
				       &loadaddress)) {
			retval = 1;
			goto exit;
		}
	}

exit:
	/* Always Flush */
	sec_bridge_flush_issw();

	if ((cspsa_key & ITP_LOAD_ITP) && !retval)
		/* U-boot execution will end here */
		((void (*)(void))loadaddress)();

	/* Return on error */
	return retval;
}