Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1096795rwd; Thu, 18 May 2023 07:58:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7xX3U+yHgteFB4Wq35lIoUaahRQmeRpW0Y+nqDOPerdr7hWJc4xk7K3jS9H/oZfvyYcOcW X-Received: by 2002:a17:90b:950:b0:23d:a2a:3ae4 with SMTP id dw16-20020a17090b095000b0023d0a2a3ae4mr2986466pjb.44.1684421892483; Thu, 18 May 2023 07:58:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684421892; cv=none; d=google.com; s=arc-20160816; b=JMVzDwsiecuKiu/+HoRWhjM//b9E/qOHhY4mwRahhQdRgw54CpsnEqngh59EmbeWjp 1dMsxjhDigp/qYPT7ZurNosQB+hTA/IdpHvBB2iEqh0Rx+NoYqxl+hfHEHaWRlY4FUsA 8R/LbbBJNk0ZocSzyby8jjYlcFpGeGZdOBJxS1jQy3d/l0X9TChFfDAzWZGM2st4pUGy oso1wZ34SGbzz2+KFSlSCvETstoxQk8X0IuxIQdAwC2/KwhCw8BdG4HUyn5Lb/8jxi5e WLvKqa3PzIjnOHpiUspRnIWrCajLup6CobsN5KgiUN7rxb6sceJ0iiGcBfeW7pQ8ELhs cDIQ== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=GoYD1HeZqxzJnofeUMnEjY7LdMkmo1HYZ+uW66yc8zI=; b=e+3Eb6PO8l+4Ufnv7O8DwwNjDtorPnbYgZqXUng3as9k8w8F65lKRTI3kQft0odDJN LTDO+ypIxnN00FjPwDKUGwtcKwPdB3F8IdyfXmHwhHh1hICSRUMKFzkKtkyEBx0wy4GE 2C2h/W3HPCPcjkjXUYqG9wauZsHd1CKrion9T5Wr03i4CzxG0FxGtMGccP//qkgz2zH8 rtSjeizxG3AcMcwjDLaynmx914j+q1HjignVTrSA1LEqt5dVOsRHn0ODS8En9d7L37bR gt4dMUSVb2F0+xPXrVoUMZNtvytlXuIqgZmmRo0Rc2/KUnH2pQwa4Or4Hym3R3lCcshM +FRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HGV4jjml; 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 hv15-20020a17090ae40f00b0024df86690a6si4312423pjb.135.2023.05.18.07.58.00; Thu, 18 May 2023 07:58:12 -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=HGV4jjml; 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 S229884AbjEROWB (ORCPT + 99 others); Thu, 18 May 2023 10:22:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231177AbjEROV7 (ORCPT ); Thu, 18 May 2023 10:21:59 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F253BF9 for ; Thu, 18 May 2023 07:21:56 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-510d8b0169fso2523101a12.1 for ; Thu, 18 May 2023 07:21:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684419715; x=1687011715; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=GoYD1HeZqxzJnofeUMnEjY7LdMkmo1HYZ+uW66yc8zI=; b=HGV4jjmlsteYJElUtUefnS224Lr+OvMC9jCbexLICYShcmDpIgspCiSW9L3B4wcnqG S14/K4bLbRvOJ0myk0FjPEDsZ+ahgME0WdXiPqDWR5e7OaomNpdfh8WAsQPKQsIPHrc8 +Mak7u6GkCmTK64G1EFj1x1QR25nhDgk8Swj8+tBxx3pN8fnKy8izlV2Brg2N+Qd+Znq jGYAUDCwVzonuMxlYhKefH/PrjKztdOOtBBPaqNah5BtMcJ3on8RryvhspF4NckTyPtw IYTHwgQHHMUGedJBIz9icwn1r59Y97Ppy2/8Ub14QbM4bJpUiVqe2H7zKtisfOu+/4qN BV8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684419715; x=1687011715; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GoYD1HeZqxzJnofeUMnEjY7LdMkmo1HYZ+uW66yc8zI=; b=WmIQxIPxDs53aZhj/M9QqMYsTpkh6qDUKrrHlPinqjMOLHOBRZU9AOWDMRKD07Z2yU WyvH4NkUdd1IQiYpmNLqUub4LYUn4wYWE7rraDqSadOu1IOb2XX6zEfETEoaTGvOuJ8V p+eyZhquatN1awSbnkntbieS/+HnLG0qZGeAvwlyxVbtusR03qgyw5CE3mqztoYLMx9h VkXYEw4Hv8OtECYCruxKMNbhJUXnZlcyVwdDn68l7F3fBGfpdqnFssKEGciraOHbSLNO 4ckU7dTaFNuVqzvvXchRQjwhUxVslcDiC+HcJopDLRrDxfAmK8LxpmsGbxlzzNpYNqKd L9NQ== X-Gm-Message-State: AC+VfDzqkbcUIcqBzsY8bYUVyufAzWIgz42jaGSPROhYIMhRn6NvQXyc nwws/pGDKVJ61Nb14uelzmtFgQ== X-Received: by 2002:a05:6402:516d:b0:50b:c971:c14b with SMTP id d13-20020a056402516d00b0050bc971c14bmr5546801ede.11.1684419715413; Thu, 18 May 2023 07:21:55 -0700 (PDT) Received: from ?IPV6:2a02:810d:15c0:828:7e24:6d1b:6bf:4249? ([2a02:810d:15c0:828:7e24:6d1b:6bf:4249]) by smtp.gmail.com with ESMTPSA id l16-20020aa7d950000000b0050bc9ffed66sm662448eds.53.2023.05.18.07.21.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 May 2023 07:21:54 -0700 (PDT) Message-ID: <5e0276b7-2c16-13a1-29d3-1936ffc52d23@linaro.org> Date: Thu, 18 May 2023 16:21:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH net-next v4 1/2] dt-bindings: arm: mediatek: add mediatek,boottrap binding Content-Language: en-US From: Krzysztof Kozlowski To: Daniel Golle , Marek Vasut Cc: Andrew Lunn , devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , AngeloGioacchino Del Regno , Qingfang Deng , SkyLake Huang , Simon Horman References: <55f8ac31-d81d-43de-8877-6a7fac2d37b4@lunn.ch> <7e8d0945-dfa9-7f61-b075-679e8a89ded9@linaro.org> <2048ed2a-ae6f-b425-38e4-4ba973e04398@linaro.org> In-Reply-To: <2048ed2a-ae6f-b425-38e4-4ba973e04398@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 18/05/2023 09:50, Krzysztof Kozlowski wrote: > On 18/05/2023 04:44, Daniel Golle wrote: >> On Fri, May 12, 2023 at 08:54:36AM +0200, Krzysztof Kozlowski wrote: >>> On 11/05/2023 17:53, Andrew Lunn wrote: >>>> On Thu, May 11, 2023 at 04:10:20PM +0200, Daniel Golle wrote: >>>>> The boottrap is used to read implementation details from the SoC, such >>>>> as the polarity of LED pins. Add bindings for it as we are going to use >>>>> it for the LEDs connected to MediaTek built-in 1GE PHYs. >>>> >>>> What exactly is it? Fuses? Is it memory mapped, or does it need a >>>> driver to access it? How is it shared between its different users? >>> >>> Yes, looks like some efuse/OTP/nvmem, so it should probably use nvmem >>> bindings and do not look different than other in such class. >> >> I've asked MediaTek and they have replied with an elaborate definition. >> Summary: >> The boottrap is a single 32-bit wide register at 0x1001f6f0 which can >> be used to read back the bias of bootstrap pins from the SoC as follows: > > Is it within some other address space? Register address suggests that. > > In such case you should not create a device in the middle of other > device's address space. You punched a hole in uniform address space > which prevents creating that other device for entire space. > >> >> * bit[8]: Reference CLK source && gphy port0's LED >> If bit[8] == 0: >> - Reference clock source is XTRL && gphy port0's LED is pulled low on board side >> If bit[8] == 1: >> - Reference clock source is Oscillator && gphy port0's LED is pulled high on board side >> >> * bit[9]: DDR type && gphy port1's LED >> If bit[9] == 0: >> - DDR type is DDRx16b x2 && gphy port1's LED is pulled low on board side >> If bit[9] == 1: >> - DDR type is DDRx16b x1 && gphy port1's LED is pulled high on board side >> >> * bit[10]: gphy port2's LED >> If bit[10] == 0: >> - phy port2's LED is pulled low on board side >> If bit[10] == 1: >> - gphy port2's LED is pulled high on board side >> >> * bit[11]: gphy port3's LED >> If bit[11] == 0: >> - phy port3's LED is pulled low on board side >> If bit[11] == 1: >> - gphy port3's LED is pulled high on board side >> >> If bit[10] == 0 && bit[11] == 0: >> - BROM will boot from SPIM-NOR >> If bit[10] == 1 && bit[11] == 0: >> - BROM will boot from SPIM-NAND >> If bit[10] == 0 && bit[11] == 1: >> - BROM will boot from eMMC >> If bit[10] == 1 && bit[11] == 1: >> - BROM will boot from SNFI-NAND >> >> The boottrap is present in many MediaTek SoCs, however, support for >> reading it is only really needed on MT7988 due to the dual-use of some >> bootstrap pins as PHY LEDs. >> >> We could say this is some kind of read-only 'syscon' node (and hence >> use regmap driver to access it), that would make it easy but it's not >> very accurate. Also efuse/OTP/nvmem doesn't seem accurate, though in >> terms of software it could work just as well. >> >> I will update DT bindings to contain the gained insights. > > If this is separate address space with one register, then boottrap > sounds ok. If you have multiple read only registers with fused values, > then this is efuse region, so something like nvidia,tegra20-efuse. Please align together on some common solution. It looks like you are solving the same problem: https://lore.kernel.org/all/?q=%22nvmem%3A+syscon%3A+Add+syscon+backed+nvmem+driver%22 Best regards, Krzysztof