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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A27AC4332F for ; Wed, 23 Nov 2022 15:11:49 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8F8EA852C3; Wed, 23 Nov 2022 16:11:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=monstr.eu Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=monstr-eu.20210112.gappssmtp.com header.i=@monstr-eu.20210112.gappssmtp.com header.b="qitN+cUP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B345A854B4; Wed, 23 Nov 2022 16:11:45 +0100 (CET) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 094CB852BD for ; Wed, 23 Nov 2022 16:11:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=monstr.eu Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=monstr@monstr.eu Received: by mail-ej1-x629.google.com with SMTP id f27so43556647eje.1 for ; Wed, 23 Nov 2022 07:11:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=DC8bq3SOArSK+J6M2sHDiBGroB2crMRXwrrdSZvoAjI=; b=qitN+cUP/SEuaSck4F3BrpiM5r0thUTaDMM6My3Fawg3AkFLYD7cB/i3ocgKCqLJiF e2VW76eeSTDooReUNkIXErGrNiYFKPrv65HeBNsPI8R9ebYZ8Ww0qRlAtJ0smrkNsNW9 EVIbD3Lpklk6lOtUpIt5j9B+OrQLG1HG7v8K3aZ65nekzzHajlMHYGAAEBMHUS5Q6pYX 2ADsVUvIcUljyXfOlavNgVEHpGyyMfKSit638W8bK/m9/fCsdy0HhW8QXVPntcvArxqq 95Rdu4MXV50TMzvOPeITUjBn5fyfa+Xe43MySo+3t4R1K6UVVDZMEgHah3uQcGgEkpv4 P54A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DC8bq3SOArSK+J6M2sHDiBGroB2crMRXwrrdSZvoAjI=; b=I8oTW2xmD4XpIVh5ekS4v+plt1xacokENbmkxDb//N9aaWEoWhAdduSH0ceHGu3EmR BbhElvYtPKRGDL946mNSLLtmbutzYjvMnQsBFsqGxRqBgR4mDSp24+NWM1cHWGqpKOaz SsVGp909g1VOBFdIU0wFesD+5oOTNELatstpX5tASeNnEorawxtHSINqhZL2QBkHxnI2 XZ07U97aResAOR+NuIRtnoyG2swx8XtFVfyft14ZPvVwmmLdNljFEJfVnzRB3ZgYel8J xIq7lcQRPtrFme7MIehEs3LinFNAseU6vx/CTe3Sf8Wv+WWm/9+R4SEMgzYJI+TqWIFi 9/fg== X-Gm-Message-State: ANoB5pnLfFK12MH66/BKhLKT6h0vs990/M+PI5MEmbBwiKvn52rhcVeh fWST7zg7AnYzrWH3UYQI+ldTaQ== X-Google-Smtp-Source: AA0mqf6MEeDidC6tZGfljeTmmJtYTp9ljSh7iaWrpvyrw+o5hHWusSD64rXi6IOrRnqDBCB7q7E86w== X-Received: by 2002:a17:906:b51:b0:7ad:da22:c396 with SMTP id v17-20020a1709060b5100b007adda22c396mr24596629ejg.653.1669216302598; Wed, 23 Nov 2022 07:11:42 -0800 (PST) Received: from [192.168.0.105] (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id z6-20020a170906668600b007add1c4dadbsm7311472ejo.153.2022.11.23.07.11.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Nov 2022 07:11:42 -0800 (PST) Message-ID: <7f3a1efd-2e44-70b3-2479-d7287dc1865f@monstr.eu> Date: Wed, 23 Nov 2022 16:11:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Content-Language: en-US To: Michael Walle Cc: d.antliff@unsw.edu.au, seanga2@gmail.com, u-boot@lists.denx.de References: <5381fce5-7227-9920-5956-4ce33e4d0070@monstr.eu> <20221123132730.2083267-1-michael@walle.cc> From: Michal Simek Subject: Re: Setting MAC address from I2C EEPROM - debug / commands? (Xilinx) In-Reply-To: <20221123132730.2083267-1-michael@walle.cc> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On 11/23/22 14:27, Michael Walle wrote: >>> ethernet { >>>     nvmem-cells = <&mac_address>; >>>     nvmem-cell-names = "mac-address"; >>> }; >>> >>> You'll need 2022.07 for this I think. This is the same method which >>> Linux uses. I added this specificly to be able to load MAC addresses >>> from EEPROMs without needing to hard code stuff into Kconfig. >> >> This looks good and I see Sean wired it in the U-Boot already. It should work >> fine with all Xilinx formats but on boards just for MAC address. (FRU format is >> also designed in a way that the same boards have MAC address at the same location). >> The code I described above is also checking in FRU format that checksums are >> correct and also reading more information from it for other use cases. > > You might also be interested in the new NVMEM layout patch series: > https://lore.kernel.org/lkml/20221118185118.1190044-1-michael@walle.cc/ This is interesting. But how can you use the nvmem-cell description for mac address reading which Sean mentioned above? Also DT description is saying that you are particular format but it doesn't mean that data is correct. I see that pretty much you can in add_cells refuse to create description if CRCs fails but maybe any format autodetection would be good to have. AFAIK Xilinx is using 3 formats now where 2 are legacy and FRU which is very similar to onie-tlv. Thanks, Michal -- Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel - Xilinx Microblaze Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs