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 X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8759C433E6 for ; Mon, 8 Mar 2021 21:38:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ABE7965259 for ; Mon, 8 Mar 2021 21:38:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229929AbhCHVh7 (ORCPT ); Mon, 8 Mar 2021 16:37:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbhCHVhr (ORCPT ); Mon, 8 Mar 2021 16:37:47 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D134C06174A; Mon, 8 Mar 2021 13:37:47 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id q25so23432043lfc.8; Mon, 08 Mar 2021 13:37:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=abCnK8oP7nGAZ35KUotLl907eUfcfc7ef69hK2Ao3gI=; b=q7tUPr1VQ7bVdJbvdxenDQb/xwGyHwhmoA9P9W/590dIwEAVL2HC22XxfMRNOUnmQo 5oNUbY529XkX92H7DFl80j+kTyXfNPL5pTasuzVCTPG5JU+QbaAPCfUQrrTIMVrP+EdV rOgyEGO0T6TKGQ52OuoPb/cF7EdIkkcwMyQ0VUZaYIhk1NhBnnu/5uyqvWmIlJBzcTqC iuqYLCnYh/4Uv1xMPgAHnjewntJ/NHAfXnT223A4X4JWN+4ZZc5FshT4HiW4DqkNTQVO y/l7URIhXa1MhN+GajR7VBPoe2yDh/KOP3t0FXrWydZCN7kzYzfZ3P12klTu2djxTNkR butw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=abCnK8oP7nGAZ35KUotLl907eUfcfc7ef69hK2Ao3gI=; b=NzE3zysZWrHxZJsgBV9UyOVeoYkTlNnk+M+MJWI/8falLQD8A0enDmXR0V47DRdYJo VLOfnrT1lj5jsHVMkea/pa6hQ6qCjQHqQzSxzFym2iRh0JhUvKul0CipoMZ4Garlro4r WnSDvMi6r4k66BoFZ/R3UPz+4Hd5e8dR8oEGKoVvb8B1aFSYiu24yfYHTHPXR75QHkgD nXneV2/F0tCzslPEXKqT7n0r5PEtUz5G3URVJU9CihLHenZ0wPwSJStOsqhN9k9EbcIS nLBTYP/qdg38RqJ+Ezvxl/yH8LcWJ0QWa72/giEuf4RsU+oTqqQI10pdGh2/hddlraEy YrQg== X-Gm-Message-State: AOAM532GtDhcX9gYjX82URW+s2C7OOB5F9MvFF1CNYkQo/5XmcxBl3Uk y6MyuGo0mjs8TsCYJIZopUzm+U6+5d4= X-Google-Smtp-Source: ABdhPJxDX9YRLuxfX9/RB9OZeqE/YER1VnjejatoSNNHGwuYIfvOLQDBLTXgcweEq12GUsavC1EUAA== X-Received: by 2002:a19:4108:: with SMTP id o8mr15805486lfa.180.1615239465466; Mon, 08 Mar 2021 13:37:45 -0800 (PST) Received: from localhost.localdomain (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.googlemail.com with ESMTPSA id f10sm1491470lfm.194.2021.03.08.13.37.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Mar 2021 13:37:44 -0800 (PST) Subject: Re: [PATCH stblinux.git 1/2] dt-bindings: firmware: add Broadcom's NVRAM memory mapping To: Rob Herring Cc: Florian Fainelli , Vivek Unune , linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, devicetree@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= References: <20210302074405.18998-1-zajec5@gmail.com> <20210308184308.GA2762703@robh.at.kernel.org> From: =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= Message-ID: <93f1d985-54ae-9cbe-ef42-9e62b86d2633@gmail.com> Date: Mon, 8 Mar 2021 22:37:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210308184308.GA2762703@robh.at.kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08.03.2021 19:43, Rob Herring wrote: > On Tue, Mar 02, 2021 at 08:44:04AM +0100, Rafał Miłecki wrote: >> From: Rafał Miłecki >> >> NVRAM structure contains device data and can be accessed using MMIO. >> >> Signed-off-by: Rafał Miłecki >> --- >> .../bindings/firmware/brcm,nvram.yaml | 41 +++++++++++++++++++ >> 1 file changed, 41 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/firmware/brcm,nvram.yaml >> >> diff --git a/Documentation/devicetree/bindings/firmware/brcm,nvram.yaml b/Documentation/devicetree/bindings/firmware/brcm,nvram.yaml >> new file mode 100644 >> index 000000000000..12af8e2e7c9c >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/firmware/brcm,nvram.yaml >> @@ -0,0 +1,41 @@ >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: "http://devicetree.org/schemas/firmware/brcm,nvram.yaml#" >> +$schema: "http://devicetree.org/meta-schemas/core.yaml#" >> + >> +title: Broadcom's NVRAM >> + >> +maintainers: >> + - Rafał Miłecki >> + >> +description: | >> + NVRAM is a structure containing device specific environment variables. >> + It is used for storing device configuration, booting parameters and >> + calibration data. > > The structure of the data is fully discoverable just from a genericish > 'brcm,nvram'? Yes, NVRAM structure is a header (with magic and length) and a list of key-value pairs separated by \0. If you map memory at given address you should verify magic and start reading key-value pairs. Content example: foo=bar\0baz=qux\0quux(...) There is no predefined order of pairs, set of keys or anything similar I could think of. I can't think of anything more worth describing in DT. > And it's a dedicated memory outside of regular RAM? Yes