예제 #1
0
unsigned is_reboot_mode(void)
{
	return check_reboot_mode();
}
예제 #2
0
파일: init.c 프로젝트: MiCode/mi2_lk
void target_init(void)
{
	unsigned base_addr;
	unsigned char slot;
	unsigned platform_id = board_platform_id();

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

	pu_reason = target_check_power_on_reason();
	reboot_mode = check_reboot_mode();

	/* Initialize PMIC driver */
	pmic.read = (pm8921_read_func) & pa1_ssbi2_read_bytes;
	pmic.write = (pm8921_write_func) & pa1_ssbi2_write_bytes;

	pm8921_init(&pmic);

	target_shutdown_for_battinfo();
	target_shutdown_for_pwrkey();

	/* Keypad init */
	keys_init();

	if((platform_id == MSM8960)   ||
	   (platform_id == MSM8960AB) ||
	   (platform_id == APQ8060AB) ||
	   (platform_id == MSM8260AB) ||
	   (platform_id == MSM8660AB))
	{
		msm8960_keypad_init();
	}
	else if((platform_id == MSM8230)   ||
			(platform_id == MSM8630)   ||
			(platform_id == MSM8930)   ||
			(platform_id == MSM8230AA) ||
			(platform_id == MSM8630AA) ||
			(platform_id == MSM8930AA))
	{
		msm8930_keypad_init();
	}
	else if((platform_id == APQ8064) ||
		    (platform_id == MPQ8064) ||
		    (platform_id == APQ8064AB))
	{
		apq8064_keypad_init();
	}

	/* Display splash screen if enabled */
#if DISPLAY_SPLASH_SCREEN
	if (board_target_id() == LINUX_MACHTYPE_8960_CDP || (board_target_id() == LINUX_MACHTYPE_8960_MITWOA))
		panel_backlight_on_mitwoa(0);
	display_init();
	dprintf(INFO, "Diplay initialized\n");
	mdelay(34);
	if (board_target_id() == LINUX_MACHTYPE_8064_MITWO || (board_target_id() == LINUX_MACHTYPE_8064_MTP))
		panel_backlight_on_mitwo(1);
	else
		panel_backlight_on_mitwoa(1);
#endif

	if ((platform_id == MSM8960) || (platform_id == MSM8960AB) ||
		(platform_id == APQ8060AB) || (platform_id == MSM8260AB) ||
		(platform_id == MSM8660AB) || (platform_id == MSM8660A) ||
		(platform_id == MSM8260A) || (platform_id == APQ8060A))
		/* Enable Hardware CE */
		platform_ce_type = CRYPTO_ENGINE_TYPE_HW;

	/* Trying Slot 1 first */
	slot = 1;
	base_addr = mmc_sdc_base[slot - 1];
	if (mmc_boot_main(slot, base_addr)) {
		/* Trying Slot 3 next */
		slot = 3;
		base_addr = mmc_sdc_base[slot - 1];
		if (mmc_boot_main(slot, base_addr)) {
			dprintf(CRITICAL, "mmc init failed!");
			ASSERT(0);
		}
	}
}