Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1845383rwo; Thu, 3 Aug 2023 00:03:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlE7ZadVCBFpddGepjrjPWxwqjxqVgSjH539VSGRrg89Fp1mgZ9wKZ7+IoLIfx0l+axQU2uM X-Received: by 2002:a05:6870:23a7:b0:18b:1936:30ee with SMTP id e39-20020a05687023a700b0018b193630eemr18857384oap.56.1691046232319; Thu, 03 Aug 2023 00:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691046232; cv=none; d=google.com; s=arc-20160816; b=c/3tmFqza+U06jPWQ8cPEfFAeyuzaEtaDTDNEyIbYPaoPCZ752H77rN4i6IEWnzzsz jiGzizHkAEb2qDBIAxahzVW4JYhWPSn9dtu5mYM4jawhT18iR4fMjwJKlvNf4+FC2tJa OTu5gCkjkjpXgnpuiPxazNuNaLMt3jUMp8r/uckdonLkobEVQX1sg33DkzuJH8+oAHsm /tE8n97trkwrT/8OdUvL9fKlEuI/F8HQ/i8hAobL3dIEo6sAEr0V2RgowF8mg0H0qhXS HufLWTaMvx7Pm0UIWltu3nlS3yUx3jo9RsAICiTQb5u2Kdl8FEAgjef9NdrAC5QX6uL2 UZlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=R3lDHqasLR71p6RjL20g3V1HU00B9G2u701BbTE8dB0=; fh=wWhaZvwnur9zexxtmMqaEpSmh3kBK0My0x+0GNN9p+0=; b=lZEr1wrz6N4nHJ+ljRCk00jf4ANoY6YfDzNFlZkGVxY+jYBy/t+hhj9lYoEdwSTyh+ KV3X+RL2R8HZE5ex8/sCyWZZ9ipBfSzNcavt6R9vMd/tIOKd/sHLhygfFf2SKkK70eC6 jJWMDIA0sdgCgfjJxeff1rhpy/1ZtntAe3QXIKCKaDV7zL5KTiFuq2Z7CPxGZcZ1DV1B vTjAkriUfBAgL2CPiOgHSrKaX9WfO367JnKR4Pv+97TS9SRlRzjCNsY6joglzFjpVoES VqqGBynVQI2+XoHgNFS0C9emOA2Ea/nXS01fyr+CFkpuGFOY71QXwXof6O2h7JOcqc1N +mag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JSK0Rb2m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a17090a410600b00263a985aba5si2491400pjf.149.2023.08.03.00.03.31; Thu, 03 Aug 2023 00:03:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JSK0Rb2m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230005AbjHCGlQ (ORCPT + 99 others); Thu, 3 Aug 2023 02:41:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230202AbjHCGlO (ORCPT ); Thu, 3 Aug 2023 02:41:14 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C9DDC0 for ; Wed, 2 Aug 2023 23:41:13 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-522ab301692so677749a12.2 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=kZ8hOdddjqwOO8vXNxxz0N1/o1biRy39MmsSGFCpfG4eKs8u28rspaG+2Rzrq7K3HO k1FW1erBAJJ9O6CiZvVBF4gaIYFDGrlUTYvLxFwPZUWPTLhg09KyEPiDQQvE2qNeYEvS 2e+OOIx7BikPOMmXb0X8r/Avpy0PrNHffjVXuUYvrIlfNVn9jc4JxHJ3tayYvjkk2741 tm0gCbaXV+S+1lDoF3toK91rQmJYesqBKbBTy8qC4CXr0QPtoSw8gNky0pjy+mCCyE93 Ws26a8OswLmyGuZstYuuzc4Fx8/QCAVhTEwXpDsZBE8nk/p4Dh92BvrJ83QTih+2t5/F rxGw== X-Gm-Message-State: ABy/qLZ4FTiBMQRrFos2xjRnDpjFzyLSPWPSktHNeEBOpuJ9b3B1APMT oaWjxIqLx4vo+t/cuqrI6Y1qUg== 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 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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