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=-12.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham 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 C42A3C07E99 for ; Fri, 9 Jul 2021 12:06:23 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 0D30A613C8 for ; Fri, 9 Jul 2021 12:06:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D30A613C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nic.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 93C5D82AA9; Fri, 9 Jul 2021 14:06:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=nic.cz header.i=@nic.cz header.b="pKVKdFb2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 26E1C82B55; Fri, 9 Jul 2021 14:06:19 +0200 (CEST) Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DD09980C84 for ; Fri, 9 Jul 2021 14:06:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.behun@nic.cz Received: from dellmb (unknown [IPv6:2001:1488:fffe:6:8747:7254:5571:3010]) by mail.nic.cz (Postfix) with ESMTPSA id 62FB2141609; Fri, 9 Jul 2021 14:06:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1625832375; bh=t3WFINGJCnhiMxmXZNOWbzwPUqPIXa5g9vrWIUdLrsw=; h=Date:From:To; b=pKVKdFb2NlLm4SdHGEzRq5qTTtI/dFQHsxSyhZo7Ejd4OM2gIuZkzKBhnacbaNZjZ MrUQLyNn0Wv8QYXFJK+B8r+ASauf3DxYv2R1GYOUxpp8noOrVXeLR8vv6dKhkbOeS2 a9MjKmPMQyTBpBj0IH3QjTDxR+R5UK8ktGgUsyQ8= Date: Fri, 9 Jul 2021 14:06:15 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Masami Hiramatsu Cc: Simon Glass , Tom Rini , Heinrich Schuchardt , Jassi Brar , Ilias Apalodimas , Masahisa Kojima , Takahiro Akashi , U-Boot Mailing List Subject: Re: [PATCH 3/6] dts: synquacer: Add partition information to the spi-nor Message-ID: <20210709140615.2c3a0993@dellmb> In-Reply-To: References: <162582779750.112250.1804638357524349747.stgit@localhost> <162582782712.112250.6553338507843531908.stgit@localhost> <20210709125432.3bec117f@dellmb> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On Fri, 9 Jul 2021 20:27:18 +0900 Masami Hiramatsu wrote: > Hi Marek, >=20 > 2021=E5=B9=B47=E6=9C=889=E6=97=A5(=E9=87=91) 19:54 Marek Beh=C3=BAn : > > > > On Fri, 9 Jul 2021 19:50:27 +0900 > > Masami Hiramatsu wrote: > > =20 > > > Add partition information to the spi-nor flash. > > > This is required for accessing NOR flash via mtdparts. > > > > > > Signed-off-by: Masami Hiramatsu > > > --- > > > .../dts/synquacer-sc2a11-developerbox-u-boot.dtsi | 42 > > > ++++++++++++++++++++ 1 file changed, 42 insertions(+) > > > > > > diff --git > > > a/arch/arm/dts/synquacer-sc2a11-developerbox-u-boot.dtsi > > > b/arch/arm/dts/synquacer-sc2a11-developerbox-u-boot.dtsi index > > > 2f13a42235..245ebcda01 100644 --- > > > a/arch/arm/dts/synquacer-sc2a11-developerbox-u-boot.dtsi +++ > > > b/arch/arm/dts/synquacer-sc2a11-developerbox-u-boot.dtsi @@ -31,6 > > > +31,48 @@ spi-max-frequency =3D <31250000>; spi-rx-bus-width =3D > > > <0x1>; spi-tx-bus-width =3D <0x1>; > > > + > > > + partitions { > > > + compatible =3D "fixed-partitions"; > > > + #address-cells =3D <1>; > > > + #size-cells =3D <1>; > > > + > > > + partition@0 { > > > + label =3D "BootStrap-BL1"; > > > + reg =3D <0x0 0x70000>; > > > + read-only; > > > + }; > > > + partition@70000 { > > > + label =3D "Flash-Writer"; > > > + reg =3D <0x70000 0x90000>; > > > + read-only; > > > + }; > > > + partition@100000 { > > > + label =3D "SCP-BL2"; > > > + reg =3D <0x100000 0x80000>; > > > + read-only; > > > + }; > > > + partition@180000 { > > > + label =3D "FIP-TFA"; > > > + reg =3D <0x180000 0x78000>; > > > + }; > > > + partition@1f8000 { > > > + label =3D "Stage2Tables"; > > > + reg =3D <0x1f8000 0x8000>; > > > + }; > > > + partition@200000 { > > > + label =3D "U-Boot"; > > > + reg =3D <0x200000 0x100000>; > > > + }; > > > + partition@300000 { > > > + label =3D "UBoot-Env"; > > > + reg =3D <0x300000 0x100000>; > > > + }; > > > + partition@500000 { > > > + label =3D "Ex-OPTEE"; > > > + reg =3D <0x500000 0x200000>; > > > + }; > > > + }; > > > }; > > > }; > > > > > > =20 > > > > Just a style hint: the individual partition nodes should be IMO > > separated by an additional newline character, i.e.: =20 >=20 > Ah, OK. >=20 > > > > partition@0 { > > label =3D "BootStrap-BL1"; > > reg =3D <0x0 0x70000>; > > read-only; > > }; > > > > partition@70000 { > > label =3D "Flash-Writer"; > > reg =3D <0x70000 0x90000>; > > read-only; > > }; > > > > partition@100000 { > > label =3D "SCP-BL2"; > > reg =3D <0x100000 0x80000>; > > read-only; > > }; > > > > Other than that: > > > > Reviewed-by: Marek Beh=C3=BAn > > > > Btw, did you test this? Does this work correctly with mtd command? =20 >=20 > Yes, I've tested that, and mtd list works. But it seems "mtd erase" > commands don't work well. > See the log below; >=20 > ------- > =3D> log level 7 > =3D> mtd list =20 > List of MTD devices: > * mx66u51235f > - device: spi-flash@0 > - parent: spi@54800000 > - driver: jedec_spi_nor > - path: /spi@54800000/spi-flash@0 > - type: NOR flash > - block size: 0x1000 bytes > - min I/O: 0x1 bytes > - 0x000000000000-0x000004000000 : "mx66u51235f" > - 0x000000000000-0x000000070000 : "BootStrap-BL1" > - 0x000000070000-0x000000100000 : "Flash-Writer" > - 0x000000100000-0x000000180000 : "SCP-BL2" > - 0x000000180000-0x0000001f8000 : "FIP-TFA" > - 0x0000001f8000-0x000000200000 : "Stage2Tables" > - 0x000000200000-0x000000400000 : "EDK2" > - 0x000000400000-0x000000500000 : "EDK2-Env" > - 0x000000500000-0x000000700000 : "Ex-OPTEE" > - 0x000000700000-0x000000800000 : "UBoot-Env" > - 0x000000800000-0x000000900000 : "U-Boot" > =3D> mtd erase Ex-OPTEE =20 > Erasing 0x00000000 ... 0x001fffff (512 eraseblock(s)) > jedec_spi_nor spi-flash@0: at 0x500000, len 4096 > =3D> mtd dump E =20 > EDK2 EDK2-Env Ex-OPTEE > =3D> mtd dump Ex-OPTEE 0 10 =20 > Reading 16 byte(s) at offset 0x00000000 > jedec_spi_nor spi-flash@0: from 0x00500000, len 16 >=20 > Dump 16 data bytes from 0x0: > 0x00000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff > =3D> mtd dump Ex-OPTEE 1000 10 =20 > Reading 16 byte(s) at offset 0x00001000 > jedec_spi_nor spi-flash@0: from 0x00501000, len 16 >=20 > Dump 16 data bytes from 0x1000: > 0x00001000: 00 00 00 14 1f 20 03 d5 1f 20 03 d5 1f 20 03 d5 > =3D> =20 > ------- >=20 > So it seems first 4k block is cleared, but other blocks are not > erased. I think that is not a devicetree issue, but mtd subsystem > issue. Can reproduce, going to look into this. Marek