示例#1
0
文件: init.c 项目: M1cha/lktris
void target_init(void)
{
	dprintf(INFO, "target_init()\n");

	spmi_init(PMIC_ARB_CHANNEL_NUM, PMIC_ARB_OWNER_ID);

	target_keystatus();

	if (target_use_signed_kernel())
		target_crypto_init_params();

	platform_read_boot_config();

	if (platform_boot_dev_isemmc())
		target_sdc_init();
	else
	{
		ufs_device.base = UFS_BASE;
		ufs_init(&ufs_device);
	}

	/* Storage initialization is complete, read the partition table info */
	if (partition_read_table())
	{
		dprintf(CRITICAL, "Error reading the partition table info\n");
		ASSERT(0);
	}
}
示例#2
0
void
ext2fs_init(void)
{

	pool_init(&ext2fs_inode_pool, sizeof(struct inode), 0, 0, 0,
	    "ext2fsinopl", &pool_allocator_nointr, IPL_NONE);
	ufs_init();
}
示例#3
0
int
ext2fs_init(struct vfsconf *vfsp)
{
	pool_init(&ext2fs_inode_pool, sizeof(struct inode), 0, 0, 0,
	    "ext2inopl", &pool_allocator_nointr);
	pool_init(&ext2fs_dinode_pool, sizeof(struct ext2fs_dinode), 0, 0, 0,
	    "ext2dinopl", &pool_allocator_nointr);

	return (ufs_init(vfsp));
}
示例#4
0
static void
chfs_init(void)
{
	/* Initialize pools and inode hash. */
	chfs_alloc_pool_caches();
	chfs_ihashinit();
	pool_init(&chfs_inode_pool, sizeof(struct chfs_inode), 0, 0, 0,
	    "chfsinopl", &pool_allocator_nointr, IPL_NONE);
	ufs_init();
}
示例#5
0
void
ext2fs_init(void)
{
//	printf("inside ext2fs_init\n");
	pool_init(&ext2fs_inode_pool, sizeof(struct inode), 0, 0, 0,
	    "ext2fsinopl", &pool_allocator_nointr, IPL_NONE);
	pool_init(&ext2fs_dinode_pool, sizeof(struct ext2fs_dinode), 0, 0, 0,
	    "ext2dinopl", &pool_allocator_nointr, IPL_NONE);
	ufs_init();
}
示例#6
0
int
ext2fs_init(struct vfsconf *vfsp)
{
	pool_init(&ext2fs_inode_pool, sizeof(struct inode), 0, 0, PR_WAITOK,
	    "ext2inopl", NULL);
	pool_init(&ext2fs_dinode_pool, sizeof(struct ext2fs_dinode), 0, 0,
	    PR_WAITOK, "ext2dinopl", NULL);

	return (ufs_init(vfsp));
}
/*******************************************************************************
 * Populate the extents of memory available for loading SCP_BL2 (if used),
 * i.e. anywhere in trusted RAM as long as it doesn't overwrite BL2.
 ******************************************************************************/
