From patchwork Tue May 21 21:10:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 13669768 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 2DE9CC25B7A for ; Tue, 21 May 2024 21:12:51 +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=HfWoOgaZ28CoDc5v7eOrIW755Z9J+dRf/qecAcNskxo=; b=X0OZsqyrNZtxiw 0G8hir7Spl37w3GOABPprn9Y8jo2MVHIZSAVwQ3dONnY7cMsdry8EMFBW62ipNrxi0llvlR4MdU/9 GhKYZVP4y6DcmvOEYBw/uG1FF/ROp76MICYeyBumwSUmb5m/RFmKDEDRzrx7tcv+gl7yFTPPZL4ZR UEUQ3WN2vhCshjXYn1G8CA+DeHqiubDefPec4UR65c14mEPduPFGHFRjLIUcQ4f0UPLcxKb3D+A18 PKgoqrLinNIYJv/sW4gPlsktCiTKKm2no72n0cjdBA11rs0eIqiC4sneRD/Axn5ujbJjcc8beDxWV 9c8ft3XbfX1vB880Y6WQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9Wmo-000000017U2-0nCk; Tue, 21 May 2024 21:12:42 +0000 Received: from smtp.forwardemail.net ([167.172.40.54]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9Wly-000000016tu-1vbL for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2024 21:12:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1716325881; bh=eyj04u+/DPesCV1unk9Wb1gsmDXj34axtvqf+FzsKkQ=; b=O3fC9bgB1MOP98dBjT871oX151vBHRil4IpGhTa48l/Kott/lcBq4QssoodNrnlAMCQBuBrf1 WdDAIwvj4Q9XDmEuvoFH1AiAPhKh+SeNZkuRCDMgOJwkrq7h7jTeyZEMgQ1H8buqePODiuASHFD iCk9w9+cy7Q8bNZ+IBCHkzayTQNRDmBkwg6JA75yd/brOhMeRcCJkXHiKYLSh2ufUnBkwUOCfQV VBdLwRUYEI/xEJDDYR5nNzfOPeEGPmiCvUP0BubO6gs7ni7TilWfVb3BsKJ5nESwvdvP4wEfqE9 zorz3ef+l9SBmw0LqL8IGBqzCVtaPOnPq5NEljHKes/g== From: Jonas Karlman To: Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Jonas Karlman , David Wu , Jianqun Xu Subject: [PATCH 10/13] soc: rockchip: io-domain: Add RK3308 IO voltage domains Date: Tue, 21 May 2024 21:10:13 +0000 Message-ID: <20240521211029.1236094-11-jonas@kwiboo.se> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240521211029.1236094-1-jonas@kwiboo.se> References: <20240521211029.1236094-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 167.172.40.54 X-ForwardEmail-ID: 664d0df48b6b0c828344af54 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240521_141151_943305_799452CD X-CRM114-Status: GOOD ( 13.65 ) 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 From: David Wu Add IO voltage domains support for the RK3308 SoC. Signed-off-by: David Wu Signed-off-by: Jianqun Xu Signed-off-by: Jonas Karlman --- drivers/soc/rockchip/io-domain.c | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/drivers/soc/rockchip/io-domain.c b/drivers/soc/rockchip/io-domain.c index 18f809c160a7..fd9fd31f71c2 100644 --- a/drivers/soc/rockchip/io-domain.c +++ b/drivers/soc/rockchip/io-domain.c @@ -39,6 +39,10 @@ #define RK3288_SOC_CON2_FLASH0 BIT(7) #define RK3288_SOC_FLASH_SUPPLY_NUM 2 +#define RK3308_SOC_CON0 0x300 +#define RK3308_SOC_CON0_VCCIO3 BIT(8) +#define RK3308_SOC_VCCIO3_SUPPLY_NUM 3 + #define RK3328_SOC_CON4 0x410 #define RK3328_SOC_CON4_VCCIO2 BIT(7) #define RK3328_SOC_VCCIO2_SUPPLY_NUM 1 @@ -229,6 +233,25 @@ static void rk3288_iodomain_init(struct rockchip_iodomain *iod) dev_warn(iod->dev, "couldn't update flash0 ctrl\n"); } +static void rk3308_iodomain_init(struct rockchip_iodomain *iod) +{ + int ret; + u32 val; + + /* if no vccio3 supply we should leave things alone */ + if (!iod->supplies[RK3308_SOC_VCCIO3_SUPPLY_NUM].reg) + return; + + /* + * set vccio3 iodomain to also use this framework + * instead of a special gpio. + */ + val = RK3308_SOC_CON0_VCCIO3 | (RK3308_SOC_CON0_VCCIO3 << 16); + ret = regmap_write(iod->grf, RK3308_SOC_CON0, val); + if (ret < 0) + dev_warn(iod->dev, "couldn't update vccio3 vsel ctrl\n"); +} + static void rk3328_iodomain_init(struct rockchip_iodomain *iod) { int ret; @@ -376,6 +399,19 @@ static const struct rockchip_iodomain_soc_data soc_data_rk3288 = { .init = rk3288_iodomain_init, }; +static const struct rockchip_iodomain_soc_data soc_data_rk3308 = { + .grf_offset = 0x300, + .supply_names = { + "vccio0", + "vccio1", + "vccio2", + "vccio3", + "vccio4", + "vccio5", + }, + .init = rk3308_iodomain_init, +}; + static const struct rockchip_iodomain_soc_data soc_data_rk3328 = { .grf_offset = 0x410, .supply_names = { @@ -528,6 +564,10 @@ static const struct of_device_id rockchip_iodomain_match[] = { .compatible = "rockchip,rk3288-io-voltage-domain", .data = &soc_data_rk3288 }, + { + .compatible = "rockchip,rk3308-io-voltage-domain", + .data = &soc_data_rk3308 + }, { .compatible = "rockchip,rk3328-io-voltage-domain", .data = &soc_data_rk3328