Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3421777pxj; Mon, 7 Jun 2021 10:10:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZZF9O3uhwQoC7ASBeZXLD+v4znDG1MlStwgm0ZHH3n1Ex6mUd+8XG7xjgnOcT2xXpR9bd X-Received: by 2002:a05:6402:1c11:: with SMTP id ck17mr21630236edb.102.1623085846900; Mon, 07 Jun 2021 10:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623085846; cv=none; d=google.com; s=arc-20160816; b=xEqs9cIg+gaM4TjruHMMaPzNr3ezLl3Qn3mF8WsE8uPDZ9a7zlqS+56IzjCsyZqKWk 6Odyl5Grw3+FfVa9zVB03iex0OX+WtLxSCjLLEUVIcImNl4KqA1DSvN6UCpgIg9+Umf4 qmHW1e182WDvJjMlOfciwYGUjRzgrxi4fETUUxiGBZ1WB4P6EamYn/pXfud8KddswIpR vrrg/SMgUUnSF5uekzD5a2zkJSrmx+lG6dSRv9p7iC8B3wdC6jdOsAo5KKtVH7gcIYye mSeuBA65sdqdrcBJpi9zSxePM9Qprsi3CThY6pBqicUJeN5ev1hsllqyTu++1h1U9jMp iTdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:reply-to :in-reply-to:references:mime-version:dkim-signature; bh=HjDyLoLkj907ku+cVivoU2ADhBU6nIkONsgYg22m/s4=; b=rYKRHBh9wd7vLHPADKTdZ0NTJ7lPgfn2XgM3kncVDCb15VEgadHoLAbwZLuy+5EEf4 kKZWQuSu4V/LX59Y9vGkz7uFQhYdbUXKX1W1BEl/pQ5AlKtlvw9vXL9+NQt7UnOMxvmW 43DQun6sOri2TlUSvLz2ezlM6yXtpRlnNsfXcMagKQWr3ZRynOnJVUTdqcpFP3UuyMJk oCqWum4cvljSoI+OAP6fnpcCtfFEF/n6IptzFcCsWHql73eRZVpWE3iTuPQ5qGKZa5qO B4jiDRpcLLiJeTc7WF23qqBZeButvyEVB7hFAF5OBuDjY14/B9QhGDd0GJ05H+twfLkP n+yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NBxgeIYx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt21si11910659ejb.198.2021.06.07.10.10.24; Mon, 07 Jun 2021 10:10:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NBxgeIYx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230462AbhFGRKk (ORCPT + 99 others); Mon, 7 Jun 2021 13:10:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:35034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbhFGRKj (ORCPT ); Mon, 7 Jun 2021 13:10:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 46E9E60FF2; Mon, 7 Jun 2021 17:08:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623085728; bh=yM2Bv4i0UNJzWGQmilGq5A1RQVj7SOXQdiQtMQxCjMM=; h=References:In-Reply-To:Reply-To:From:Date:Subject:To:Cc:From; b=NBxgeIYxc1rE4xVU2M72A48E+VdaYqmyQV2If6DQsBbMTtGx4aQyKLpWZfK5XMCw0 v+DKU99VyqPXsaZQiSviCIDqkPqoEf1qGx7ZQV+XPqa1Slvn23dapSAidLn5RfHQMu V25koMMp7B2bClmCW/0vzbhYsMYhBv09Au/qZ4fYjit5DV9x6b6vEf/CDNJIYhLD6H RcNGvrJPBMZlECb3/9vQ41Xp++LaXDkgq6VgBKiYoA9ir6+fbAEGbAqcMTZ8SNehbL 5QiprsdThyHFE7G+72Egyx0T2cAp9j6l9kBNIr1ckyKeR2eL7X7stq+wgAxEQDymeT lEP7bf8kOOYWA== Received: by mail-lj1-f177.google.com with SMTP id 131so23248761ljj.3; Mon, 07 Jun 2021 10:08:48 -0700 (PDT) X-Gm-Message-State: AOAM530EMMoOqUnUj1abnOX5KtQiL3rqaJ76xUK4sH1gXGc5/+dSmnKM IUtgYuOtYGVaNOeW872FFZZAYNE4HGj+pbvA7rg= X-Received: by 2002:a05:651c:1501:: with SMTP id e1mr16143057ljf.74.1623085726619; Mon, 07 Jun 2021 10:08:46 -0700 (PDT) MIME-Version: 1.0 References: <20210607081727.4723-1-cnsztl@gmail.com> <9258ab23-ef65-2c3d-f0d2-ca5f77d7c12a@gmail.com> In-Reply-To: Reply-To: wens@kernel.org From: Chen-Yu Tsai Date: Tue, 8 Jun 2021 01:08:35 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arm64: dts: rockchip: add EEPROM node for NanoPi R4S To: Johan Jonker Cc: Tianling Shen , Rob Herring , Heiko Stuebner , Marty Jones , Pavel Machek , devicetree , linux-arm-kernel , "open list:ARM/Rockchip SoC..." , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 8, 2021 at 1:04 AM Johan Jonker wrote: > > > > On 6/7/21 6:01 PM, Tianling Shen wrote: > > Hi Johan, > > > > On Mon, Jun 7, 2021 at 6:26 PM Johan Jonker wrote: > >> > >> Hi Chen-Yu, > >> > >> On 6/7/21 11:40 AM, Chen-Yu Tsai wrote: > >>> On Mon, Jun 7, 2021 at 5:31 PM Johan Jonker wrote: > >>>> > >>>> Hi Tianling, > >>>> > >>>> On 6/7/21 10:17 AM, Tianling Shen wrote: > >>>>> NanoPi R4S has a EEPROM attached to the 2nd I2C bus (U92), which > >>>>> stores the MAC address. > >>>>> > >>>>> Signed-off-by: Tianling Shen > >>>>> --- > >>>>> arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts | 9 +++++++++ > >>>>> 1 file changed, 9 insertions(+) > >>>>> > >>>>> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts > >>>>> index cef4d18b599d..4a82f50a07c5 100644 > >>>>> --- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts > >>>>> +++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts > >>>>> @@ -68,6 +68,15 @@ > >>>>> status = "disabled"; > >>>>> }; > >>>>> > >>>>> +&i2c2 { > >>>>> + eeprom@51 { > >>>>> + compatible = "microchip,24c02", "atmel,24c02"; > >>>>> + reg = <0x51>; > >>>>> + pagesize = <16>; > >>>> > >>>>> + read-only; /* This holds our MAC */ > >>>> > >>>> The mainline dts files should be generic I think. > >>>> Any comment about "use", partitions or write ability should be avoided. > >>>> It's up the user. > >>> > >> > >>> Per the datasheet for this specific EEPROM, the latter half (128 bytes) > >>> is read-only in hardware by design though. > >> > >> The 24AA02XEXX is programmed at the factory with a > >> globally unique node address stored in the upper half > >> of the array and permanently write-protected. The > >> remaining 1,024 bits are available for application use. > >> > > > > > In my opinion, as this contains data programmed by the factory, would > > it be okay to keep it read-only? > > This chip is not completely read-only. > There might be users that like to try some other mac_address or store > something else in that lower part. Is this then still possible? > Generic DT describes hardware independent from what Linux drivers or > other OS are capable off. > This factory mac_addres is permanently write-protected, so no need to > keep the rest read-only. > > nvmem-cells = <&new_mac_address_in_lower_part>; > nvmem-cells-names = "mac-address"; > > > > >> Just a question... > >> > >> nvmem-cells = <&mac_address>; > >> nvmem-cells-names = "mac-address"; > >> > >> Which part does this point to? > >> > >> Can we use the lower part to store/rewrite this too? > >> > >> === > >> > >> From at24.yaml: > >> > >> items: > >> - pattern: > >> "^(atmel|catalyst|microchip|nxp|ramtron|renesas|rohm|st),(24(c|cs|lc|mac)[0-9]+|spd)$" > >> - pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$" > >> > >> How does Microchip 24AA025E48 fit the regex? > >> What compatible would you advise? > > > > It seems that 24AA025E48 is a variant of 24MAC402 [1], and > > `atmel,24c02` will be okay in this case. > > 1. https://lkml.org/lkml/2018/1/24/494 > > Ask Heiko. ;) > > As long as it does not generate more notifications then we already have. I think having a part specific compatible would be better. That way if someone wanted to implement read-only "feedback" to users for the second half they could. ChenYu > > > > Thanks, > > Tianling. > > > >> > >> === > >> > >> Johan > >> > >>> > >>> ChenYu > >>>