Skip to content

Commit 4e486a6

Browse files
refractionwarekrzk
authored andcommitted
ARM: exynos: Re-introduce Exynos4212 support
Support for the Exynos4212 SoC was originally dropped as there were no boards using it. We will be adding a device that uses it, so add back the relevant code. This reverts commit 9e43eca. Signed-off-by: Artur Weber <aweber.kernel@gmail.com> Link: https://lore.kernel.org/r/20230501195525.6268-4-aweber.kernel@gmail.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
1 parent 9d2edcc commit 4e486a6

6 files changed

Lines changed: 27 additions & 2 deletions

File tree

arch/arm/mach-exynos/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ config CPU_EXYNOS4210
7878
default y
7979
depends on ARCH_EXYNOS4
8080

81+
config SOC_EXYNOS4212
82+
bool "Samsung Exynos4212"
83+
default y
84+
depends on ARCH_EXYNOS4
85+
8186
config SOC_EXYNOS4412
8287
bool "Samsung Exynos4412"
8388
default y

arch/arm/mach-exynos/common.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define EXYNOS3_SOC_MASK 0xFFFFF000
1616

1717
#define EXYNOS4210_CPU_ID 0x43210000
18+
#define EXYNOS4212_CPU_ID 0x43220000
1819
#define EXYNOS4412_CPU_ID 0xE4412200
1920
#define EXYNOS4_CPU_MASK 0xFFFE0000
2021

@@ -34,6 +35,7 @@ static inline int is_samsung_##name(void) \
3435

3536
IS_SAMSUNG_CPU(exynos3250, EXYNOS3250_SOC_ID, EXYNOS3_SOC_MASK)
3637
IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK)
38+
IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK)
3739
IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK)
3840
IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK)
3941
IS_SAMSUNG_CPU(exynos5410, EXYNOS5410_SOC_ID, EXYNOS5_SOC_MASK)
@@ -52,6 +54,12 @@ IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK)
5254
# define soc_is_exynos4210() 0
5355
#endif
5456

57+
#if defined(CONFIG_SOC_EXYNOS4212)
58+
# define soc_is_exynos4212() is_samsung_exynos4212()
59+
#else
60+
# define soc_is_exynos4212() 0
61+
#endif
62+
5563
#if defined(CONFIG_SOC_EXYNOS4412)
5664
# define soc_is_exynos4412() is_samsung_exynos4412()
5765
#else

arch/arm/mach-exynos/exynos.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ static void __init exynos_dt_machine_init(void)
180180
exynos_cpuidle.dev.platform_data = &cpuidle_coupled_exynos_data;
181181
#endif
182182
if (of_machine_is_compatible("samsung,exynos4210") ||
183+
of_machine_is_compatible("samsung,exynos4212") ||
183184
(of_machine_is_compatible("samsung,exynos4412") &&
184185
(of_machine_is_compatible("samsung,trats2") ||
185186
of_machine_is_compatible("samsung,midas") ||
@@ -194,6 +195,7 @@ static char const *const exynos_dt_compat[] __initconst = {
194195
"samsung,exynos3250",
195196
"samsung,exynos4",
196197
"samsung,exynos4210",
198+
"samsung,exynos4212",
197199
"samsung,exynos4412",
198200
"samsung,exynos5",
199201
"samsung,exynos5250",

arch/arm/mach-exynos/firmware.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,18 @@ static int exynos_cpu_boot(int cpu)
6363
*
6464
* On Exynos5 devices the call is ignored by trustzone firmware.
6565
*/
66-
if (!soc_is_exynos4210() && !soc_is_exynos4412())
66+
if (!soc_is_exynos4210() && !soc_is_exynos4212() &&
67+
!soc_is_exynos4412())
6768
return 0;
6869

6970
/*
7071
* The second parameter of SMC_CMD_CPU1BOOT command means CPU id.
72+
* But, Exynos4212 has only one secondary CPU so second parameter
73+
* isn't used for informing secure firmware about CPU id.
7174
*/
75+
if (soc_is_exynos4212())
76+
cpu = 0;
77+
7278
exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0);
7379
return 0;
7480
}

arch/arm/mach-exynos/pm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void exynos_enter_aftr(void)
161161

162162
exynos_pm_central_suspend();
163163

164-
if (soc_is_exynos4412()) {
164+
if (soc_is_exynos4212() || soc_is_exynos4412()) {
165165
/* Setting SEQ_OPTION register */
166166
pmu_raw_writel(S5P_USE_STANDBY_WFI0 | S5P_USE_STANDBY_WFE0,
167167
S5P_CENTRAL_SEQ_OPTION);

arch/arm/mach-exynos/suspend.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ static int __init exynos_pmu_irq_init(struct device_node *node,
231231

232232
EXYNOS_PMU_IRQ(exynos3250_pmu_irq, "samsung,exynos3250-pmu");
233233
EXYNOS_PMU_IRQ(exynos4210_pmu_irq, "samsung,exynos4210-pmu");
234+
EXYNOS_PMU_IRQ(exynos4212_pmu_irq, "samsung,exynos4212-pmu");
234235
EXYNOS_PMU_IRQ(exynos4412_pmu_irq, "samsung,exynos4412-pmu");
235236
EXYNOS_PMU_IRQ(exynos5250_pmu_irq, "samsung,exynos5250-pmu");
236237
EXYNOS_PMU_IRQ(exynos5420_pmu_irq, "samsung,exynos5420-pmu");
@@ -640,6 +641,9 @@ static const struct of_device_id exynos_pmu_of_device_ids[] __initconst = {
640641
}, {
641642
.compatible = "samsung,exynos4210-pmu",
642643
.data = &exynos4_pm_data,
644+
}, {
645+
.compatible = "samsung,exynos4212-pmu",
646+
.data = &exynos4_pm_data,
643647
}, {
644648
.compatible = "samsung,exynos4412-pmu",
645649
.data = &exynos4_pm_data,

0 commit comments

Comments
 (0)