From patchwork Mon Jul 31 21:55:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 13335534 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 29781C001E0 for ; Mon, 31 Jul 2023 21:55:44 +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=ZG0c8KYWeZ8xkPAaK+sDeUR1S8uHK6kgLiCmTOzV3xA=; b=VWS7nKsLIk91EX yJKwAct1xd5R99xnydOvJIeOAnn5jdQ3AZdPNunsRsXZ3kKC3Z9zoEtehLBrbzRIaLPgyFtROMwn8 0WV+O15O11Yo1q6d0ckAQjXn6ILw/V8/cj4us3+P5tX2kEwzAv7FWRqt6HnCkHMTh+bg67qwyhqMK dB93mwXz4mbNMBENY3CdZ6ffTrXj4IlR1IDq4XJj3PDhQDhjbApA8uhid8ZeMkciEOK6/yEhwkGeR vgJawmqssz6cYV+INsvhUkmnqTPahI9jgSjVQg4OaCYuQUwNixsEO3+YMpIcpOxB0bNfSXS6U5XLd Pvgf0jzn0JGWivxfkOOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQarK-00HREv-2n; Mon, 31 Jul 2023 21:55:22 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQarH-00HR9e-0d; Mon, 31 Jul 2023 21:55:20 +0000 Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DADD4982; Mon, 31 Jul 2023 23:54:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1690840450; bh=VW68c7LHYt5A4X71/eZ/VEWxBfzC2P5hQ+2/Jq5Gano=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HGt0MaubyGxJF4et/25JR/fQ1E8BFPAXgjKBploaON8HI78eW6ivCbNATS26hw7qP fqn25hIOMyfpg9IicruS5iqy+lrjXGNWQsTn6bMiWZ2ryhn4nx+2RMTNhPWPRNvLUC iIHW8QQRGgNz0I43bULlmbpZIOquWW6t+jmqLIOY= From: Laurent Pinchart To: linux-arm-kernel@lists.infradead.org Cc: linux-rpi-kernel@lists.infradead.org, devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, Florian Fainelli , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Cyril Brulebois , Maxime Ripard , Stefan Wahren , Dave Stevenson , Nicolas Saenz Julienne , Umang Jain Subject: [PATCH v4 1/2] ARM: dts: bcm2711-rpi: Add pinctrl-based multiplexing for I2C0 Date: Tue, 1 Aug 2023 00:55:14 +0300 Message-ID: <20230731215515.20682-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230731215515.20682-1-laurent.pinchart@ideasonboard.com> References: <20230731215515.20682-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230731_145519_399168_9A95FA44 X-CRM114-Status: GOOD ( 13.60 ) 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: Uwe Kleine-König BCM2711-based Raspberry Pi boards (4B, CM4 and 400) multiplex the I2C0 controller over two sets of pins, GPIO0+1 and GPIO44+45. The former is exposed on the 40-pin header, while the latter is used for the CSI and DSI connectors. Add a pinctrl-based I2C bus multiplexer to bcm2711-rpi.dtsi to model this multiplexing. The two child buses are named i2c0_0 and i2c0_1. Note that if you modified the dts before to add devices to the i2c bus appearing on pins gpio0 + gpio1 (either directly in the dts or using an overlay), you have to put these into the i2c0_0 node introduced here now. Signed-off-by: Uwe Kleine-König Signed-off-by: Laurent Pinchart --- Changes since v3: - Split addition of the RTC to a separate patch - Move the mux to bcm2711-rpi.dtsi --- arch/arm/boot/dts/bcm2711-rpi.dtsi | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/arch/arm/boot/dts/bcm2711-rpi.dtsi b/arch/arm/boot/dts/bcm2711-rpi.dtsi index 5e95e2321218..7eb9f131cfd1 100644 --- a/arch/arm/boot/dts/bcm2711-rpi.dtsi +++ b/arch/arm/boot/dts/bcm2711-rpi.dtsi @@ -16,6 +16,32 @@ aliases { pcie0 = &pcie0; blconfig = &blconfig; }; + + i2c0mux: i2c0mux { + compatible = "i2c-mux-pinctrl"; + #address-cells = <1>; + #size-cells = <0>; + + i2c-parent = <&i2c0>; + + pinctrl-names = "i2c0", "i2c0-vc"; + pinctrl-0 = <&i2c0_gpio0>; + pinctrl-1 = <&i2c0_gpio44>; + + status = "disabled"; + + i2c0_0: i2c@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c0_1: i2c@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; }; &firmware { @@ -48,6 +74,11 @@ &hvs { clocks = <&firmware_clocks 4>; }; +&i2c0 { + /delete-property/ pinctrl-names; + /delete-property/ pinctrl-0; +}; + &rmem { /* * RPi4's co-processor will copy the board's bootloader configuration From patchwork Mon Jul 31 21:55:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 13335535 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 EC622C04A94 for ; Mon, 31 Jul 2023 21:55:48 +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=ZQmidHRM0pfQP3QSjec/bFlV7d4XE9VA+7/SuyRbJ8A=; b=V3r0fgDpPSsNX2 xw7+4pC4GesCYy6wnF/jsydjBL51UrmhuNcnZ+wwZd2C2x2+3fAVPIyncunkIvDh3SprkFAyk5j1C yytr8WbIlsnqd5soiDebsMx/GSdBsnoydYuWV4ZRTgVU5jchHmTFGRoWK1CcFycV1NTVGvrdTWZfa imCZpA6uWViRbIxzYm2yse+wvaJ/B5VHEKIdeo9HFOfi1AtFmMek50EWsfb1C4EIOn0NIHu7aO8m9 0WV+XjR21SJXlbK1+r6ZzECSeSQukv+wVeSZEsPqPr4ZhepvBetCe6J9b6LGJaSuVzPyIemznS89d onW4IsWy5zxsGUxrW4FA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQarL-00HRFT-1e; Mon, 31 Jul 2023 21:55:23 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQarH-00HR9v-0n; Mon, 31 Jul 2023 21:55:21 +0000 Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B294F12AE; Mon, 31 Jul 2023 23:54:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1690840451; bh=gI98vGUVV8N9YZ5eUIyReE2x9lzEUaOgclZDt2Y6ZW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jKFLmnesw7NYHMftcOLcX9CZz27S8+8SVHBLN+RRWtJNYxk1TxYPbXzwE594Lw+mk 1WQTwWD3uX6WpjyG7mU/3Cb237H91CEFaBpeOcei+UCRFLfY+9GHaX3MsB8S0ZIKkz l/1cqPAUB3oSEH7Go3Kv/UK1LD9llhpSus+ZziEY= From: Laurent Pinchart To: linux-arm-kernel@lists.infradead.org Cc: linux-rpi-kernel@lists.infradead.org, devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, Florian Fainelli , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Cyril Brulebois , Maxime Ripard , Stefan Wahren , Dave Stevenson , Nicolas Saenz Julienne , Umang Jain Subject: [PATCH v4 2/2] ARM: dts: bcm2711-rpi-cm4-io: Add RTC on I2C0 Date: Tue, 1 Aug 2023 00:55:15 +0300 Message-ID: <20230731215515.20682-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230731215515.20682-1-laurent.pinchart@ideasonboard.com> References: <20230731215515.20682-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230731_145519_427823_1934C13A X-CRM114-Status: GOOD ( 10.19 ) 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: Uwe Kleine-König The cm4-io board comes with a PCF85063 on I2C0, connected to the GPIO44 and GPIO45 pins. Add it to the device tree. Signed-off-by: Uwe Kleine-König Signed-off-by: Laurent Pinchart --- Changes since v3: - Separate addition of the RTC to a patch of its own --- arch/arm/boot/dts/bcm2711-rpi-cm4-io.dts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4-io.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4-io.dts index d7ba02f586d3..0d9b328a215a 100644 --- a/arch/arm/boot/dts/bcm2711-rpi-cm4-io.dts +++ b/arch/arm/boot/dts/bcm2711-rpi-cm4-io.dts @@ -101,6 +101,22 @@ &genet { status = "okay"; }; +&i2c0 { + status = "okay"; +}; + +&i2c0_1 { + rtc@51 { + /* Attention: An alarm resets the machine */ + compatible = "nxp,pcf85063"; + reg = <0x51>; + }; +}; + +&i2c0mux { + status = "okay"; +}; + &led_act { gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; };