From patchwork Sat Jun 25 11:36:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 12895337 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 AAFE3C43334 for ; Sat, 25 Jun 2022 11:39:57 +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=g7eMkmhwzXxSOVwSvuSdFOAKbq036QmLKxw7KNEoavs=; b=2d1cY78z04ZGCN wU6du8bdIEzUiRgCTyd3LrAaXlE+tl4eI4+WV9/ZYDJbasDt+FQwO87WB3llwj9IHiVDkYJKr0JDH fkbf3lLQjCjykgn0SrvH3I/mS9Q9RchFx24Z0kwJBsrD2bv7y6oTjP1Txe/U+bsW2P48QtFVuerWi vC6UZrefYCSLi7zQvCL++5ZmorvqwPeg71FuCkRR7sZs/7KKjz3Zib0ocRmDlEiIxlkhFcJ2Ygv8V hZ5zp1y5waN4nCAyigBPxMGsbGbByLDbj3f1e4XLr3Zry78LYEMUkhG3cXsUAmRKV93X0gseyDbvl HneMd/04zmCbY22ZGICg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o547n-005nCJ-3q; Sat, 25 Jun 2022 11:38:52 +0000 Received: from mout.kundenserver.de ([217.72.192.74]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o546B-005mYy-0L for linux-arm-kernel@lists.infradead.org; Sat, 25 Jun 2022 11:37:14 +0000 Received: from localhost.localdomain ([37.4.249.155]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MHnZQ-1nqAOE0WFK-00EvlY; Sat, 25 Jun 2022 13:37:04 +0200 From: Stefan Wahren To: Florian Fainelli , Ray Jui , Scott Branden , Lee Jones Cc: Peter Robinson , Melissa Wen , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Maxime Ripard , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V4 07/11] mfd: bcm2835-pm: Add support for BCM2711 Date: Sat, 25 Jun 2022 13:36:15 +0200 Message-Id: <20220625113619.15944-8-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220625113619.15944-1-stefan.wahren@i2se.com> References: <20220625113619.15944-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:UteCT9pRFwQtihi85KY2nNhWGA4PPpJwg9ttEATnncvc8H2XPAL hTIMxS21YGMAUxjWK9eVByCUn5uNt437ftu6nUoQx2pdLMlBYH40Wcwf8snMY0AhdQQ0YUA 0Sg3SMRY8adCURTyaBNSWCmOyMNNlx+FUG+gZyuX44rJo4ruqSSlGQqYvcyCzlb+YfJE/XH QOiIFTrbdZHqpVI9PB6tw== X-UI-Out-Filterresults: notjunk:1;V03:K0:/vTVd3zemHQ=:co7g9Oc2GYvNwk9vzUD26r GoavMAlkG5FBdYK5KRm6RgbmV8M7Ql2JTt/tbpZJfmnSrVkxqgTEX8TGqykdzJw/uu7ZamrAK rldqIq0xET/Q/yq/k916dzKu4ttW/WWaCIV28Xxs+eNhk/Xhy7djZQM9nhnydJgG5mCuxPtUR aGozr3kKCn0LEsrHqg9zp2wxCTTWpOr2Lo4dmwYsqZ/EXMMYbIZAs9s1ZNeV83keei5CQDSdr smCdr3t23zrG2oGDAd+C2EUskhv7nIaoE+sTS0TatAMvWsoxp0D2/0CsDnVxEpwAuIZrbFykh 7gRj44x3DKfx/Idf9CuNaazb0X3BrDBcfDi9+w1tojGlB5tE0znSY20RArVHmdJiLAL98ys50 8WXBA7je5TiRGBi6pTzQEjF0q53acOuh+es4M79ncizA/J1w5KNa8hY+JMcVjftUp0JaVZ76H 9pZtwhdfQmw65zJt6lkNg6+tnWLwrZnrxXhwR3n71GK8pgbFn3GUZ2hojnxy6HP0Cz2dlVlGQ NUXeIAXeSGAcNQSfAOadkJaSiTHiMwylMMj3toJqXhXMPWv5uj7U06d9Aun72Wwy964YHb1Q2 87jlKqyepGz2WUJEStz9g90o4d+11+Ch688O9oBv+zTPo4mnHglZ4dMKMY4JVJzVCheaDGVhk fRrDSapEGBcuVu59Yu8vET7LRx4Vx4NUCNjCfFNkbThzgtmDUHk04ZLbZQmE/u1+lplsvPc9+ +tN5/8I7guJ5MZL7lc/IHFk+83kKXxC/8jL4u7QDdc3vzSxieSBYcaIG7g8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220625_043711_396496_285337EC X-CRM114-Status: GOOD ( 17.69 ) 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 In BCM2711 the new RPiVid ASB took over V3D. The old ASB is still present with the ISP and H264 bits, and V3D is in the same place in the new ASB as the old one. As per the devicetree bindings, BCM2711 will provide both the old and new ASB resources, so get both of them and pass them into 'bcm2835-power,' which will take care of selecting which one to use accordingly. Since the RPiVid ASB's resources were being provided prior to formalizing the bindings[1], also support the old DT files that didn't use 'reg-names.' Signed-off-by: Stefan Wahren Reviewed-by: Peter Robinson [1] See: 7dbe8c62ceeb ("ARM: dts: Add minimal Raspberry Pi 4 support") Acked-by: Florian Fainelli --- drivers/mfd/bcm2835-pm.c | 13 +++++++++++++ include/linux/mfd/bcm2835-pm.h | 1 + 2 files changed, 14 insertions(+) diff --git a/drivers/mfd/bcm2835-pm.c b/drivers/mfd/bcm2835-pm.c index 418c8a16427d..49cd1f03884a 100644 --- a/drivers/mfd/bcm2835-pm.c +++ b/drivers/mfd/bcm2835-pm.c @@ -42,6 +42,14 @@ static int bcm2835_pm_get_pdata(struct platform_device *pdev, pm->asb = NULL; } + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, + "rpivid_asb"); + if (res) { + pm->rpivid_asb = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(pm->rpivid_asb)) + pm->rpivid_asb = NULL; + } + return 0; } @@ -54,6 +62,10 @@ static int bcm2835_pm_get_pdata(struct platform_device *pdev, if (IS_ERR(pm->asb)) pm->asb = NULL; + pm->rpivid_asb = devm_platform_ioremap_resource(pdev, 2); + if (IS_ERR(pm->rpivid_asb)) + pm->rpivid_asb = NULL; + return 0; } @@ -95,6 +107,7 @@ static int bcm2835_pm_probe(struct platform_device *pdev) static const struct of_device_id bcm2835_pm_of_match[] = { { .compatible = "brcm,bcm2835-pm-wdt", }, { .compatible = "brcm,bcm2835-pm", }, + { .compatible = "brcm,bcm2711-pm", }, {}, }; MODULE_DEVICE_TABLE(of, bcm2835_pm_of_match); diff --git a/include/linux/mfd/bcm2835-pm.h b/include/linux/mfd/bcm2835-pm.h index ed37dc40e82a..f70a810c55f7 100644 --- a/include/linux/mfd/bcm2835-pm.h +++ b/include/linux/mfd/bcm2835-pm.h @@ -9,6 +9,7 @@ struct bcm2835_pm { struct device *dev; void __iomem *base; void __iomem *asb; + void __iomem *rpivid_asb; }; #endif /* BCM2835_MFD_PM_H */