示例#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
static int itp_load_ipl(block_dev_desc_t *block_dev)
{
	u32 offset;
	u32 size;
	u32 loadaddr;
	u32 returnvalue;
	int ab8500_cutid;

	debug("itp_load_ipl\n");

	/* Check if IPL partition is present */
	if (get_entry_info_toc(block_dev, ITP_TOC_IPL_NAME, &offset,
			       &size, &loadaddr)) {
		printf("itp_load_ipl: ipl toc entry not present\n");
		return 1;
	}

	/* Get CutID */
	ab8500_cutid = ab8500_read(AB8500_MISC, AB8500_REV_REG);

	returnvalue = sec_bridge_call_secure_service((u32)ISSWAPI_SECURE_LOAD,
						SEC_ROM_FORCE_CLEAN_MASK,
						IPL_ITEM_ID,
						ab8500_cutid);
	if (returnvalue != SEC_ROM_RET_OK) {
		printf("itp_load_ipl: ISSWAPI_SECURE_LOAD: %d\n",
			returnvalue);
		return 1;
	}

	return 0;
}