From patchwork Thu Jul 22 11:58:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1508661 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::43b; helo=mail-wr1-x43b.google.com; envelope-from=swupdate+bncbcxploxj6ikrb5v24wdqmgqer7hzw6i@googlegroups.com; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=mbK+D8+O; dkim-atps=neutral Received: from mail-wr1-x43b.google.com (mail-wr1-x43b.google.com [IPv6:2a00:1450:4864:20::43b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GVrZk0Gj8z9shx for ; Thu, 22 Jul 2021 21:58:52 +1000 (AEST) Received: by mail-wr1-x43b.google.com with SMTP id a4-20020a0560001884b02901401e436a18sf2367868wri.21 for ; Thu, 22 Jul 2021 04:58:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1626955127; cv=pass; d=google.com; s=arc-20160816; b=eXRYGT3n324egzkInKg5my9K4TLua8VfrM1yhZd9Z5tlfO28xay8WTlmbUCtVBp7d5 vn6tC9pszJBZ/TaZkZZmEE9A7leLKE/UyA6/a8ub4NbLWoGA3zEZt1bzDgkMEDTtaOht /xxMLTMrCprxcaAoHIgC6fxWY3GnQC+ofGy2LHtNx6jvyPIVT9nTNi9LrO2QwKPF9hKZ bAtyDUqmlrOOofScdK51Rq1rwwcbbPn4Z8o4pcK/ond3hlYJri9slXYndzROY3wyXYQr M9y+gD7BiD/pHWau30YrjFvtdj7CItuwrsiUHG0PadSym4UX4hFLcS5hNethDRn/o4aQ /7Ag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=gF1ddKcptUSXZ7P1vheio1xCRe5t63dM21s5sxZJzEg=; b=M2lF/qbTpihj0iBorG5sMqKJexkGNryvWdM0Ys2I8iiYbSionISqM3qXlkeoA1Nemb 9WiufaG2rMIzx/ZO5MQOKwtmefz2nB8I0iCCldNglPPmIIaaIFqD6tYmIv5JFkd/73Q5 2+A33zTk8tPTCkBzvf25MAMlVnBDJJC3omGJCI7lWx24uCoj2hj65CaC5F6zMd+c8cCZ Lo/CxDeNMDwZt7CWs3Gb4lKHL+HKq7un6dza+YdgbslXMmBdQf3Q1AXM4Inc0EKZsEhc KO51YF4dTpei111vCEaYoBSUwECuChYv4zbMf9fQlleHjQWBGtBz7A105lrVHPsNjwtS Bd0A== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=gF1ddKcptUSXZ7P1vheio1xCRe5t63dM21s5sxZJzEg=; b=mbK+D8+OH2xYP5RbMEUy7vPaIgpLNEAY/Vr4nffkHABZ+auXsHh5TbNpdB7rOJiNXD UwRiOXP/zLT1chB3gDJuIDfY8u5CDRU0HOvga8bFWx9l+qXyS1mhss8nBEaS/Aa+LyZP PfWa9arPsCd2Nnh38G7e98LaOCY/C4BdYonanpGf/D1mJI5YN/ZN40S87QCPYCvV3ngn /qKxXRcOvupzMUBbYeDG9hz788HYrO9Zy0a4fX9rLPCRkdXWdEGKxBaLxti/0NoSoMPf YJgR3dK8261VopIlhy82V5JLEjbZ5Mb3RLxttXxXIseubwS6mAi5Ib1laEeNF7aMf+wk Tufw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=gF1ddKcptUSXZ7P1vheio1xCRe5t63dM21s5sxZJzEg=; b=Qio0a/CwQNXyf2N1/Btanw7HpHBqKvNku19CQPRPMR4EypXR5MpoqBxlRDvAup3zKo BN07V+fEUKvyJLunm2Ktwlp0AqE5krQ4aLhAz7a5qYTF2eaElB1saDvYxxl0pBdnby4u WDoB9x8dkVXB6SBMCBVRC1XXGWwwsyGLMbwhwrqL5Clpy/zYBtA2sVRViXxSB9fgKIAx fzaLAXJOfGrWhxK3te6J3lpw/TNqrN/HII1Eb/hEXwwkhyFgJsqIwLAnUSUUIzfYKX31 pS6D/AFDsP05tuckarmP/F2sSY8jTefxgnCuYpg9jYgUgsIEe9jmFiy6t6iKmXiqLUiu Cm0A== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM531EGPTTPTVUd2OZYtAYdi39TSjhhp//IiZjfvxtPb6+RNLVxNjn RbhlIsDbGnHkUMa1GSc/Gus= X-Google-Smtp-Source: ABdhPJwmR6bpORZJ/R6+XBp4HK01zB/vGoRxPHnp5vDcSoTQMTF7cKj140CDVA6S4aR7GMiaolIujg== X-Received: by 2002:adf:f592:: with SMTP id f18mr47034885wro.179.1626955127065; Thu, 22 Jul 2021 04:58:47 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a5d:4c50:: with SMTP id n16ls860067wrt.2.gmail; Thu, 22 Jul 2021 04:58:46 -0700 (PDT) X-Received: by 2002:a5d:591c:: with SMTP id v28mr47650979wrd.373.1626955126282; Thu, 22 Jul 2021 04:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626955126; cv=none; d=google.com; s=arc-20160816; b=NtptDdGrGWb5UrQpmFofzT5SSaGFyQza+NTSuoTJYEjm7HOnAVEG8iGgNI/vnYCzP9 ZwYePI18uwxe0eMxwUMjByVBkBGp7x21v7OJnBIJbTi75ltk/yhb2gmhx1ZbBeTtTG33 4uSDPkw6Ji0+jwI3J7Grce77V35bBArgThItVlpovAnNlKF65JNsOxcL9fuDx/x5SwSe p6ArlJX6dsJgZ16gDhRzbhb3nAQYSF7pAVbdz0V746sB4G1Yl1vZQJ/FmAqPQnQDxOST 37rvQi0C6QkAHiaIUqp9Muebll5TBS+nc/YRtpcEIkb3wFQm5v3pyVWzEnHsFnHLnhlJ Cg/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=EScqzIEHmNH+64HH4v/bgDqW0ZrjitAqSnsGbnfobFw=; b=uSKFu8xKped+wijxqln0u3o70FZ8zbwAEKLxnr2ipV9QTqEVg1WodinK1+kbpqkjZX gvwunAEUSXOC6lT0/B1P83Iuu0vrCgu6qobA9Yj1IwH9fIDH/KOafpON5fur32RcRK+q jlmUQRm2NjWVPAPFarjhpdLS9CGH5W68LzUpZVMpej4FO+pz0KG69LyKyqKjfYA/NtfN YBHNRW4IeGYsBqHpHfsku8uT8HIk2yaft9MukLXjtZynEpYEDjXDyOA20uoBQvzNqs1h z4IuXklMn1dBgKfoWa5Xa6bjMDmkBD8Zfypp9EdzseiVek4AM/i25bVjKvVwpHLfcrqj HtOg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id b15si222417wru.0.2021.07.22.04.58.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jul 2021 04:58:46 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4GVrZZ0pbTz1qxlx; Thu, 22 Jul 2021 13:58:46 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4GVrZZ0fb7z1qwYf; Thu, 22 Jul 2021 13:58:46 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id JqSSN1aTA4bD; Thu, 22 Jul 2021 13:58:45 +0200 (CEST) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Thu, 22 Jul 2021 13:58:45 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id B41DB4540D40; Thu, 22 Jul 2021 13:58:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([IPv6:::1]) by localhost (mail.babic.homelinux.org [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id CUCy9275gJl0; Thu, 22 Jul 2021 13:58:41 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.48]) by babic.homelinux.org (Postfix) with ESMTP id 0D2AF4542982; Thu, 22 Jul 2021 13:58:41 +0200 (CEST) From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic Subject: [swupdate] [[libubootenv] [PATCH 2/2] Add documentation for the configuration file Date: Thu, 22 Jul 2021 13:58:39 +0200 Message-Id: <20210722115839.223096-2-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210722115839.223096-1-sbabic@denx.de> References: <20210722115839.223096-1-sbabic@denx.de> MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Signed-off-by: Stefano Babic --- docs/fw_env_config.md | 81 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 docs/fw_env_config.md diff --git a/docs/fw_env_config.md b/docs/fw_env_config.md new file mode 100644 index 0000000..5d0e695 --- /dev/null +++ b/docs/fw_env_config.md @@ -0,0 +1,81 @@ +fw_env.config configuration file +================================ + +This is the configuration file for fw_(printenv/setenv) utility. +Up to two entries are valid, in this case the redundant +environment sector is assumed present. +Notice, that the "Number of sectors" is not required on NOR and SPI-dataflash. +Futhermore, if the Flash sector size is omitted, this value is assumed to +be the same as the Environment size, which is valid for NOR and SPI-dataflash +Device offset must be prefixed with 0x to be parsed as a hexadecimal value. + +Structure of the file +--------------------- + +Entries must be separated by spaces or tab + + +| device name | Device offset|Env. size|Flash sector size|Number of sectors|Disable lock mechanism| +|-----------------|--------------|---------|-----------------|-----------------|----------------------| +| | | | | | | + +- device name: device or file where env is stored (mandatory) +- offset : offset from start of file or device (mandatory) +- env size : size of environment +- Flash sector size : (optional) if not set, it is read from kernel +- Number of sectors: (optional) number of sectors for environment (mainly used with raw NAND) +- Disable lock mechanism : (optional), 0|1, default=0 (LOCK enable) + +NOR example +----------- +| device name | Device offset|Env. size|Flash sector size|Number of sectors|Disable lock mechanism| +|-----------------|--------------|---------|-----------------|-----------------|----------------------| +|/dev/mtd1 | 0x0000 | 0x4000 | 0x4000 | | | +|/dev/mtd2 | 0x0000 | 0x4000 | 0x4000 | | | + +MTD SPI-dataflash example +--------------------------- +| device name | Device offset|Env. size|Flash sector size|Number of sectors|Disable lock mechanism| +|-----------------|--------------|---------|-----------------|-----------------|----------------------| +|/dev/mtd5 | 0x4200 | 0x4000 | | | | +|/dev/mtd6 | 0x4200 | 0x4000 | | | | + +NAND example +----------- +| device name | Device offset|Env. size|Flash sector size|Number of sectors|Disable lock mechanism| +|-----------------|--------------|---------|-----------------|-----------------|----------------------| +|/dev/mtd0 | 0x4000 | 0x4000 | 0x20000 | 2 | | + +Block device example +-------------------- +On a block device a negative offset is treated as a backwards offset from the +end of the device/partition, rather than a forwards offset from the start. + + +| device name | Device offset|Env. size|Flash sector size|Number of sectors|Disable lock mechanism| +|-----------------|--------------|---------|-----------------|-----------------|----------------------| +|/dev/mmcblk0 | 0xc0000 | 0x20000 | | | | +|/dev/mmcblk0 | -0x20000 | 0x20000 | | | | + +VFAT example +------------ + +| device name | Device offset|Env. size|Flash sector size|Number of sectors|Disable lock mechanism| +|-----------------|--------------|---------|-----------------|-----------------|----------------------| +|/boot/uboot.env | 0x00000 | 0x4000 | | | | + +UBI volume +------------ + +| device name | Device offset|Env. size|Flash sector size|Number of sectors|Disable lock mechanism| +|-----------------|--------------|---------|-----------------|-----------------|----------------------| +|/dev/ubi0_0 | 0x0 | 0x1f000 | 0x1f000 | | | +|/dev/ubi0_1 | 0x0 | 0x1f000 | 0x1f000 | | | + +UBI volume by name +------------------ + +| device name | Device offset|Env. size|Flash sector size|Number of sectors|Disable lock mechanism| +|-----------------|--------------|---------|-----------------|-----------------|----------------------| +|/dev/ubi0:env | 0x0 | 0x1f000 | 0x1f000 | | | +|/dev/ubi0:redund | 0x0 | 0x1f000 | 0x1f000 | | |