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 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 09F00C32793 for ; Wed, 18 Jan 2023 18:33:24 +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:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lovF8OUmDl9r7ezVI+1b5RX6yr8mdfZaZXsNIuDO2H4=; b=rjS7R4yXPQwBzL 6IpvDKWitg0LU137+DcWU0W+BDvdMzYLAbDyXWYcaYVLiocMNaUlcp0BhRpEweRJQM0zy9XVomzFK XxEBNbAGLKOCo87Gnwy4JBY7SjMtykeACrbGUi7XslCGDQJFosoPxJu1yih67BVxYwlGgyQr1KpHX aUH89xU0XLKQbzwKTLCLoym4IWHfFW0IMwnMsdwT88EcWPDfHNm/IL9vvvgRj7tonnDX7Q1mlqBe/ bHNyPn9hfPXe0nhmL8CacEg6++7UhqgDUoykUZ7aWeZp5LtkGCvmuqaAq3ZyJ41d64+/8tNt5ewVm IPtYf1GrYXx0le0pMINA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIDEU-002KoU-Tr; Wed, 18 Jan 2023 18:32:23 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pIDEQ-002KmJ-6J for linux-arm-kernel@lists.infradead.org; Wed, 18 Jan 2023 18:32:19 +0000 Received: by mail-wm1-x32e.google.com with SMTP id q8so13578306wmo.5 for ; Wed, 18 Jan 2023 10:32:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=MDOMgu1R5MZdFuG1WoMkXEWXWPDB9V7oXEVPOSPFqMk=; b=WHaUr7JkLqMIDHA/hXsqBjkSWmDZFiUxCHf2dftPrBezsoW+dLizp4JrGqrPYf3WLl JOm5jBVrjlBDqw5Ha/qcs+r/dwUOKQCzYpcjU/p04GEBOccP9SeLIz6EDm/vLWbo8tBW hhP3cVm1n6WGcDMAyMBWpQlW8F1PpQp5l0Qpge5N4cUjxUm/ty47jo8J4zHUcSvJ5vOA uCzsdRdwwtJTcc2fW7Pg6xl1CgeYurWytPgfrvv3PGxI3FiNCLWGc9M0i6VWbXlKpWUX S5zfo7sem5bmk2tW1QoVf3Swfgrwvtg28GBXWO3v/IVC9sjGqgTrpxoDQVkt1cLUwWeA FL4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MDOMgu1R5MZdFuG1WoMkXEWXWPDB9V7oXEVPOSPFqMk=; b=ucQq/qpVZTmHCEWBbrMQDd7pZHys6LqZOkdo9qdUE9Nu2DctSA7Wagvq1zSFEBYx2E W1+BAG/47MvonCjvYfz2CGY0FfqqxKFHN/TTvTv9U1ika0yPgE9sId/pfSmHj2v8zifF UvVyBCo6DSa//TGxipnt4vViYzo51ALcowL5zH+l+HJrwbATU7+9tXPhpEgzvOfPHeX4 26bB+zSc4Dh8TL+lR/mirTxNvViEp2la/jjF3gK5wh67iHMJO07zqJVYmDbEDiLKYVgL HWY5szbk6u5+eF3TNGpz9JqA5BpE07FoFQuBX4CKGViuOCd1+v9WZKboGbFwT7QdZ7bN cn3g== X-Gm-Message-State: AFqh2kozaifXBfctyP2Plilry4746axy0jZR0xqB2ZCcLrA3pE/ewKUS QwPDNMQvYvj++46H2tIGwHObtw== X-Google-Smtp-Source: AMrXdXtdP5gAkiej7sOvZztosqeKCQeZenZx5m8n552mmlJwQ5zMJxYUgthGWLC97j6Vtmg0xkfOIw== X-Received: by 2002:a05:600c:214f:b0:3d9:ecae:84f2 with SMTP id v15-20020a05600c214f00b003d9ecae84f2mr7409139wml.25.1674066734461; Wed, 18 Jan 2023 10:32:14 -0800 (PST) Received: from [192.168.1.109] ([178.197.216.144]) by smtp.gmail.com with ESMTPSA id bg1-20020a05600c3c8100b003db09eaddb5sm2270616wmb.3.2023.01.18.10.32.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Jan 2023 10:32:13 -0800 (PST) Message-ID: Date: Wed, 18 Jan 2023 19:32:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.0 Subject: Re: [PATCH v1 1/4] dt-bindings: gpio: rockchip,gpio-bank: add compatible string per SoC Content-Language: en-US To: Johan Jonker , Rob Herring Cc: linus.walleij@linaro.org, brgl@bgdev.pl, krzysztof.kozlowski+dt@linaro.org, heiko@sntech.de, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kever.yang@rock-chips.com, sjg@chromium.org, philipp.tomsich@vrull.eu References: <08de3f4b-e33f-95c8-3297-814ea107272a@gmail.com> <20230118153236.GA33699-robh@kernel.org> From: Krzysztof Kozlowski In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230118_103218_338694_A55F3D98 X-CRM114-Status: GOOD ( 23.43 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 18/01/2023 18:12, Johan Jonker wrote: > > > On 1/18/23 16:32, Rob Herring wrote: >> On Wed, Jan 18, 2023 at 01:13:23PM +0100, Johan Jonker wrote: >>> Currently all Rockchip gpio nodes have the same compatible. >>> Replace all the compatibles in gpio nodes to be able to >>> give them a consistent ID independent from probe order or alias. >> >> I fail to see how the compatible change affects probe order or aliases. >> It is also an ABI break if there is not the existing compatible as a >> fallback. State the problem you are trying to solve with this change, >> not just what your solution is. > > Hi Rob, > > Since the yaml conversion of rockchip,gpio-bank.yaml we have generic "gpio" names instead of "gpio-1". > For both Linux and U-boot there's a need for a consisted ID order between the nodes. Still do not see how compatible is related to this. > > The kernel has no logic to decide between the first compatible and the fallback. > A fallback doesn't have ability to add/select "data" with probe, but have to use > of_device_is_compatible(np, "rockchip,rk3188-gpio-bank") for "15" SoCs instead. > > I can produce a serie with fall back. > Let us know how to move forward here. > > Kind regards, > > Johan Jonker > > > === > Linux driver behavior: > > id = of_alias_get_id(np, "gpio"); > if (id < 0) > id = gpio++; > > Problems: > Alias not always available in existing DT files(not part of the binding) > Probe order is not guarantied and possible number gap for rk3066a between gpio4 and gpio6. > (id counter gives not consistent result) Again, how compatible is related to this? > > === > U-boot rk_gpio.c current behavior: > > end = strrchr(dev->name, '@'); > priv->bank = trailing_strtoln(dev->name, end); > priv->name[0] = 'A' + priv->bank; > uc_priv->bank_name = priv->name; > > Problems: > Crash when node name has no "gpio-1" format > > U-boot rk-gpio proposed: > > priv->name[0] = 'A' + dev_seq(dev); > uc_priv->bank_name = priv->name; > > Problems: > Reduced FDT's and rk3066a gives number gaps. > > === > > My proposal: > > struct lookup_table rk_gpio_rk3188_data[] = { > {0x2000a000, "A"}, > {0x2003c000, "B"}, > {0x2003e000, "C"}, > {0x20080000, "D"}, > }; > > { .compatible = "rockchip,rk3188-gpio-bank", .data = &rk_gpio_rk3188_data }, Which you did not do... Your patch is doing something entirely else. Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel