Commit 9cdac4a2 authored by Olof Johansson's avatar Olof Johansson

Merge tag 'v4.5-rockchip-soc-1' of...

Merge tag 'v4.5-rockchip-soc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into next/soc

SMP special case for the rk3036 and addition of the rk3228
quad-core Cortex-A7 cpu.

* tag 'v4.5-rockchip-soc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  ARM: rockchip: enable support for RK3228 SoCs
  ARM: rockchip: use const and __initconst for rk3036 smp_operations
  ARM: rockchip: add support smp for rk3036
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents f877df2b 2608224c
...@@ -200,6 +200,7 @@ nodes to be present and contain the properties described below. ...@@ -200,6 +200,7 @@ nodes to be present and contain the properties described below.
"qcom,gcc-msm8660" "qcom,gcc-msm8660"
"qcom,kpss-acc-v1" "qcom,kpss-acc-v1"
"qcom,kpss-acc-v2" "qcom,kpss-acc-v2"
"rockchip,rk3036-smp"
"rockchip,rk3066-smp" "rockchip,rk3066-smp"
"ste,dbx500-smp" "ste,dbx500-smp"
......
...@@ -42,6 +42,7 @@ static int ncores; ...@@ -42,6 +42,7 @@ static int ncores;
#define PMU_PWRDN_SCU 4 #define PMU_PWRDN_SCU 4
static struct regmap *pmu; static struct regmap *pmu;
static int has_pmu = true;
static int pmu_power_domain_is_on(int pd) static int pmu_power_domain_is_on(int pd)
{ {
...@@ -89,20 +90,23 @@ static int pmu_set_power_domain(int pd, bool on) ...@@ -89,20 +90,23 @@ static int pmu_set_power_domain(int pd, bool on)
if (!IS_ERR(rstc) && !on) if (!IS_ERR(rstc) && !on)
reset_control_assert(rstc); reset_control_assert(rstc);
ret = regmap_update_bits(pmu, PMU_PWRDN_CON, BIT(pd), val); if (has_pmu) {
if (ret < 0) { ret = regmap_update_bits(pmu, PMU_PWRDN_CON, BIT(pd), val);
pr_err("%s: could not update power domain\n", __func__);
return ret;
}
ret = -1;
while (ret != on) {
ret = pmu_power_domain_is_on(pd);
if (ret < 0) { if (ret < 0) {
pr_err("%s: could not read power domain state\n", pr_err("%s: could not update power domain\n",
__func__); __func__);
return ret; return ret;
} }
ret = -1;
while (ret != on) {
ret = pmu_power_domain_is_on(pd);
if (ret < 0) {
pr_err("%s: could not read power domain state\n",
__func__);
return ret;
}
}
} }
if (!IS_ERR(rstc)) { if (!IS_ERR(rstc)) {
...@@ -122,7 +126,7 @@ static int rockchip_boot_secondary(unsigned int cpu, struct task_struct *idle) ...@@ -122,7 +126,7 @@ static int rockchip_boot_secondary(unsigned int cpu, struct task_struct *idle)
{ {
int ret; int ret;
if (!sram_base_addr || !pmu) { if (!sram_base_addr || (has_pmu && !pmu)) {
pr_err("%s: sram or pmu missing for cpu boot\n", __func__); pr_err("%s: sram or pmu missing for cpu boot\n", __func__);
return -ENXIO; return -ENXIO;
} }
...@@ -275,7 +279,7 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus) ...@@ -275,7 +279,7 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus)
return; return;
} }
if (rockchip_smp_prepare_pmu()) if (has_pmu && rockchip_smp_prepare_pmu())
return; return;
if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) { if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
...@@ -318,6 +322,13 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus) ...@@ -318,6 +322,13 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus)
pmu_set_power_domain(0 + i, false); pmu_set_power_domain(0 + i, false);
} }
static void __init rk3036_smp_prepare_cpus(unsigned int max_cpus)
{
has_pmu = false;
rockchip_smp_prepare_cpus(max_cpus);
}
#ifdef CONFIG_HOTPLUG_CPU #ifdef CONFIG_HOTPLUG_CPU
static int rockchip_cpu_kill(unsigned int cpu) static int rockchip_cpu_kill(unsigned int cpu)
{ {
...@@ -340,6 +351,15 @@ static void rockchip_cpu_die(unsigned int cpu) ...@@ -340,6 +351,15 @@ static void rockchip_cpu_die(unsigned int cpu)
} }
#endif #endif
static const struct smp_operations rk3036_smp_ops __initconst = {
.smp_prepare_cpus = rk3036_smp_prepare_cpus,
.smp_boot_secondary = rockchip_boot_secondary,
#ifdef CONFIG_HOTPLUG_CPU
.cpu_kill = rockchip_cpu_kill,
.cpu_die = rockchip_cpu_die,
#endif
};
static struct smp_operations rockchip_smp_ops __initdata = { static struct smp_operations rockchip_smp_ops __initdata = {
.smp_prepare_cpus = rockchip_smp_prepare_cpus, .smp_prepare_cpus = rockchip_smp_prepare_cpus,
.smp_boot_secondary = rockchip_boot_secondary, .smp_boot_secondary = rockchip_boot_secondary,
...@@ -349,4 +369,5 @@ static struct smp_operations rockchip_smp_ops __initdata = { ...@@ -349,4 +369,5 @@ static struct smp_operations rockchip_smp_ops __initdata = {
#endif #endif
}; };
CPU_METHOD_OF_DECLARE(rk3036_smp, "rockchip,rk3036-smp", &rk3036_smp_ops);
CPU_METHOD_OF_DECLARE(rk3066_smp, "rockchip,rk3066-smp", &rockchip_smp_ops); CPU_METHOD_OF_DECLARE(rk3066_smp, "rockchip,rk3066-smp", &rockchip_smp_ops);
...@@ -82,6 +82,7 @@ static const char * const rockchip_board_dt_compat[] = { ...@@ -82,6 +82,7 @@ static const char * const rockchip_board_dt_compat[] = {
"rockchip,rk3066a", "rockchip,rk3066a",
"rockchip,rk3066b", "rockchip,rk3066b",
"rockchip,rk3188", "rockchip,rk3188",
"rockchip,rk3228",
"rockchip,rk3288", "rockchip,rk3288",
NULL, NULL,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment