From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 476E9C433F5 for ; Tue, 15 Feb 2022 14:46:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232885AbiBOOqK (ORCPT ); Tue, 15 Feb 2022 09:46:10 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239175AbiBOOpw (ORCPT ); Tue, 15 Feb 2022 09:45:52 -0500 Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [IPv6:2a01:4f8:150:2161:1:b009:f23e:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CC0311628F for ; Tue, 15 Feb 2022 06:44:11 -0800 (PST) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 4D44E100D5867; Tue, 15 Feb 2022 15:44:09 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 288D42EDABB; Tue, 15 Feb 2022 15:44:09 +0100 (CET) Date: Tue, 15 Feb 2022 15:44:09 +0100 From: Lukas Wunner To: Stefan Wahren Cc: Linus Walleij , Nicolas Saenz Julienne , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, linux-gpio@vger.kernel.org, Lino Sanfilippo , Philipp Rosenberger , linux-rpi-kernel@lists.infradead.org Subject: Re: [PATCH] pinctrl: bcm2835: Use bcm2835 gpio_chip label for bcm2711 Message-ID: <20220215144409.GA12830@wunner.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Tue, Feb 15, 2022 at 01:00:47PM +0100, Stefan Wahren wrote: > Am 15.02.22 um 06:52 schrieb Lukas Wunner: > > Commit b1d84a3d0a26 ("pinctrl: bcm2835: Add support for all GPIOs on > > BCM2711") used a different label for the bcm2711 gpio_chip vis-à-vis > > the bcm2835. > > > > That breaks compatibility for GPIO_LOOKUP_IDX() and GPIO_HOG() clauses > > when porting from older Raspberry Pi Compute Modules to the CM4 or CM4S. > > could you explain the breakage more in detail, is it kernel or user space? This kernel module (which is sought to be upstreamed mid-term) requests GPIOs at runtime for a chardev: https://github.com/RevolutionPi/piControl/blob/master/revpi_core.c#L50 That fails on BCM2711 because a different label name was used, even though the pin-controller is otherwise compatible to BCM2835. > A little bit off topic, but what is this CM4S? Is it special version of > the CM4? Can you provide a link or something? BCM2711 in a CM1/CM3-compatible form factor. There is no public documentation at this point besides the device-tree overlay and what's being discussed in the forums and on GitHub: https://github.com/raspberrypi/linux/blob/rpi-5.15.y/arch/arm/boot/dts/bcm2711-rpi-cm4s.dts https://forums.raspberrypi.com/viewtopic.php?t=325975 https://github.com/search?q=cm4s&type=commits > > The name change seems unwarranted given it's essentially the same > > hardware, so use the old name instead. > > I disagree at this point. The pinctrl of bcm2835 and bcm2711 are > different. For example the bcm2835 has only 54 GPIOs while the bcm2711 > has 58. Four additional GPIOs don't justify a different label name given the pin-controller otherwise behaves the same. We also had minimal differences in pin assignment on BCM2835/6/7 and that didn't justify a different label name either. Thanks, Lukas