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 AC8DAC001E0 for ; Thu, 3 Aug 2023 06:41:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231753AbjHCGlQ (ORCPT ); Thu, 3 Aug 2023 02:41:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231192AbjHCGlP (ORCPT ); Thu, 3 Aug 2023 02:41:15 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ED4ACC for ; Wed, 2 Aug 2023 23:41:13 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-52222562f1eso679290a12.3 for ; Wed, 02 Aug 2023 23:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691044872; x=1691649672; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=R3lDHqasLR71p6RjL20g3V1HU00B9G2u701BbTE8dB0=; b=JSK0Rb2m9+SiykNVmY0zcUcEzJqMFce01qKjOT2jA2sNtBiDW7Q5wP/8PYb0xAubX5 OLLWBWb/ZMhfjlQ+ZDPnQtk0+4ELNVckLJ/LmTIwdUra/GbRofxRC/w7/u4vVn3sXhqG CEwfm3CPM/VtIWkVqJRrKvaVGRUopBinM0epkU7hVGTVe/LeaoTWVT2g24U18S2O3Nzd O0SfJ9q+9i9BvMjroFP3Fwj7dGUPyLqJHfk1Vv9NZl7wdeXYyJJB8JdBHTjpwnr8eggb NykE3e755WTkJZuBovR4gaX2U06fXZf/0KnxYcNPE7H4iiqqWhuZejKcJio0NgigCHQV fU/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691044872; x=1691649672; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=R3lDHqasLR71p6RjL20g3V1HU00B9G2u701BbTE8dB0=; b=ZsU9X5HERSeIRuj0gzc1GmPE+Yto3ZeUDue0wV/gJiDzt2Hagi3Rjx3x39VPFva42Y hynpJZV7KHsWolkIFVfHiVhJtZ4/UMQP65L3w+YO2vrp2gXdMdcAICKGlGqfVol1NfRi 8XDQLgteOMYWvB6sbEncAItuSsRwqVNW1LcVn/hRNlsvq9+T1uD89kNt+YXgJkLdrt0Y Px0l/+ndxa31q0rsd2VYIC1yXOif9Vb0XsgP/BKKfuTdihZJ23/7dYtttlCZhuvZUXvG a2XWnWnoz5lGYngEWYduEekSfC8qMdPkZJk8qku07lFHI/JmZxm/v5lYYJPxpj99+zl6 54yQ== X-Gm-Message-State: ABy/qLa+WoSLP2H/E/I8Zgad0QIhp6W8uuXRNcI6h6lp0beeeDIOvV9d WEfV6eKpue2U9vYWN/OHM7FZrA== X-Google-Smtp-Source: APBJJlGpY86nu/tit00wHwCp6uIvWO0w7bGHc9EPU6c1uYz6cuhy6gZYp6qQQ+A4SgFiqCGgfc81NQ== X-Received: by 2002:aa7:d705:0:b0:521:e502:baf8 with SMTP id t5-20020aa7d705000000b00521e502baf8mr6868369edq.11.1691044871858; Wed, 02 Aug 2023 23:41:11 -0700 (PDT) Received: from [192.168.1.20] ([178.197.222.245]) by smtp.gmail.com with ESMTPSA id g17-20020aa7d1d1000000b00522854fb049sm9705791edp.2.2023.08.02.23.41.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Aug 2023 23:41:11 -0700 (PDT) Message-ID: Date: Thu, 3 Aug 2023 08:41:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.1 Subject: Re: [PATCH v2 1/2] gpio: dt-bindings: add parsing of loongson gpio offset To: Conor Dooley , Yinbo Zhu Cc: Conor Dooley , Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Jianmin Lv , wanghongliang@loongson.cn, Liu Peibao , loongson-kernel@lists.loongnix.cn References: <20230801-whenever-imitation-b2759b212f6b@spud> <20230801-varsity-chemo-09cc5e250ded@spud> <26adb487-f8c5-9cf4-5b31-070e9161e761@loongson.cn> <20230802-jailer-pavilion-84fb17bb3710@wendy> <3534f7b9-0e02-28c1-238a-5a6fdbb95e94@loongson.cn> <20230802-bunkbed-siamese-57ee53bdf273@wendy> <20230802-empathy-wound-70df4990a976@spud> <20230803-tartar-tainted-968687047460@wendy> Content-Language: en-US From: Krzysztof Kozlowski In-Reply-To: <20230803-tartar-tainted-968687047460@wendy> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 03/08/2023 08:30, Conor Dooley wrote: >>>> gpio0:gpio@0x1fe10430 { >>>> compatible = "loongson,ls2k-gpio"; >>>> reg = <0 0x1fe10430 0 0x20>; >>>> gpio-controller; >>>> #gpio-cells = <2>; >>>> interrupt-parent = <&liointc1>; >>>> ngpios = <64>; >>>> loongson,gpio-conf-offset = <0>; >>>> loongson,gpio-out-offset = <0x10>; >>>> loongson,gpio-in-offset = <0x8>; >>>> loongson,gpio-inten-offset = <0xb0>; >>>> loongson,gpio-ctrl-mode = <0x0>; >>>> ... >>>> } >>>> >>>> gpio1:gpio@0x1fe10450 { >>>> compatible = "loongson,ls2k-gpio"; >>>> reg = <0 0x1fe10450 0 0x20>; >>>> gpio-controller; >>>> #gpio-cells = <2>; >>>> interrupt-parent = <&liointc1>; >>>> ngpios = <64>; >>>> loongson,gpio-conf-offset = <0>; >>>> loongson,gpio-out-offset = <0x10>; >>>> loongson,gpio-in-offset = <0x8>; >>> >>> These 3 are the same for both controllers, no? >>> Is only the inten-offset a variable? >>> >>>> loongson,gpio-inten-offset = <0x98>; >>> >>> These offsets exceed the region that you've got in the reg property for >>> this controller, do they not? >>> >>> Is there some sort of "miscellaneous register area" at 0x1FE104E0, or >>> just those two interrupt registers and nothing else? >> >> >> 2k500 gpio dts is just an example, like 3a5000, or more other platform, >> above offset was different but the gpio controller was compatible. >> >> gpio: gpio@1fe00500 { >> compatible = "loongson,ls2k-gpio"; >> reg = <0 0x1fe00500 0xc00>; >> gpio-controller; >> #gpio-cells = <2>; >> ngpios = <16>; >> loongson,gpio-conf-offset = <0x0>; >> loongson,gpio-out-offset = <0x8>; >> loongson,gpio-in-offset = <0xc>; >> ... >> } > > That is a different SoC and needs to have a different compatible string. > "loongson,ls2k-foo" compatible strings were a mistake that only got past > us because we were not aware it was a family, rather than a specific > SoC. They certainly should not be used in isolation on a 3a5000! > > Are there more than one GPIO controllers on the 3a5000? If so, what do > those nodes look like. Eh, even for the same SoC having different offsets suggest that programming model is a bit different. Anyway, who designed such hardware? Really? Best regards, Krzysztof