From patchwork Sun Apr 16 10:16:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13212795 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1BBE7C77B61 for ; Sun, 16 Apr 2023 10:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KL5Z+hf/ebc30VPytbTEezGpo6sOCLN4CUJ8ahxomM4=; b=v9xiIgcqah7ItN NhU1uIF2+TthHMAoWknmhVj9OPExGfXQSWSu5HetPN84FwhjlySrZT/sGCpIKgPXi0eYeGOVtNR28 UiUwJjfcdGp7A3fCbVHpNW3cppW5SHBHcaMVxcgMUb+RkOTj8yUiPcj9Kvkt/EXrcN4BwFxJJWkcu U59zc19Lq6fpcFSoLHC4s9uMY467hb5vCPPYwR+DeSimZ/aoeZ6r+drHjQwMuVTWXGFTNmuy//kbP NZJH78/xTRZ2cfYQCfQ2naRMrSlph0c1CojcxHmg/5HXoAt8AlMeQ7VbDjZjWy+HsXQe5CR+D6ftO J8gSPFjf9YBSmRvBV9yQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pnzSk-00DVcL-1s; Sun, 16 Apr 2023 10:18:26 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pnzSc-00DVVJ-1b; Sun, 16 Apr 2023 10:18:19 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-94e8cdbc8ebso249921166b.2; Sun, 16 Apr 2023 03:18:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681640295; x=1684232295; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=p71y//uR+D7cixeMALk8VhvdwbZ2ImHTuWWM7+KMyYU=; b=Vvbpd3apjcdGYBnyB3Nhd5Y6xlhA5EkmAlFoD8DEnfMfacrcRRo8QqumBwvb2UB/C9 rRGwKoZymC0IODiNlnIGs0znkZlbbGAT/FtJlQyoLZh7dJ0/hK1R7ajWRi+0MCTexsPB G2cQuDK0Vc1VZ51VHIqYjozjmaLkXgzQMno+oEoqI1IixpekROyLp+xHu0MZcZjXYAzf D0KHyD079yN6VHQPIobK/Hd8KQrQEeBEn3gNRVcxVuyKTlDD0Sgk28lGSZrfHI8dS7uR eOEuN0uJqJN0VNcwmDbMEBq0C4+PkmNLM3qz9Uo+6TWfzxcaDs/po3OavbT7Rs4X3WZh 10TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681640295; x=1684232295; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p71y//uR+D7cixeMALk8VhvdwbZ2ImHTuWWM7+KMyYU=; b=TRosNwmRHe37Ga3TUBK0kDEM6BA1PTTYMXCqXhnP6LrH+EAYhf5nbgmWXTJR4fRmvd YfvWPx15LDj+0L70PUivw7qYlNnnphI0PvWeEkknDwTi927lhQAhKjG2lTxa3RR/2KWg Saqyaz6+UdDkveTNPqlBDs2+W3TQ4NMzVrarZRHgmuDd3VcIWafAjp5Lu3j/Uy6SnXTi 4ZWmPtvr/z/+JkfH/U1KZFau17CGdFv/A6tQrgKKHxEDpavl3HIJdz0jWjoPdbBH8Cdl PnuKzOTG39G4xE239hONWif2nk79CmmUR5J/VyUNPi0AEGAh3MBv+nhI5NTLOPrxZMsw Cc/g== X-Gm-Message-State: AAQBX9dtxns7JB4B6bPH2EHjypdsYu0Wr0C4q9bYNkCoFO1EajESWp/L KmN1KIAmndqgzHRJb/AdBLI= X-Google-Smtp-Source: AKy350ZBTe9qI+j2VYHMJ0JIoNndaUrUtPEre2RPlaNr7FWkp/9AM44D2kjX2mWsuvvMsIe5MMAjgQ== X-Received: by 2002:aa7:df0d:0:b0:504:9345:ffa4 with SMTP id c13-20020aa7df0d000000b005049345ffa4mr11519364edy.21.1681640295273; Sun, 16 Apr 2023 03:18:15 -0700 (PDT) Received: from localhost.my.domain (83.8.121.70.ipv4.supernova.orange.pl. [83.8.121.70]) by smtp.gmail.com with ESMTPSA id r20-20020a056402019400b0050476da5160sm4427443edv.45.2023.04.16.03.18.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Apr 2023 03:18:14 -0700 (PDT) From: Artur Weber To: Krzysztof Kozlowski Cc: 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, Artur Weber Subject: [PATCH 04/12] soc: samsung: Re-introduce Exynos4212 support Date: Sun, 16 Apr 2023 12:16:16 +0200 Message-Id: <20230416101624.15866-5-aweber.kernel@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230416101624.15866-1-aweber.kernel@gmail.com> References: <20230416101624.15866-1-aweber.kernel@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230416_031818_531966_9EB4F6A6 X-CRM114-Status: GOOD ( 18.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 c40610198f35 ("soc: samsung: Remove Exynos4212 related dead code"). Signed-off-by: Artur Weber --- drivers/soc/samsung/exynos-pmu.c | 9 +++++++++ drivers/soc/samsung/exynos-pmu.h | 2 ++ drivers/soc/samsung/exynos4-pmu.c | 13 +++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/soc/samsung/exynos-pmu.c b/drivers/soc/samsung/exynos-pmu.c index 732c86ce2be8..f3437db2fbdc 100644 --- a/drivers/soc/samsung/exynos-pmu.c +++ b/drivers/soc/samsung/exynos-pmu.c @@ -57,6 +57,12 @@ void exynos_sys_powerdown_conf(enum sys_powerdown mode) if (pmu_data->powerdown_conf_extra) pmu_data->powerdown_conf_extra(mode); + + if (pmu_data->pmu_config_extra) { + for (i = 0; pmu_data->pmu_config_extra[i].offset != PMU_TABLE_END; i++) + pmu_raw_writel(pmu_data->pmu_config_extra[i].val[mode], + pmu_data->pmu_config_extra[i].offset); + } } /* @@ -79,6 +85,9 @@ static const struct of_device_id exynos_pmu_of_device_ids[] = { }, { .compatible = "samsung,exynos4210-pmu", .data = exynos_pmu_data_arm_ptr(exynos4210_pmu_data), + }, { + .compatible = "samsung,exynos4212-pmu", + .data = exynos_pmu_data_arm_ptr(exynos4212_pmu_data), }, { .compatible = "samsung,exynos4412-pmu", .data = exynos_pmu_data_arm_ptr(exynos4412_pmu_data), diff --git a/drivers/soc/samsung/exynos-pmu.h b/drivers/soc/samsung/exynos-pmu.h index 5e851f32307e..1c652ffd79b4 100644 --- a/drivers/soc/samsung/exynos-pmu.h +++ b/drivers/soc/samsung/exynos-pmu.h @@ -20,6 +20,7 @@ struct exynos_pmu_conf { struct exynos_pmu_data { const struct exynos_pmu_conf *pmu_config; + const struct exynos_pmu_conf *pmu_config_extra; void (*pmu_init)(void); void (*powerdown_conf)(enum sys_powerdown); @@ -32,6 +33,7 @@ extern void __iomem *pmu_base_addr; /* list of all exported SoC specific data */ extern const struct exynos_pmu_data exynos3250_pmu_data; extern const struct exynos_pmu_data exynos4210_pmu_data; +extern const struct exynos_pmu_data exynos4212_pmu_data; extern const struct exynos_pmu_data exynos4412_pmu_data; extern const struct exynos_pmu_data exynos5250_pmu_data; extern const struct exynos_pmu_data exynos5420_pmu_data; diff --git a/drivers/soc/samsung/exynos4-pmu.c b/drivers/soc/samsung/exynos4-pmu.c index cb35103565a6..f8092190b938 100644 --- a/drivers/soc/samsung/exynos4-pmu.c +++ b/drivers/soc/samsung/exynos4-pmu.c @@ -86,7 +86,7 @@ static const struct exynos_pmu_conf exynos4210_pmu_config[] = { { PMU_TABLE_END,}, }; -static const struct exynos_pmu_conf exynos4412_pmu_config[] = { +static const struct exynos_pmu_conf exynos4x12_pmu_config[] = { { S5P_ARM_CORE0_LOWPWR, { 0x0, 0x0, 0x2 } }, { S5P_DIS_IRQ_CORE0, { 0x0, 0x0, 0x0 } }, { S5P_DIS_IRQ_CENTRAL0, { 0x0, 0x0, 0x0 } }, @@ -191,6 +191,10 @@ static const struct exynos_pmu_conf exynos4412_pmu_config[] = { { S5P_GPS_ALIVE_LOWPWR, { 0x7, 0x0, 0x0 } }, { S5P_CMU_SYSCLK_ISP_LOWPWR, { 0x1, 0x0, 0x0 } }, { S5P_CMU_SYSCLK_GPS_LOWPWR, { 0x1, 0x0, 0x0 } }, + { PMU_TABLE_END,}, +}; + +static const struct exynos_pmu_conf exynos4412_pmu_config[] = { { S5P_ARM_CORE2_LOWPWR, { 0x0, 0x0, 0x2 } }, { S5P_DIS_IRQ_CORE2, { 0x0, 0x0, 0x0 } }, { S5P_DIS_IRQ_CENTRAL2, { 0x0, 0x0, 0x0 } }, @@ -204,6 +208,11 @@ const struct exynos_pmu_data exynos4210_pmu_data = { .pmu_config = exynos4210_pmu_config, }; +const struct exynos_pmu_data exynos4212_pmu_data = { + .pmu_config = exynos4x12_pmu_config, +}; + const struct exynos_pmu_data exynos4412_pmu_data = { - .pmu_config = exynos4412_pmu_config, + .pmu_config = exynos4x12_pmu_config, + .pmu_config_extra = exynos4412_pmu_config, };