void bl2_plat_get_scp_bl2_meminfo(meminfo_t *scp_bl2_meminfo)
{
	ufs_params_t ufs_params;

	memset(&ufs_params, 0, sizeof(ufs_params_t));
	ufs_params.reg_base = UFS_REG_BASE;
	ufs_params.desc_base = HIKEY960_UFS_DESC_BASE;
	ufs_params.desc_size = HIKEY960_UFS_DESC_SIZE;
	ufs_params.flags = UFS_FLAGS_SKIPINIT;
	ufs_init(NULL, &ufs_params);

	hikey960_io_setup();

	*scp_bl2_meminfo = bl2_tzram_layout;
}
示例#8
0
int
ffs_init(struct vfsconf *vfsp)
{
	static int done;

	if (done)
		return (0);

	done = 1;

	pool_init(&ffs_ino_pool, sizeof(struct inode), 0, 0, 0, "ffsino",
	    &pool_allocator_nointr);
	pool_init(&ffs_dinode1_pool, sizeof(struct ufs1_dinode), 0, 0, 0,
	    "dino1pl", &pool_allocator_nointr);
#ifdef FFS2
	pool_init(&ffs_dinode2_pool, sizeof(struct ufs2_dinode), 0, 0, 0,
	    "dino2pl", &pool_allocator_nointr);
#endif

	softdep_initialize();

	return (ufs_init(vfsp));
}
示例#9
0
文件: init.c 项目: sndnvaps/lk-1
void target_init(void)
{
	dprintf(INFO, "target_init()\n");

	spmi_init(PMIC_ARB_CHANNEL_NUM, PMIC_ARB_OWNER_ID);

	target_keystatus();


	if (target_use_signed_kernel())
		target_crypto_init_params();

	platform_read_boot_config();

	if (platform_boot_dev_isemmc())
	{
		target_sdc_init();
	}
	else
	{
		ufs_device.base = UFS_BASE;
		ufs_init(&ufs_device);
	}

	/* Storage initialization is complete, read the partition table info */
	if (partition_read_table())
	{
		dprintf(CRITICAL, "Error reading the partition table info\n");
		ASSERT(0);
	}

	rpm_smd_init();

	/* QPNP WLED init for display backlight */
	pm8x41_wled_config_slave_id(PMIC_WLED_SLAVE_ID);
	qpnp_wled_init();
}
示例#10
0
void
ffs_init()
{
	ufs_init();
}
示例#11
0
void
ipl_main(unsigned interactive, unsigned sptop, unsigned psw)
	/* interactive:		 parameters from PDC */
	/* sptop:			 value of sp on function entry */
	/* psw:			 PSW on startup */
{
	char buf[32];
	int part = 0;		/* default partition "a" */
	unsigned secsz, partoff, partsz;
	int c, c1;
	uintptr_t loadadr;

#if 0
	print(hexstr(buf, interactive));
	print(str_crlf);
	print(hexstr(buf, sptop));
	print(str_crlf);
	print(hexstr(buf, psw));
	print(str_crlf);
#endif

	print(hexstr(buf, (psw & 0x08000000) ? (unsigned) 0x64 : 0x32));
	print(str_bit_firmware);	/* "bit firmware\r\n" */

	/*
	 * check disklabel
	 * (dklabel has disklabel on startup)
	 */
	if (dklabel.d_magic == DISKMAGIC && (secsz = dklabel.d_secsize) != 0) {
		/*
		 * select boot partition
		 */
		if (interactive) {
		select_partition:
			/* "boot partition (a-p, ! to reboot) [a]:" */
			print(str_bootpart);
			part = 0;		/* default partition "a" */
			c1 = 0;
			while ((c = getch()) >= 0) {
				switch (c) {
				case '\n':
				case '\r':
					goto break_while;
				case '\b':
				case '\177':
					if (c1) {
						print(str_rubout);
						part = c1 = 0;
					}
					break;
				case '!':	/* reset */
					if (c1 == 0) {
						part = -1;
						goto echoback;
					}
					break;
				default:
					if (c1 == 0 && c >= 'a' && c <= 'p') {
						part = c - 'a';
					echoback:
						putch(c);
						c1 = 1;
					}
					break;
				}
			}
		break_while:
			if (part == -1)
				return;		/* reset */
		}

		/*
		 * "\r\nbooting from partition _\r\n"
		 */
		str_booting_part[25] = 'a' + part;
		print(str_booting_part);

		partoff = dklabel.d_partitions[part].p_offset;
		partsz  = dklabel.d_partitions[part].p_size;

		if (part >= (int) dklabel.d_npartitions || partsz == 0) {
			print(str_warn_unused);	/* "unused partition\r\n" */
			goto select_partition;
		}

		/* boot partition must be below 2GB */
		if (partoff + partsz > ((unsigned)2*1024*1024*1024) / secsz) {
			/* "boot partition exceeds 2GB boundary\r\n" */
			print(str_warn_2GB);
			goto select_partition;
		}

		/*
		 * following device accesses are only in the partition
		 */
		offset_raw_read = partoff * secsz;
	} else {
		/*
		 * no disklabel --- assume the whole of the device
		 * is a filesystem
		 */
		print(str_nolabel);	/* "no disklabel\r\n" */
	}

	if (ufs_init()) {
		print(str_nofs);	/* "no filesystem found\r\n" */
		return;
	}
	str_filesystem[12] = (ufs_info.fstype == UFSTYPE_FFS) ? 'F' : 'L';
	print(str_filesystem);		/* "filesystem: _FS\r\n" */

	loadadr = (sptop + STACK_SIZE + LOAD_ALIGN - 1) & (-LOAD_ALIGN);
	load_file(str_boot1, loadadr, interactive, part); /* "boot.hp700" */
	load_file(str_boot2, loadadr, interactive, part); /* "boot" */
	load_file(str_boot3, loadadr, interactive, part); /* "usr/mdec/boot" */

	print(str_noboot);		/* "no secondary boot found\r\n" */
}
示例#12
0
int
ext2_init(struct vfsconf *vfsp)
{
	return (ufs_init(vfsp));
}
示例#13
0
void target_init(void)
{
#if VERIFIED_BOOT
#if !VBOOT_MOTA
	int ret = 0;
#endif
#endif

	dprintf(INFO, "target_init()\n");

	spmi_init(PMIC_ARB_CHANNEL_NUM, PMIC_ARB_OWNER_ID);

	target_keystatus();


	if (target_use_signed_kernel())
		target_crypto_init_params();

	platform_read_boot_config();

#ifdef MMC_SDHCI_SUPPORT
	if (platform_boot_dev_isemmc())
	{
		target_sdc_init();
	}
#endif
#ifdef UFS_SUPPORT
	if(!platform_boot_dev_isemmc())
	{
		ufs_device.base = UFS_BASE;
		ufs_init(&ufs_device);
	}
#endif
	/* Storage initialization is complete, read the partition table info */
	mmc_read_partition_table(0);

#if VERIFIED_BOOT
#if !VBOOT_MOTA
	/* Initialize Qseecom */
	ret = qseecom_init();

	if (ret < 0)
	{
		dprintf(CRITICAL, "Failed to initialize qseecom, error: %d\n", ret);
		ASSERT(0);
	}

	/* Start Qseecom */
	ret = qseecom_tz_init();

	if (ret < 0)
	{
		dprintf(CRITICAL, "Failed to start qseecom, error: %d\n", ret);
		ASSERT(0);
	}

	if (rpmb_init() < 0)
	{
		dprintf(CRITICAL, "RPMB init failed\n");
		ASSERT(0);
	}

	/*
	 * Load the sec app for first time
	 */
	if (load_sec_app() < 0)
	{
		dprintf(CRITICAL, "Failed to load App for verified\n");
		ASSERT(0);
	}
#endif
#endif

	rpm_smd_init();

	/* QPNP LED init for boot process notification */
	if (board_hardware_id() == HW_PLATFORM_LIQUID){
		pm8x41_wled_config_slave_id(PMIC_LED_SLAVE_ID);
		qpnp_led_init(QPNP_LED_BLUE, QPNP_LED_CTRL_BASE,
			QPNP_BLUE_LPG_CTRL_BASE);
	}

}
示例#14
0
文件: lfs_inode.c 项目: kame/kame
int
lfs_init()
{
    return (ufs_init());
}