Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp3131643rdb; Fri, 22 Sep 2023 21:28:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/jbp131hZg+Co2A4YvIm6W3n8e+D+G09hgIhsvpmoAr+g2vGW2wM/rf6AfAHnnDdw0vpC X-Received: by 2002:a17:902:d502:b0:1c3:1c74:5d0a with SMTP id b2-20020a170902d50200b001c31c745d0amr1565095plg.34.1695443322566; Fri, 22 Sep 2023 21:28:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695443322; cv=none; d=google.com; s=arc-20160816; b=D4Yxs0kcxtFgrikmTJ4PND38KsYK06oGyAblC9EGmO0g8M9qOUO70A5pet8RzURZ4R jI11ZJPX7yBZTVuf0a0ni4X1uIfgE1/dJ7OQDAoBQW6FLzFQ5o9uqwWJDx5B8jU68t5x MjB+Txa9rre2p7KSc1jyX7psmF02yCEr75oAVugVpdU9WxzATC45eg/hwCDFl+pSJSMZ 0LXvPpqikOmedv1VF3hh1ahHaudiqFPuohggQJhuDNvNEM/2S5i09loPgQEY+VJm5uBN Hut4OyGEO3T5ow6yJFmReVt95oqI+aXE4281OfjRtWGznXyaKYBQaBkho6Xm6O2wizCq pw7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=QcpcIFJ61Cgs0SnYetl6zxlaNczsC0YBO5OwWuuMpjg=; fh=45Whl7lPTefq0oFaGyz9A5JaF9AMZXCL9LfS9b+/aVU=; b=Yab6hn3kf1P7sats6iSgZPG317VF/lVftfwLyNjILoklqR2P6jiSEydGDybvr5AdG5 XME8sXGRUuVELldW8e/KiQi07WAto/9hd03JuJeQllhC1dR0hdsAhaX9fEM8MBienqJW /XpvXi/Ii+vP2kugFhSl/XCBTCy6HA+jg/ZEoT7prGPRlGq196vpsjgYfDMP0SezjUJA 4z9Q1wvghUGQv7k6NPRF7+3tb08sE6g1oV6vommxu7AxvYqb1ujbajWbMbtkbb+7XO0E /uPbPHOjiuKpf/1gyfJcCBKSNJKy4yadeBaIAFTLU3osePGa4BDNYYviZpRsbmgfY0Mm zqZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QkjTHSKk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id d11-20020a170903230b00b001c1f373ea07si5850397plh.351.2023.09.22.21.28.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 21:28:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QkjTHSKk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 6B524837CF22; Fri, 22 Sep 2023 12:52:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232430AbjIVTvo (ORCPT + 99 others); Fri, 22 Sep 2023 15:51:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233371AbjIVTvh (ORCPT ); Fri, 22 Sep 2023 15:51:37 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A43BCCC for ; Fri, 22 Sep 2023 12:51:27 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-50435ad51bbso2551936e87.2 for ; Fri, 22 Sep 2023 12:51:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695412286; x=1696017086; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=QcpcIFJ61Cgs0SnYetl6zxlaNczsC0YBO5OwWuuMpjg=; b=QkjTHSKkkSJK2ZwSPpurcAmT8xgayLrFoPIWEiUTwrLDgeIYREqu9SkOOFEmzLWtyR aNALWpPlZW4wZmyezyRKD6UV6PkjWMcwEz0JoZVfgsxecYt20n+k7g9234F8N/3gYAlW /VJYgZ9hJXJYfzi0FJ8KVQ7vQTKaZT1UglfEo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695412286; x=1696017086; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QcpcIFJ61Cgs0SnYetl6zxlaNczsC0YBO5OwWuuMpjg=; b=GVVWdYem+ppHY4X0/HhtoMGLXz86mQx6xfoZpxhr0/DdHmdCSLW0V0xXQFF6ncU4LF DUTY/u0qCbIKq1ie9dn5SZUw1F9mavJfmj/KN6k/6IY9MFoHKlFlLSK9BHQN1AjDWqQd X8lLWVAvoJJTWwB3rIKKYxqkhhnZ4S3mxqleryMPuABdjKJuVbRRiTA17WIC315mf7YU mNyLYSV+t3VXqxkC0RQ2pc4if2WBh4diFoFoVGWr7xkqL/FPnPxHsUssRh3NX8nhbOkQ TzwgPrU8q9PZUjC1B7V3Immu3vmNhIU/o9jv+mjOWNdLDeN/DHgAflprYc34zA7zpF8y B1Ag== X-Gm-Message-State: AOJu0YzRJDGC+0betAhzNH83VPyuGiRAL9QqYvWtBZ9iS2Go51cvQ5GA G+UJNObE418kjAjAMkMDMDWBg90BqKoC1BG37ehzRQ== X-Received: by 2002:a05:6512:32a2:b0:503:2a53:7480 with SMTP id q2-20020a05651232a200b005032a537480mr431345lfe.49.1695412285461; Fri, 22 Sep 2023 12:51:25 -0700 (PDT) MIME-Version: 1.0 References: <20230921124459.1.I91ddcfacf9b234af5cc3eabea4b62edb31153317@changeid> <20230922174649.GA3320366-robh@kernel.org> In-Reply-To: From: Simon Glass Date: Fri, 22 Sep 2023 13:51:14 -0600 Message-ID: Subject: Re: [PATCH] dt-bindings: mtd: Add a schema for binman To: Rob Herring Cc: devicetree@vger.kernel.org, U-Boot Mailing List , linux-mtd@lists.infradead.org, Tom Rini , Conor Dooley , Dhruva Gole , Krzysztof Kozlowski , Miquel Raynal , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Richard Weinberger , Vignesh Raghavendra , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 22 Sep 2023 12:52:07 -0700 (PDT) X-Spam-Level: ** Hi Rob, On Fri, 22 Sept 2023 at 13:43, Rob Herring wrote: > > On Fri, Sep 22, 2023 at 1:12=E2=80=AFPM Simon Glass wr= ote: > > > > Hi Rob, > > > > On Fri, 22 Sept 2023 at 11:46, Rob Herring wrote: > > > > > > On Fri, Sep 22, 2023 at 11:01:18AM -0600, Simon Glass wrote: > > > > Hi Rob, > > > > > > > > On Fri, 22 Sept 2023 at 10:00, Rob Herring wrote: > > > > > > > > > > On Thu, Sep 21, 2023 at 1:45=E2=80=AFPM Simon Glass wrote: > > > > > > > > > > > > Binman[1] is a tool for creating firmware images. It allows you= to > > > > > > combine various binaries and place them in an output file. > > > > > > > > > > > > Binman uses a DT schema to describe an image, in enough detail = that > > > > > > it can be automatically built from component parts, disassemble= d, > > > > > > replaced, listed, etc. > > > > > > > > > > > > Images are typically stored in flash, which is why this binding= is > > > > > > targeted at mtd. Previous discussion is at [2] [3]. > > > > > > > > > > > > [1] https://u-boot.readthedocs.io/en/stable/develop/package/bin= man.html > > > > > > [2] https://lore.kernel.org/u-boot/20230821180220.2724080-3-sjg= @chromium.org/ > > > > > > [3] https://www.spinics.net/lists/devicetree/msg626149.html > > > > > > > > > > You missed: > > > > > > > > > > https://github.com/devicetree-org/dt-schema/pull/110 > > > > > > > > > > where I said: We certainly shouldn't duplicate the existing parti= tions > > > > > bindings. What's missing from them (I assume we're mostly talking > > > > > about "fixed-partitions" which has been around forever I think (b= efore > > > > > me))? > > > > > > > > > > To repeat, unless there is some reason binman partitions conflict= with > > > > > fixed-partitions, you need to start there and extend it. From wha= t's > > > > > posted here, it neither conflicts nor needs extending. > > > > > > > > I think at this point I am just hopelessly confused. Have you taken= a > > > > look at the binman schema? [1] > > > > > > Why do I need to? That's used for some tool and has nothing to do wit= h a > > > device's DTB. However, I thought somewhere in this discussion you sho= wed > > > it under a flash device node. > > > > Yes, that is the intent (under a flash node). > > > > > Then I care because then it overlaps with > > > what we already have for partitions. If I misunderstood that, then ju= st > > > put your schema with your tool. Only users of the tool should care ab= out > > > the tool's schema. > > > > OK. I believe that binman will fit into both camps, since its input is > > not necessarily fully formed. E.g. if you don't specify the offset of > > an entry, then it will be packed automatically. But the output is > > fully formed, in that Binman now knows the offset so can write it to > > the DT. > > I suppose it could take its own format as input and then write out > something different for the "on the device" format (i.e. > fixed-partitions). At least for the dynamic offsets, we may need > something allowed for binman input, but not allowed on device. In > general, there is support for partitions without addresses/offsets, > but only for partitions that have some other way to figure that out > (on disk partition info). > > There's also the image filename which doesn't really belong in the on > device partitions. So maybe the input and output schemas should be > separate. OK, I'll focus on the output schema for now. I suspect this will be a grey area though. As an example, if you replace a binary in the firmware, Binman can repack the firmware to make room, respecting the alignment and size constraints. So these need to be in the output schema somehow. > > > > > I saw this file, which seems to extend a partition. > > > > > > > > Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-parti= tions.yaml > > > > > > IIRC, that's a different type where partition locations are stored in > > > the flash, so we don't need location and size in DT. > > > > OK. > > > > > > > > > > > > > I was assuming that I should create a top-level compatible =3D "bin= man" > > > > node, with subnodes like compatible =3D "binman,bl31-atf", for exam= ple. > > > > I should use the compatible string to indicate the contents, right? > > > > > > Yes for subnodes, and we already have some somewhat standard ones for > > > "u-boot" and "u-boot-env". Though historically, "label" was used. > > > > Binman has common properties for all entries, including "compress" > > which sets the compression algorithm. > > I see no issue with adding that. It seems useful and something missing > in the existing partition schemas. OK I sent a patch with that. > > > So perhaps I should start by defining a new binman,bl31-atf which has > > common properties from an "binman,entry" definition? > > I don't understand the binman prefix. The contents are ATF (or TF-A > now). Who wrote it to the flash image is not relevant. Are you suggesting just "atf-bl31", or "arm,atf-bl31" ? Or should we change it to "tfa-bl31"? > > We already have some compatibles in use. We should reuse them if > possible. Not sure about TF-A though. OK. Regards, Simon