staticint exynos_cpu_boot(int cpu)
{ /* * Exynos3250 doesn't need to send smc command for secondary CPU boot * because Exynos3250 removes WFE in secure mode. * * On Exynos5 devices the call is ignored by trustzone firmware.
*/ if (!soc_is_exynos4210() && !soc_is_exynos4212() &&
!soc_is_exynos4412()) return 0;
/* * The second parameter of SMC_CMD_CPU1BOOT command means CPU id. * But, Exynos4212 has only one secondary CPU so second parameter * isn't used for informing secure firmware about CPU id.
*/ if (soc_is_exynos4212())
cpu = 0;
/* * Almost all Exynos-series of SoCs that run in secure mode don't need * additional offset for every CPU, with Exynos4412 being the only * exception.
*/ if (soc_is_exynos4412())
boot_reg += 4 * cpu;
switch (reg) { case L2X0_CTRL: if (val & L2X0_CTRL_EN) { /* * Before the cache can be enabled, due to firmware * design, SMC_CMD_L2X0INVALL must be called.
*/ if (!l2cache_enabled) {
exynos_smc(SMC_CMD_L2X0INVALL, 0, 0, 0);
l2cache_enabled = 1;
}
} else {
l2cache_enabled = 0;
}
exynos_smc(SMC_CMD_L2X0CTRL, val, 0, 0); break;
case L2X0_DEBUG_CTRL:
exynos_smc(SMC_CMD_L2X0DEBUG, val, 0, 0); break;
nd = of_find_compatible_node(NULL, NULL, "samsung,secure-firmware"); if (!nd) returnfalse;
addr = of_get_address(nd, 0, NULL, NULL);
of_node_put(nd); if (!addr) {
pr_err("%s: No address specified.\n", __func__); returnfalse;
}
returntrue;
}
void __init exynos_firmware_init(void)
{ if (!exynos_secure_firmware_available()) return;
pr_info("Running under secure firmware.\n");
register_firmware_ops(&exynos_firmware_ops);
/* * Exynos 4 SoCs (based on Cortex A9 and equipped with L2C-310), * running under secure firmware, require certain registers of L2 * cache controller to be written in secure mode. Here .write_sec * callback is provided to perform necessary SMC calls.
*/ if (IS_ENABLED(CONFIG_CACHE_L2X0) &&
read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
outer_cache.write_sec = exynos_l2_write_sec;
outer_cache.configure = exynos_l2_configure;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.