Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp806998rwr; Wed, 19 Apr 2023 13:26:03 -0700 (PDT) X-Google-Smtp-Source: AKy350YlOTCG/NvABrT5K16emrtND9pQW8LHi+kaJL4OkdavZIU3DX6Fxn/wWO/asTURHbIyFkc1 X-Received: by 2002:a05:6a00:1988:b0:63b:5ef5:d968 with SMTP id d8-20020a056a00198800b0063b5ef5d968mr5832647pfl.9.1681935963323; Wed, 19 Apr 2023 13:26:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681935963; cv=none; d=google.com; s=arc-20160816; b=jkbeff5T5rY/bFSsgypAk0ByF+1wII32sIVrl9MYgOiPEEq3J0/oEl3dD6tsCRfZAg 9kO97jhBTBz7ZpuMc3h/mm+piKpnGhqKL1/nqoNcyr3UW2dfUl78/10uuh63zvfOzJGH 0jWmvd8Blbee7N5ejJ0iXSerzoI5LwPyYfjRT64+9GFjp0kwbdiII0pqTeRynLaBQubw X4d9F9MwAwa6Mrrip9sOfXaYyOjQELMPSdvgsZGGGzqr+L0X9Jydl6EfKZpjLZzUDRmQ 0QtgK7NtaY4a6JFsdh1EgccFJxZd2DMsBsNiq3C51hT5C/rlbzI1VBcxfs50ewQuGULJ LC/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=V20VJv1TvezaAhFXg1TxVwCOql54YGFqOYPkGP8pazQ=; b=A82l6llSE0jnEHnBMUeKs+DaAG+D5MJdDgmyKZB0GN080rLLJ5kGklbFfOkHQAoawt hCr9zXzdLosO/Jjytdb8uD5R17X8l9vg7rVIXp7HJOULSrzwlgMTBeapynGSVPO7iMrC IsMm9DCcoMt5t+u/MYufYmZJoODiShkLka1+SfTh1O1DO7+neIjr+yzNUswQHfn91w05 ugJFAHX8JoLh99fAroIwO4BRy+yiBdvcaueuZRqic9dX1pk3NMH4ybJqVx/eeqliKwXR njyikZ16LKr4v24+N+RIfhoijrExVRFIEJzVK8Uoy9Aa/DDv2NA6InZ/7d+TnOrLi2kt 7p8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@grimler.se header.s=key1 header.b="cT8c6lY/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=grimler.se Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w5-20020aa79545000000b0063b82c09424si10883259pfq.151.2023.04.19.13.25.52; Wed, 19 Apr 2023 13:26:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@grimler.se header.s=key1 header.b="cT8c6lY/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=grimler.se Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232265AbjDSUZo (ORCPT + 99 others); Wed, 19 Apr 2023 16:25:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230361AbjDSUY7 (ORCPT ); Wed, 19 Apr 2023 16:24:59 -0400 Received: from out-21.mta0.migadu.com (out-21.mta0.migadu.com [91.218.175.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2239768C for ; Wed, 19 Apr 2023 13:24:21 -0700 (PDT) Date: Wed, 19 Apr 2023 22:24:16 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=grimler.se; s=key1; t=1681935859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=V20VJv1TvezaAhFXg1TxVwCOql54YGFqOYPkGP8pazQ=; b=cT8c6lY/bJVW3tUmDsyOXCpLyLqQnkGWUJhsaPyDTQDN+T0llTayhLrryh//uChH+//JHo x17+hr5gXmgXXv214KbPtSXg1i5+Whi6AkB87RxbFU1t5mpoZ5++enCMNkSEDLKNkmnQb6 3IMIQH5r+ho1nDTvIw+DjYAL79D8v9M= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Henrik Grimler To: Artur Weber Cc: Krzysztof Kozlowski , Alim Akhtar , Rob Herring , Sylwester Nawrocki , Tomasz Figa , Chanwoo Choi , Michael Turquette , Stephen Boyd , Arnd Bergmann , Olof Johansson , soc@kernel.org, Russell King , Daniel Lezcano , Kukjin Kim , Mauro Carvalho Chehab , Vinod Koul , Kishon Vijay Abraham I , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, linux-media@vger.kernel.org, linux-phy@lists.infradead.org, ~postmarketos/upstreaming@lists.sr.ht Subject: Re: [PATCH v2 03/12] ARM: exynos: Re-introduce Exynos4212 support Message-ID: References: <20230416133422.1949-1-aweber.kernel@gmail.com> <20230416133422.1949-4-aweber.kernel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230416133422.1949-4-aweber.kernel@gmail.com> X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Artur, On Sun, Apr 16, 2023 at 03:34:13PM +0200, Artur Weber wrote: > The platform was originally dropped in commit bca9085e0ae9 ("ARM: > dts: exynos: remove Exynos4212 support (dead code)"), as there were > no boards using it. > > We will be adding a device that uses it, so add it back. > > This effectively reverts commit 9e43eca3c874 ("ARM: EXYNOS: Remove > Exynos4212 related dead code"). > > Signed-off-by: Artur Weber > --- > arch/arm/mach-exynos/Kconfig | 5 +++++ > arch/arm/mach-exynos/common.h | 8 ++++++++ > arch/arm/mach-exynos/exynos.c | 2 ++ > arch/arm/mach-exynos/firmware.c | 8 +++++++- > arch/arm/mach-exynos/pm.c | 2 +- > arch/arm/mach-exynos/suspend.c | 4 ++++ > 6 files changed, 27 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig > index 4d3b40e4049a..b3d5df5225fe 100644 > --- a/arch/arm/mach-exynos/Kconfig > +++ b/arch/arm/mach-exynos/Kconfig > @@ -78,6 +78,11 @@ config CPU_EXYNOS4210 > default y > depends on ARCH_EXYNOS4 > > +config SOC_EXYNOS4212 > + bool "Samsung Exynos4212" > + default y > + depends on ARCH_EXYNOS4 > + > config SOC_EXYNOS4412 > bool "Samsung Exynos4412" > default y > diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h > index 29eb075b24a4..c9e85d33c309 100644 > --- a/arch/arm/mach-exynos/common.h > +++ b/arch/arm/mach-exynos/common.h > @@ -15,6 +15,7 @@ > #define EXYNOS3_SOC_MASK 0xFFFFF000 > > #define EXYNOS4210_CPU_ID 0x43210000 > +#define EXYNOS4212_CPU_ID 0x43220000 > #define EXYNOS4412_CPU_ID 0xE4412200 > #define EXYNOS4_CPU_MASK 0xFFFE0000 > > @@ -34,6 +35,7 @@ static inline int is_samsung_##name(void) \ > > IS_SAMSUNG_CPU(exynos3250, EXYNOS3250_SOC_ID, EXYNOS3_SOC_MASK) > IS_SAMSUNG_CPU(exynos4210, EXYNOS4210_CPU_ID, EXYNOS4_CPU_MASK) > +IS_SAMSUNG_CPU(exynos4212, EXYNOS4212_CPU_ID, EXYNOS4_CPU_MASK) > IS_SAMSUNG_CPU(exynos4412, EXYNOS4412_CPU_ID, EXYNOS4_CPU_MASK) > IS_SAMSUNG_CPU(exynos5250, EXYNOS5250_SOC_ID, EXYNOS5_SOC_MASK) > IS_SAMSUNG_CPU(exynos5410, EXYNOS5410_SOC_ID, EXYNOS5_SOC_MASK) > @@ -52,6 +54,12 @@ IS_SAMSUNG_CPU(exynos5800, EXYNOS5800_SOC_ID, EXYNOS5_SOC_MASK) > # define soc_is_exynos4210() 0 > #endif > > +#if defined(CONFIG_SOC_EXYNOS4212) > +# define soc_is_exynos4212() is_samsung_exynos4212() > +#else > +# define soc_is_exynos4212() 0 > +#endif > + > #if defined(CONFIG_SOC_EXYNOS4412) > # define soc_is_exynos4412() is_samsung_exynos4412() > #else > diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c > index 51a247ca4da8..5671621f1661 100644 > --- a/arch/arm/mach-exynos/exynos.c > +++ b/arch/arm/mach-exynos/exynos.c > @@ -178,6 +178,7 @@ static void __init exynos_dt_machine_init(void) > exynos_cpuidle.dev.platform_data = &cpuidle_coupled_exynos_data; > #endif > if (of_machine_is_compatible("samsung,exynos4210") || > + of_machine_is_compatible("samsung,exynos4212") || > (of_machine_is_compatible("samsung,exynos4412") && > (of_machine_is_compatible("samsung,trats2") || > of_machine_is_compatible("samsung,midas") || > @@ -192,6 +193,7 @@ static char const *const exynos_dt_compat[] __initconst = { > "samsung,exynos3250", > "samsung,exynos4", > "samsung,exynos4210", > + "samsung,exynos4212", > "samsung,exynos4412", > "samsung,exynos5", > "samsung,exynos5250", > diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c > index 2da5b60b59e2..110c8064ee64 100644 > --- a/arch/arm/mach-exynos/firmware.c > +++ b/arch/arm/mach-exynos/firmware.c > @@ -63,12 +63,18 @@ static int exynos_cpu_boot(int cpu) > * > * On Exynos5 devices the call is ignored by trustzone firmware. > */ > - if (!soc_is_exynos4210() && !soc_is_exynos4412()) > + if (!soc_is_exynos4210() && !soc_is_exynos4412() && > + !soc_is_exynos4212()) Seems more logical to have 4212 before 4412 here. > 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; Is it necessary to set cpu = 0? Are there any obvious issues without it (like second cpu not being brought up)? It seems vendor kernel does this for both exynos4210 and exynos4212 [1], but mainline has not done this for exynos4210 and there has been no reported issues on for that platform as far as I know. The assembly that handles SMC_CMD_CPU1BOOT in sboot.bin from firmware version T310XXSBQB2 is identical to what is found in sboot.bin from exynos4412-galaxy-s3, and it uses the cpu arg in both cases, so seems likely that we need this and I am mostly asking out of curiosity. [1] https://github.com/krzk/linux-vendor-backup/blob/mokee/android-3.4-samsung-galaxy-tab-s-10.5-sm-t805-exynos5420/arch/arm/mach-exynos/platsmp.c#L225-L229 Best regards, Henrik Grimler > exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0); > return 0; > } > diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c > index 30f4e55bf39e..9b6db04e4e34 100644 > --- a/arch/arm/mach-exynos/pm.c > +++ b/arch/arm/mach-exynos/pm.c > @@ -161,7 +161,7 @@ void exynos_enter_aftr(void) > > exynos_pm_central_suspend(); > > - if (soc_is_exynos4412()) { > + if (soc_is_exynos4412() || soc_is_exynos4212()) { > /* Setting SEQ_OPTION register */ > pmu_raw_writel(S5P_USE_STANDBY_WFI0 | S5P_USE_STANDBY_WFE0, > S5P_CENTRAL_SEQ_OPTION); > diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c > index 3bf14ca78b62..df1e10033f90 100644 > --- a/arch/arm/mach-exynos/suspend.c > +++ b/arch/arm/mach-exynos/suspend.c > @@ -231,6 +231,7 @@ static int __init exynos_pmu_irq_init(struct device_node *node, > > EXYNOS_PMU_IRQ(exynos3250_pmu_irq, "samsung,exynos3250-pmu"); > EXYNOS_PMU_IRQ(exynos4210_pmu_irq, "samsung,exynos4210-pmu"); > +EXYNOS_PMU_IRQ(exynos4212_pmu_irq, "samsung,exynos4212-pmu"); > EXYNOS_PMU_IRQ(exynos4412_pmu_irq, "samsung,exynos4412-pmu"); > EXYNOS_PMU_IRQ(exynos5250_pmu_irq, "samsung,exynos5250-pmu"); > 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 = { > }, { > .compatible = "samsung,exynos4210-pmu", > .data = &exynos4_pm_data, > + }, { > + .compatible = "samsung,exynos4212-pmu", > + .data = &exynos4_pm_data, > }, { > .compatible = "samsung,exynos4412-pmu", > .data = &exynos4_pm_data, > -- > 2.40.0 >