[From nobody Thu Jun 25 05:54:45 2020
Received: from mail-oi0-x244.google.com ([2607:f8b0:4003:c06::244])
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
 id 1fgZeS-0000Uu-W7
 for openwrt-devel@lists.openwrt.org; Fri, 20 Jul 2018 17:57:14 +0000
Received: by mail-oi0-x244.google.com with SMTP id y207-v6so22788845oie.13
 for &lt;openwrt-devel@lists.openwrt.org&gt;; Fri, 20 Jul 2018 10:57:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=googlemail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc:content-transfer-encoding;
 bh=8QzwjTuda8ZmDk86hIPq2v6yWFEKYDwIa//f0zm0uHw=;
 b=DjXQON+Fj6sguto+op5FNuFPeisAirLbHXPrcTFs6/TylHv0N1XoxvP3YRKlWe5Vd1
 0jTa8H6xMQS0Zfl8WrrJl0UJjpsUOP6W20hJUDrw87r2ZaujzhC0zUyo3GkZNp5j6Wgb
 FWuvoqXyVJczPkilUDwaOxjHuL1xcC95tfvC7bh+Tl7yXc4U2jzbIet6liUbbGucYiWL
 OtD4ddxX5e78Evn/d9iuUtoy5/SFKWNXQDUKKsUzulcz5t+IUAzdDiFZ3VYyZwt8QNCL
 Qv9OJlMkhHXKxokD+I09r/US7YIGEVIFeTnWSskbOG8zfCd955VzsXLee+rN4iSuX64l
 gMGw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc:content-transfer-encoding;
 bh=8QzwjTuda8ZmDk86hIPq2v6yWFEKYDwIa//f0zm0uHw=;
 b=OWpFOVL1XkTWQQxUrMiF7NnrKGoIebEYPRZ3CiyxUXw2xmuMdsP9bs1rWGaG8Uuoul
 E+bSuVQXAdeZdxETfrQ8QVlGnDBWJNyZRgWNT3IPd6nqfMTrNRXQIKXZrPrMBcknumH1
 gKM5+WRNKDP0ZkK9F7adrX5rme7JLkEVxhh5w1zIKUPysr1xPnDSf8NGEg8vsWiCjZRx
 mFpAGzw2ZNbgSPPQgFrLRx1i00mNutJAnytCEQ0IrFoc7B/rYfLRp2xpwvVS6QZymy9s
 oqo32Z/628vEeji0A4MYdGNe0rF9VCME98XrkH/N4eb7+jZnr4dqxEJW6ahXUgpPG2gY
 +p4w==
X-Gm-Message-State: AOUpUlFNIApaL0ghR0rV6MwCLBV8xtB/EPG6pTFe8HE3jXyBxDdQpWKG
 itteI9hpuuiOYyIcBod8sk0/H9A+NWlwQJMgZ2fqXgfR
X-Google-Smtp-Source: AAOMgpcrFYb3hoL0Zrq9PT2pSSlBV9Nyj5RjLjqYmbxq8ulZ6zKp3JPF9pWMb8qXfUnSpilQZ3HI+3yP890u45py4AM=
X-Received: by 2002:aca:c70f:: with SMTP id
 x15-v6mr3277353oif.97.1532109421695; 
 Fri, 20 Jul 2018 10:57:01 -0700 (PDT)
MIME-Version: 1.0
References: &lt;20180719171233.43763-1-hacks@slashdirt.org&gt;
 &lt;20180719171233.43763-3-hacks@slashdirt.org&gt;
In-Reply-To: &lt;20180719171233.43763-3-hacks@slashdirt.org&gt;
From: Martin Blumenstingl &lt;martin.blumenstingl@googlemail.com&gt;
Date: Fri, 20 Jul 2018 19:56:50 +0200
Message-ID: &lt;CAFBinCA9p2HmQuenYR89qSyNKDdWSQCS40-hvrrniiSxfLWsSw@mail.gmail.com&gt;
Subject: Re: [OpenWrt-Devel] [PATCH 2/2] ramips: fix RBM11G name and
 partitioning
To: hacks@slashdirt.org
Cc: openwrt-devel@lists.openwrt.org
Content-Type: text/plain; charset=&quot;UTF-8&quot;
Content-Transfer-Encoding: quoted-printable
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20180720_105713_036484_C4C9C5D1 
X-CRM114-Status: GOOD (  20.24  )
X-Spam-Score: -0.1 (/)
X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary:
 Content analysis details:   (-0.1 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at http://www.dnswl.org/, no
 trust [2607:f8b0:4003:c06:0:0:0:244 listed in] [list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
 (martin.blumenstingl[at]googlemail.com)
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature,
 not necessarily valid
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
 domain

On Thu, Jul 19, 2018 at 7:12 PM Thibaut VAR=C3=88NE &lt;hacks@slashdirt.org&gt; w=
rote:
&gt;
&gt; This patch improves faf64056ddd46992a75b1e277d94541c7251035c by setting
&gt; the correct partition scheme for the RouterBoot section of the flash.
&gt;
&gt; This section is subdivided in several segments, as they are on ar71xx
&gt; RB devices, albeit with different offsets and sizes. The naming conventio=
n
&gt; from ar71xx has been preserved, with an overlapping &quot;RouterBoot&quot; top leve=
l
&gt; partition added for clarity due to the many holes.
&gt;
&gt; The resulting partition scheme looks like this:
&gt; [    2.477826] Creating 7 MTD partitions on &quot;spi0.0&quot;:
&gt; [    2.482604] 0x000000000000-0x000000040000 : &quot;RouterBoot&quot;
&gt; [    2.488948] 0x000000000000-0x00000000f000 : &quot;routerboot&quot;
&gt; [    2.495289] 0x00000000f000-0x000000010000 : &quot;hard_config&quot;
&gt; [    2.501596] 0x000000010000-0x00000001f000 : &quot;routerboot2&quot;
&gt; [    2.507966] 0x000000020000-0x000000021000 : &quot;soft_config&quot;
&gt; [    2.514307] 0x000000030000-0x000000031000 : &quot;bios&quot;
&gt; [    2.520108] 0x000000040000-0x000001000000 : &quot;firmware&quot;
&gt;
&gt; The device name is corrected to match the hardware-stored (in hard_config=
)
&gt; device name.
&gt;
&gt; Leave a note in DTS to mention this device supports hardware crypto.
I find this bit of information strange since it has nothing to do with
the other changes. also: what kind of hardware crypto does it support?

&gt; Leave a note in DTS to explain how the original author selected the SPI s=
peed.
&gt;
&gt; Note: more work is required to get rbcfg working on this device due to
&gt; endianness.
&gt;
&gt; Tested-by: Tobias Schramm &lt;tobleminer@gmail.com&gt;
&gt; Signed-off-by: Thibaut VAR=C3=88NE &lt;hacks@slashdirt.org&gt;
&gt; ---
&gt;  target/linux/ramips/dts/RBM11G.dts | 62 +++++++++++++++++++++++++++-----=
------
&gt;  1 file changed, 45 insertions(+), 17 deletions(-)
&gt;
&gt; diff --git a/target/linux/ramips/dts/RBM11G.dts b/target/linux/ramips/dts=
/RBM11G.dts
&gt; index f312093a22..079b4fc146 100644
&gt; --- a/target/linux/ramips/dts/RBM11G.dts
&gt; +++ b/target/linux/ramips/dts/RBM11G.dts
&gt; @@ -7,7 +7,7 @@
&gt;
&gt;  / {
&gt;         compatible =3D &quot;mikrotik,rbm11g&quot;, &quot;mediatek,mt7621-soc&quot;;
&gt; -       model =3D &quot;MikroTik RBM11G&quot;;
&gt; +       model =3D &quot;MikroTik RouterBOARD M11G&quot;;
why do you need to change the model when updating the partitions? the
commit message doesn't explain this

&gt;
&gt;         aliases {
&gt;                 led-status =3D &amp;led_usr;
&gt; @@ -90,29 +90,54 @@
&gt;                 #size-cells =3D &lt;1&gt;;
&gt;                 compatible =3D &quot;jedec,spi-nor&quot;;
&gt;                 reg =3D &lt;0&gt;;
&gt; +               // XXX empiric value to obtain actual 10MHz SCK at the ch=
ip
&gt;                 spi-max-frequency =3D &lt;3125000&gt;;
&gt;
&gt; -               partition@0 {
&gt; -                       label =3D &quot;routerboot&quot;;
&gt; -                       reg =3D &lt;0x000000 0x00F000&gt;;
&gt; -                       read-only;
&gt; -               };
&gt; -
&gt; -               factory: partition@f000 {
&gt; -                       label =3D &quot;factory&quot;;
&gt; -                       reg =3D &lt;0x00F000 0x031000&gt;;
&gt; -                       read-only;
&gt; -               };
&gt; -
&gt; -               partition@40000 {
&gt; -                       label =3D &quot;firmware&quot;;
&gt; -                       reg =3D &lt;0x040000 0xFC0000&gt;;
&gt; +               partitions {
&gt; +                       compatible =3D &quot;fixed-partitions&quot;;
&gt; +                       #address-cells =3D &lt;1&gt;;
&gt; +                       #size-cells =3D &lt;1&gt;;
&gt; +
&gt; +                       partition@0 {
&gt; +                               label =3D &quot;RouterBoot&quot;;
&gt; +                               reg =3D &lt;0x0 0x40000&gt;;
&gt; +                               read-only;
&gt; +                       };
&gt; +
&gt; +                       routerboot@0 {
&gt; +                               reg =3D &lt;0x0 0xf000&gt;;
&gt; +                               read-only;
&gt; +                       };
isn't the recommended node name &quot;partition&quot; nowadays?
both partitions above would then become &quot;partition@0&quot; -&gt; whether the
second node overwrites the first one (since both node names and
addresses/offsets are identical) or both are added to the resulting
.dtb depends on the dtc (device tree compiler) version, so I highly
recommend *NOT* doing this

&gt; +                       hard_config: hard_config@f000 {
&gt; +                               reg =3D &lt;0xf000 0x1000&gt;;
&gt; +                               read-only;
&gt; +                       };
&gt; +
&gt; +                       routerboot2@10000 {
&gt; +                               reg =3D &lt;0x10000 0xf000&gt;;
&gt; +                               read-only;
&gt; +                       };
&gt; +
&gt; +                       soft_config@20000 {
&gt; +                               reg =3D &lt;0x20000 0x1000&gt;;
&gt; +                       };
&gt; +
&gt; +                       // valid data only extends up to 0x4f but make it=
 0x1000 to match ar71xx
&gt; +                       bios@30000 {
&gt; +                               reg =3D &lt;0x30000 0x1000&gt;;
&gt; +                               read-only;
&gt; +                       };
&gt; +
&gt; +                       firmware@40000 {
&gt; +                               reg =3D &lt;0x040000 0xFC0000&gt;;
&gt; +                       };
&gt;                 };
&gt;         };
&gt;  };
&gt;
&gt;  &amp;ethernet {
&gt; -       mtd-mac-address =3D &lt;&amp;factory 0x0010&gt;;
&gt; +       mtd-mac-address =3D &lt;&amp;hard_config 0x0010&gt;;
if you keep only the big RouterBoot partition you can simply use that
here (you just have to add 0xf000 to the offset)


Regards
Martin

]