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 45383C6FA8E for ; Wed, 21 Sep 2022 11:57:28 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C4B0384B92; Wed, 21 Sep 2022 13:57:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="aSUoUeX0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A8FD284B92; Wed, 21 Sep 2022 13:57:24 +0200 (CEST) Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) (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 7C57A84C99 for ; Wed, 21 Sep 2022 13:57:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=zajec5@gmail.com Received: by mail-ej1-x62f.google.com with SMTP id sb3so13038467ejb.9 for ; Wed, 21 Sep 2022 04:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date; bh=zZOjctsMopcPTCqR+GOFuJIBjyunSAlM0WaVgIg4/7c=; b=aSUoUeX0IHnJUQPwiAhXRaCSi8d02ZkSmFZy3K7kP89id2PLgd8uk+8XuTecVkwJHD ZqyiU1BRjNXun20tnInSPvrWiIFyiWcO9jx36R9F3VW1Awy4znClSme9xoEs1WzyDobz a/h0mlqJeIDZwcGlmc5QD8bxWRYwEqCNpNQrzFQVivSEnKRzx14OPzUx7F7VIzUXt927 8BTY+tHI/H87eUEY8TamRt1YoUgbNX6LyqCUv14H36zTwahfPL8w6W/QNzqudCJkdkBb drYSy7BwqHhSijAEHEP2xCrETOli3S5VmssPhCHF0m6jqBMON6SF9OIAMiCt8DNfGkob ETXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date; bh=zZOjctsMopcPTCqR+GOFuJIBjyunSAlM0WaVgIg4/7c=; b=nfpHFyXbQV096jDc/+1MPFXulUe4Hg94YCXXfVkLq5CPGXK8xXRegc0LVjjY+Tsv2M CSnNMijaInRblVM63dwYkskHCmOwavHIuml56qga4CDOSIra9cF8mo6FZO+myz9xkAZ+ MmsbJ3Dee7vhvbNnooHuLonYr4OBR/42mDPRsNJBpmc2iWDtH0GmycWHx0DjSa4VunbT rpXS3m6JOsgBLaqJiUYM8qZnA5LNcVSPCXFBUTFJdbWyQGFWDK9GuIRIQzszutLvN3mk MT6MmeMv2jGlxdKDKjhdHe29UthgwcLm6SpEnrRvPXxQdt7vzfG2+E3SI73ifHWvcBq3 mMkg== X-Gm-Message-State: ACrzQf1BjBUVki31pfUtLqUigx1fYxJUeWlSKMdssImfYNywFxdwbBNb rEW5v/fYOknLAIZJBJdTTAE= X-Google-Smtp-Source: AMsMyM4YwAIxh8a3m6wJMQ14CPbVq8t1NwSXDmewAdU9eeBs/bmeYfufiy4YWtgHy9ogl4X4v0QM+g== X-Received: by 2002:a17:907:1c03:b0:77b:9d77:c5 with SMTP id nc3-20020a1709071c0300b0077b9d7700c5mr20338078ejc.225.1663761439966; Wed, 21 Sep 2022 04:57:19 -0700 (PDT) Received: from [192.168.26.149] (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.googlemail.com with ESMTPSA id dk11-20020a0564021d8b00b00454c5d9eb37sm1296313edb.30.2022.09.21.04.57.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Sep 2022 04:57:19 -0700 (PDT) Message-ID: Date: Wed, 21 Sep 2022 13:57:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:96.0) Gecko/20100101 Thunderbird/96.0 Subject: Re: [PATCH] dt-bindings: nvmem: u-boot, env: add Broadcom's variant binding To: Rob Herring , Joel Peshkin Cc: =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Krzysztof Kozlowski , Srinivas Kandagatla , Tom Rini , Florian Fainelli , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "u-boot@lists.denx.de" , Broadcom Kernel List , linux-kernel@vger.kernel.org, William Zhang References: <20220406152515.31316-1-zajec5@gmail.com> From: =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 7.04.2022 20:17, Rob Herring wrote: > On Thu, Apr 07, 2022 at 04:55:14AM -0700, Joel Peshkin wrote: >> The first 32b value is a magic number (endian swapped mnemonic of "uEnv" >> short for "u-boot environment"). Finding that magic number of a 4K >> boundary followed by a length and then a u-boot environment with a valid >> CRC permits a scan of the flash partition to locate the environment without >> knowing a-priori where it is. > > So it doesn't need to be described in DT? But how does one identify > whether to scan the flash or not. You wouldn't want to do that one every > platform. IOW, it's a sufficient discovery mechanism for a custom build, > but not generic OS. I can't tell if U-Boot is ever going to handle discovery based on that binding. I still find it very practical for operating systems (like Linux). Consider: &flash { partitions { partition-loader { compatible = "brcm,u-boot"; partition-u-boot-env { compatible = "brcm,env"; mac: ethaddr { }; }; }; }; }; &enet { nvmem-cells = <&mac>; nvmem-cell-names = "mac-address"; }; That allows operating system to have: 1. Driver for finding env data subpartitions [1] 2. Independent driver parsing env data structured with Broadcom's format [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=27bfb201b2c03c8a033b60e5ad80cbf3aaa52b94 If you don't like it, another option could be to use "u-boot,env" and then make U-Boot env data NVMEM driver detect actual format. Please let me know if any of above options looks acceptable or if you can think of another solution.