Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp384831rdb; Thu, 5 Oct 2023 08:39:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFbO2K9wnZistjyP/TwwMWejtD58CBjWbZqLrd5bIINIQmXg2B5WuyussBeaxk034n9cQ/+ X-Received: by 2002:a17:90a:f291:b0:274:3a86:4c10 with SMTP id fs17-20020a17090af29100b002743a864c10mr5238332pjb.29.1696520344627; Thu, 05 Oct 2023 08:39:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696520344; cv=none; d=google.com; s=arc-20160816; b=bk42LzY1CQcUc/jZ2gXp32mrybvpJlbeMk+wqnMUzO4OxyJdazgm9omj0EToLlJioU jPnKJ642pfXg+SSWgXMj8peQJ97ZpJt/DwE9qV78N6Cg7XSjfKmAjKqWY4Uz7JeIxF1A IuhRwkKTbWBvfVwDw1K/VyEGSBSf5TmGOK0jMWzgWNT9WP39kkU+mw4VsZjGGQ6ijHtd 43a2dXaw108/c6oNxEbfxEeVgaK2StuI4XheYBEqF9gpnkXGWkLQSWulw5zQDWi+35MT bjQuxhiaMPO7gAFngE/hCFEBQbj6mBiAtPPBfwNnr6YWQfxMChSc2q2ttv/+xpaWE/n8 e4+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:references :in-reply-to:subject:cc:to:from:date:mime-version:dkim-signature; bh=gwEFx12oOMyOwNjNUlaQ2rtnyT0ghpe2A7nsISGzptw=; fh=MIrssD8jS1pE2mhYjdPf8t4cXprX6mpXu+KwD+BqtZE=; b=BJRj4dqbHFJdEy6qmWxWHcPNUbK5SKMmokTB+ya4UOBVmNTXlFiCgFAFvgsRyN6UCM FAZiIiLuYx9E7UOoZqkburQBbJ6z/VLEGzs5hkGIRS5dhT/MP5XjiWd8mzsbtMbLiV6d 2M7YBLDoOm/+QWMNLQvVeHlfGQIOxQ7hnQRLnbTvzLLWU5rTzaG2ksWa14ZGlsRu5NPd JSzvuYnricj/4ARWBvuEreGOFpxhZaFPTNp1DE3XtwKfdw9yvZM9AwMonybaGE/Vr/Nu kB5X9wz9T7VygNS+uHvjrCxsO1VePtX7S1Udk04DY0c/lbIV17+iI1tbzh7qU46P0QoU dt8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CExoHALn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id lp13-20020a17090b4a8d00b0026cab818aa2si4262470pjb.100.2023.10.05.08.39.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 08:39:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CExoHALn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 902038375C80; Thu, 5 Oct 2023 08:39:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231721AbjJEPh4 (ORCPT + 99 others); Thu, 5 Oct 2023 11:37:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232672AbjJEPhf (ORCPT ); Thu, 5 Oct 2023 11:37:35 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC08535C13 for ; Thu, 5 Oct 2023 07:53:30 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 370E2C116B3; Thu, 5 Oct 2023 08:54:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696496072; bh=hQbtd31t4QHbvyBGz5T+T1ipc8YUCa20YCG3jNUgn0c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CExoHALnmYDPpztn+tOoDI54e7b4nvxQxISJzG5OqWHLd0gsi6a0Drk5kTNnI40iy nso9DnGe2lxkB9BOWy3+zUMGIFVtYxzG3BFO4QjIGRnOgmvybs+bRvBXQl/Sv5lSq6 vKEEVsI8KLidhbQEwp7vZ/0lmZam/mvfwM5PIDlBET8YoOTyP5s6klwPG4hKcAVmzH RJ5L30MxsD4CvIZoR/yRB25Omn8y7/ajCbAkt88P2sbUdiucsOenfGdyIJNDhS1iI4 vN1rBQ207mO+3L2j3djzMrT//Ft3Alin+SpQ+E5aHTGuGWXwkUsgMwejvBCAprZ7Io zvMV8FdFExiGA== MIME-Version: 1.0 Date: Thu, 05 Oct 2023 10:54:26 +0200 From: Michael Walle To: Simon Glass Cc: miquel.raynal@bootlin.com, conor+dt@kernel.org, devicetree@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, ptyadav@amazon.de, rafal@milecki.pl, richard@nod.at, robh+dt@kernel.org, robh@kernel.org, trini@konsulko.com, u-boot@lists.denx.de, vigneshr@ti.com Subject: Re: [PATCH v2 1/3] dt-bindings: mtd: fixed-partitions: Add binman compatible In-Reply-To: References: <20231004093620.2b1d6917@xps-13> <20231004113458.531124-1-mwalle@kernel.org> <9e588e3ec8c0c321a2861723d0d42b9a@kernel.org> Message-ID: X-Sender: mwalle@kernel.org Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Thu, 05 Oct 2023 08:39:01 -0700 (PDT) Hi, >> >> >> Add a compatible string for binman, so we can extend fixed-partitions >> >> >> in various ways. >> >> > >> >> > I've been thinking at the proper way to describe the binman partitions. >> >> > I am wondering if we should really extend the fixed-partitions >> >> > schema. This description is really basic and kind of supposed to remain >> >> > like that. Instead, I wonder if we should not just keep the binman >> >> > compatible alone, like many others already. This way it would be very clear >> >> > what is expected and allowed in both cases. I am thinking about >> >> > something like that: >> >> > >> >> > Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml >> >> > >> >> > this file is also referenced there (but this patch does the same, which >> >> > is what I'd expect): >> >> > >> >> > Documentation/devicetree/bindings/mtd/partitions/partitions.yaml >> >> > >> >> > I'll let the binding maintainers judge whether they think it's >> >> > relevant, it's not a strong opposition. >> >> >> >> What is the overall goal here? To replace the current binman node >> >> which is >> >> usually contained in the -u-boot.dtsi files? If one is using binman to >> >> create an image, is it expected that one needs to adapt the DT in >> >> linux? >> >> Or will it still be a seperate -u-boot.dtsi? > Because in the latter >> >> case >> >> I see that there will be conflicts because you have to overwrite the >> >> flash node. Or will it be a seperate node with all the information >> >> duplicated? >> > >> > The goal is simply to have a full binding for firmware layout, such >> > that firmware images can be created, examined and updated. The >> > -u-boot.dtsi files are a stopgap while we sort out a real binding. >> > They should eventually go away. >> >> You haven't answered whether this node should be a seperate binman >> node - or if you'll reuse the existing flash (partitions) node(s) and >> add any missing property there. If it's the latter, I don't think >> compatible = "binman", "fixed-partitions"; is correct. > > My intent is to make it compatible, so wouldn't it make sense to have > binman as the first compatible, then falling back to fixed-partitions > as the second? As far as I know, the compatibles should get more specific with each string. But "binman" seems to be used as a kind of tag which could be added to any compatible under the flash node. What if one wants to build an image which isn't compatible = "fixed-partitions"? E.g. "linksys,ns-partitions", will it then have compatible = "binman", "linksys,ns-partitions"? >> >> Maybe (a more complete) example would be helpful. >> > >> > Can you please be a bit more specific? What is missing from the >> > example? >> >> Like a complete (stripped) DTS. Right now I just see how the >> individual >> node looks like. But with a complete example DTS, my question from >> above >> would have been answered. So to give an example myself, please correct it if it's wrong. From our board (kontron-sl28): &fspi { status = "okay"; flash@0 { compatible = "jedec,spi-nor"; m25p,fast-read; spi-max-frequency = <133000000>; reg = <0>; /* The following setting enables 1-1-2 (CMD-ADDR-DATA) mode */ spi-rx-bus-width = <2>; /* 2 SPI Rx lines */ spi-tx-bus-width = <1>; /* 1 SPI Tx line */ partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; partition@0 { reg = <0x000000 0x010000>; label = "rcw"; read-only; }; partition@10000 { reg = <0x010000 0x1d0000>; label = "failsafe bootloader"; read-only; }; partition@200000 { reg = <0x200000 0x010000>; label = "configuration store"; }; partition@210000 { reg = <0x210000 0x1d0000>; label = "bootloader"; }; partition@3e0000 { reg = <0x3e0000 0x020000>; label = "bootloader environment"; }; }; }; }; In u-boot we use binman, see arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi in the u-boot repository. Now to use the new method, am I expected to adapt the dts in the linux kernel? As far as I understand that is the case. So that node from above would look something like the following: &fspi { status = "okay"; flash@0 { compatible = "jedec,spi-nor"; m25p,fast-read; spi-max-frequency = <133000000>; reg = <0>; /* The following setting enables 1-1-2 (CMD-ADDR-DATA) mode */ spi-rx-bus-width = <2>; /* 2 SPI Rx lines */ spi-tx-bus-width = <1>; /* 1 SPI Tx line */ partitions { compatible = "binman", "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; [..] partition@210000 { reg = <0x210000 0x1d0000>; label = "u-boot"; /* or "u-boot+atf" ? */ }; partition@3e0000 { reg = <0x3e0000 0x020000>; label = "bootloader environment"; }; }; }; }; I'm still not sure why that compatible is needed. Also I'd need to change the label which might break user space apps looking for that specific name. Also, our board might have u-boot/spl or u-boot/spl/bl31/bl32, right now that's something which depends on an u-boot configuration variable, which then enables or disables binman nodes in the -u-boot.dtsi. So in linux we only have that "bootloader" partition, but there might be either u-boot+spl or u-boot+spl+bl31+bl32. Honestly, I'm really not sure this should go into a device tree. >> What if a board uses eMMC to store the firmware binaries? Will that >> then >> be a subnode to the eMMC device? > > I thought there was a way to link the partition nodes and the device > using a property, without having the partition info as a subnode of > the device. But I may have imagined it as I cannot find it now. So > yes, it will be a subnode of the eMMC device. Not sure if that will fly. -michael