mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 04:45:12 +07:00
45e70b7d48
This is including fix exynos cpufreq driver compilation with ARCH_MULTIPLATFORM. Even though this is a work around, this is required for support exynos multiplatform for a while and will be updated in near future. This is based on tags/samsung-exynos. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJTiN4aAAoJEA0Cl+kVi2xqh14P/2Alq0Q4KgPmlsIIOsofADLw BEig7xQAh9iREkfKLm6Wy1K/OP99jNWdbtZnMF1UK3pTxNVPKluz3ZADdJXJWlmb UsZcu60l9ZuZ+B4vTUG7jQx2oq6sxo7aLVMyTvT+kWmzZsNWEdqMDzDATgqjPOW8 yGfWg6KwdTkpGbesID6w1h2D611RDIhJU+LpXE+AmyKWX3x/jkOxOU49CY8bKEhw ZwYw41vjTk8e2U/cBYCjqPhEuUzpFq+mmVQcVDGch/p/TFUA1/SbzuqbVDHVe+yZ qQHNZREsAWJPFJ22IjUleq/oNLiSVkJVVSkVrfXCwowzzPsw+cLFDuSRaJMROm1a baR77C0TJREqoXu4FexBSoWLPYbn7aUOlZ3wGmr/7MnPK/bK3e9BGiOsJ8GPIQuF e2ytESFl15ABduY0lV0H/TtOxjx8JZJf+xxh0Ip0qoE8XNkNxt5cIsMW7LD/NcaE zUuPoO+w97pUxyVDrTPXakLRdn643PmYRX+rMG8gXP82m/CiCKe+x8znc7BkXIq2 h8rvSLqnWQFYUdEj/0/T8scRT5DyZPjSTDguUj+lhDU2rE0gWNCHEO+2a7Qwm8Js YfeQ4dd71ZNqzw8Ui62do2HzNGIA/FWPwQBzHeu2tPxVrWOwSQz/zSA4TLwjeB3J n1Tzm9JOJNwH3FTAcH9k =SQbr -----END PGP SIGNATURE----- Merge tag 'samsung-drivers-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into next/drivers Merge "Samsung 2nd drivers for 3.16" from Kukjin Kim: This is including fix exynos cpufreq driver compilation with ARCH_MULTIPLATFORM. Even though this is a work around, this is required for support exynos multiplatform for a while and will be updated in near future. This is based on tags/samsung-exynos. * tag 'samsung-drivers-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung: (24 commits) cpufreq: exynos: Fix driver compilation with ARCH_MULTIPLATFORM ARM: EXYNOS: Enable multi-platform build support ARM: EXYNOS: Consolidate Kconfig entries ARM: EXYNOS: Add support for EXYNOS5410 SoC ARM: EXYNOS: Support secondary CPU boot of Exynos3250 ARM: EXYNOS: Add Exynos3250 SoC ID ARM: EXYNOS: Add 5800 SoC support ARM: EXYNOS: initial board support for exynos5260 SoC clk: exynos5250: Add missing sysmmu clocks for DISP and ISP blocks cpufreq: exynos: Fix the compile error ARM: S3C24XX: move debug-macro.S into the common space ARM: S3C24XX: use generic DEBUG_UART_PHY/_VIRT in debug macro ARM: S3C24XX: trim down debug uart handling ARM: compressed/head.S: remove s3c24xx special case ARM: EXYNOS: Remove unnecessary inclusion of cpu.h ARM: EXYNOS: Migrate Exynos specific macros from plat to mach ARM: EXYNOS: Remove exynos_subsys registration ARM: EXYNOS: Remove duplicate lines in Makefile ARM: EXYNOS: use v7_exit_coherency_flush macro for cache disabling ARM: dts: Remove g2d_pd node for exynos5420 ... Signed-off-by: Olof Johansson <olof@lixom.net>
93 lines
2.0 KiB
C
93 lines
2.0 KiB
C
/*
|
|
* Copyright (C) 2012 Samsung Electronics.
|
|
* Kyungmin Park <kyungmin.park@samsung.com>
|
|
* Tomasz Figa <t.figa@samsung.com>
|
|
*
|
|
* This program is free software,you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/io.h>
|
|
#include <linux/init.h>
|
|
#include <linux/of.h>
|
|
#include <linux/of_address.h>
|
|
|
|
#include <asm/firmware.h>
|
|
|
|
#include <mach/map.h>
|
|
|
|
#include "common.h"
|
|
#include "smc.h"
|
|
|
|
static int exynos_do_idle(void)
|
|
{
|
|
exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
|
|
return 0;
|
|
}
|
|
|
|
static int exynos_cpu_boot(int cpu)
|
|
{
|
|
/*
|
|
* Exynos3250 doesn't need to send smc command for secondary CPU boot
|
|
* because Exynos3250 removes WFE in secure mode.
|
|
*/
|
|
if (soc_is_exynos3250())
|
|
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;
|
|
|
|
exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
|
|
return 0;
|
|
}
|
|
|
|
static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr)
|
|
{
|
|
void __iomem *boot_reg;
|
|
|
|
if (!sysram_ns_base_addr)
|
|
return -ENODEV;
|
|
|
|
boot_reg = sysram_ns_base_addr + 0x1c;
|
|
|
|
if (!soc_is_exynos4212() && !soc_is_exynos3250())
|
|
boot_reg += 4*cpu;
|
|
|
|
__raw_writel(boot_addr, boot_reg);
|
|
return 0;
|
|
}
|
|
|
|
static const struct firmware_ops exynos_firmware_ops = {
|
|
.do_idle = exynos_do_idle,
|
|
.set_cpu_boot_addr = exynos_set_cpu_boot_addr,
|
|
.cpu_boot = exynos_cpu_boot,
|
|
};
|
|
|
|
void __init exynos_firmware_init(void)
|
|
{
|
|
struct device_node *nd;
|
|
const __be32 *addr;
|
|
|
|
nd = of_find_compatible_node(NULL, NULL,
|
|
"samsung,secure-firmware");
|
|
if (!nd)
|
|
return;
|
|
|
|
addr = of_get_address(nd, 0, NULL, NULL);
|
|
if (!addr) {
|
|
pr_err("%s: No address specified.\n", __func__);
|
|
return;
|
|
}
|
|
|
|
pr_info("Running under secure firmware.\n");
|
|
|
|
register_firmware_ops(&exynos_firmware_ops);
|
|
}
|