<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/include/mxs_nand.h, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<entry>
<title>mtd: mxs_nand: Support EDO mode for imx8mn architecture</title>
<updated>2022-10-09T08:42:26+00:00</updated>
<author>
<name>Michael Trimarchi</name>
<email>michael@amarulasolutions.com</email>
</author>
<published>2022-08-30T14:48:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=90cce0582df43762e3db4176ab392e229a3194dc'/>
<id>90cce0582df43762e3db4176ab392e229a3194dc</id>
<content type='text'>
Add support for imx8mn architecture in order to run the NAND
in fast edo mode.

Signed-off-by: Michael Trimarchi &lt;michael@amarulasolutions.com&gt;
Reviewed-by: Dario Binacchi &lt;dario.binacchi@amarulasolutions.com&gt;
Signed-off-by: Dario Binacchi &lt;dario.binacchi@amarulasolutions.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add support for imx8mn architecture in order to run the NAND
in fast edo mode.

Signed-off-by: Michael Trimarchi &lt;michael@amarulasolutions.com&gt;
Reviewed-by: Dario Binacchi &lt;dario.binacchi@amarulasolutions.com&gt;
Signed-off-by: Dario Binacchi &lt;dario.binacchi@amarulasolutions.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: gpmi: fix the bch setting backward compatible issue</title>
<updated>2022-03-28T12:22:17+00:00</updated>
<author>
<name>Han Xu</name>
<email>han.xu@nxp.com</email>
</author>
<published>2022-03-25T13:36:38+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=ed48490f8d3f8715b23071a8a1cbe5bba8c8626e'/>
<id>ed48490f8d3f8715b23071a8a1cbe5bba8c8626e</id>
<content type='text'>
Previous u-boot code changed the default bch setting behavior and caused
backward compatible issue. This fix choose the legacy bch geometry back
again as the default option. If the minimum ecc strength that NAND chips
required need to be chosen, it can be enabled by either adding DT flag
"fsl,use-minimum-ecc" or CONFIG_NAND_MXS_USE_MINIMUM_ECC in configs. The
unused flag "fsl,legacy-bch-geometry" get removed.

Fixes: 51cdf83eea (mtd: gpmi: provide the option to use legacy bch geometry)
Fixes: 616f03daba (mtd: gpmi: change the BCH layout setting for large oob NAND)
Tested-by: Tim Harvey &lt;tharvey@gateworks.com&gt;
Tested-by: Sean Nyekjaer &lt;sean@geanix.com&gt;
Signed-off-by: Han Xu &lt;han.xu@nxp.com&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previous u-boot code changed the default bch setting behavior and caused
backward compatible issue. This fix choose the legacy bch geometry back
again as the default option. If the minimum ecc strength that NAND chips
required need to be chosen, it can be enabled by either adding DT flag
"fsl,use-minimum-ecc" or CONFIG_NAND_MXS_USE_MINIMUM_ECC in configs. The
unused flag "fsl,legacy-bch-geometry" get removed.

Fixes: 51cdf83eea (mtd: gpmi: provide the option to use legacy bch geometry)
Fixes: 616f03daba (mtd: gpmi: change the BCH layout setting for large oob NAND)
Tested-by: Tim Harvey &lt;tharvey@gateworks.com&gt;
Tested-by: Sean Nyekjaer &lt;sean@geanix.com&gt;
Signed-off-by: Han Xu &lt;han.xu@nxp.com&gt;
Reviewed-by: Miquel Raynal &lt;miquel.raynal@bootlin.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nand.h: Cleanup linux/mtd/rawnand.h usage</title>
<updated>2021-10-06T13:16:23+00:00</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2021-09-22T18:50:35+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1cefed1e39f0038ac6afd9e0c48b8b85fb458fbc'/>
<id>1cefed1e39f0038ac6afd9e0c48b8b85fb458fbc</id>
<content type='text'>
We only include &lt;linux/mtd/rawnand.h&gt; in &lt;nand.h&gt; for the forward
declaration of struct nand_chip, so do that directly.  Then, include
&lt;linux/mtd/rawnand.h&gt; where required directly.

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We only include &lt;linux/mtd/rawnand.h&gt; in &lt;nand.h&gt; for the forward
declaration of struct nand_chip, so do that directly.  Then, include
&lt;linux/mtd/rawnand.h&gt; where required directly.

Signed-off-by: Tom Rini &lt;trini@konsulko.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: nand: raw: mxs_nand changes for nandbcb</title>
<updated>2020-05-10T18:55:20+00:00</updated>
<author>
<name>Han Xu</name>
<email>han.xu@nxp.com</email>
</author>
<published>2020-05-06T12:59:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=bf9382addf94c9b90033a1eac5522afae9b7a0d7'/>
<id>bf9382addf94c9b90033a1eac5522afae9b7a0d7</id>
<content type='text'>
Add more BCH setting mode and remove the unnecessary platform constrain

Signed-off-by: Han Xu &lt;han.xu@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add more BCH setting mode and remove the unnecessary platform constrain

Signed-off-by: Han Xu &lt;han.xu@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: mxs_nand: fix the gf_13/14 definition issue</title>
<updated>2020-05-10T18:55:20+00:00</updated>
<author>
<name>Han Xu</name>
<email>han.xu@nxp.com</email>
</author>
<published>2020-05-04T14:08:58+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=17282f45abba6f10842adafdd47c0f24cae6b0ef'/>
<id>17282f45abba6f10842adafdd47c0f24cae6b0ef</id>
<content type='text'>
gf_13/14 mask was not set correctly in register definition.

Signed-off-by: Han Xu &lt;han.xu@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
gf_13/14 mask was not set correctly in register definition.

Signed-off-by: Han Xu &lt;han.xu@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: gpmi: provide the option to use legacy bch geometry</title>
<updated>2020-05-10T18:55:20+00:00</updated>
<author>
<name>Ye Li</name>
<email>ye.li@nxp.com</email>
</author>
<published>2020-05-04T14:08:51+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=51cdf83eea45861f9932019db2a1b3a0a6a3af52'/>
<id>51cdf83eea45861f9932019db2a1b3a0a6a3af52</id>
<content type='text'>
Provide an option in DT to use legacy bch geometry, which compatible
with the 3.10 kernel bch setting. To enable the feature, adding
"fsl,legacy-bch-geometry" under gpmi-nand node.

NOTICE: The feature must be enabled/disabled in both u-boot and kernel.

Signed-off-by: Han Xu &lt;han.xu@nxp.com&gt;
Signed-off-by: Ye Li &lt;ye.li@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Provide an option in DT to use legacy bch geometry, which compatible
with the 3.10 kernel bch setting. To enable the feature, adding
"fsl,legacy-bch-geometry" under gpmi-nand node.

NOTICE: The feature must be enabled/disabled in both u-boot and kernel.

Signed-off-by: Han Xu &lt;han.xu@nxp.com&gt;
Signed-off-by: Ye Li &lt;ye.li@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>mtd: gpmi: change the BCH layout setting for large oob NAND</title>
<updated>2020-05-10T18:55:20+00:00</updated>
<author>
<name>Ye Li</name>
<email>ye.li@nxp.com</email>
</author>
<published>2020-05-04T14:08:50+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=616f03dabacb6c500e8a7ceb920cd08554c9fcae'/>
<id>616f03dabacb6c500e8a7ceb920cd08554c9fcae</id>
<content type='text'>
The code change updated the NAND driver BCH ECC layout algorithm to
support large oob size NAND chips(oob &gt; 1024 bytes) and proposed a new
way to set ECC layout.

Current implementation requires each chunk size larger than oob size so
the bad block marker (BBM) can be guaranteed located in data chunk. The
ECC layout always using the unbalanced layout(Ecc for both meta and
Data0 chunk), but for the NAND chips with oob larger than 1k, the driver
cannot support because BCH doesn’t support GF 15 for 2K chunk.

The change keeps the data chunk no larger than 1k and adjust the ECC
strength or ECC layout to locate the BBM in data chunk. General idea for
large oob NAND chips is

1.Try all ECC strength from the minimum value required by NAND spec to
the maximum one that works, any ECC makes the BBM locate in data chunk
can be chosen.

2.If none of them works, using separate ECC for meta, which will add one
extra ecc with the same ECC strength as other data chunks. This extra
ECC can guarantee BBM located in data chunk, of course, we need to check
if oob can afford it.

Previous code has two methods for ECC layout setting, the
legacy_calc_ecc_layout and calc_ecc_layout_by_info, the difference
between these two methods is, legacy_calc_ecc_layout set the chunk size
larger chan oob size and then set the maximum ECC strength that oob can
afford. While the calc_ecc_layout_by_info set chunk size and ECC
strength according to NAND spec. It has been proved that the first
method cannot provide safe ECC strength for some modern NAND chips, so
in current code,

1. Driver read NAND parameters first and then chose the proper ECC
layout setting method.

2. If the oob is large or NAND required data chunk larger than oob size,
chose calc_ecc_for_large_oob, otherwise use calc_ecc_layout_by_info

3. legacy_calc_ecc_layout only used for some NAND chips does not contains
necessary information. So this is only a backup plan, it is NOT
recommended to use these NAND chips.

Signed-off-by: Han Xu &lt;b45815@freescale.com&gt;
Signed-off-by: Ye Li &lt;ye.li@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The code change updated the NAND driver BCH ECC layout algorithm to
support large oob size NAND chips(oob &gt; 1024 bytes) and proposed a new
way to set ECC layout.

Current implementation requires each chunk size larger than oob size so
the bad block marker (BBM) can be guaranteed located in data chunk. The
ECC layout always using the unbalanced layout(Ecc for both meta and
Data0 chunk), but for the NAND chips with oob larger than 1k, the driver
cannot support because BCH doesn’t support GF 15 for 2K chunk.

The change keeps the data chunk no larger than 1k and adjust the ECC
strength or ECC layout to locate the BBM in data chunk. General idea for
large oob NAND chips is

1.Try all ECC strength from the minimum value required by NAND spec to
the maximum one that works, any ECC makes the BBM locate in data chunk
can be chosen.

2.If none of them works, using separate ECC for meta, which will add one
extra ecc with the same ECC strength as other data chunks. This extra
ECC can guarantee BBM located in data chunk, of course, we need to check
if oob can afford it.

Previous code has two methods for ECC layout setting, the
legacy_calc_ecc_layout and calc_ecc_layout_by_info, the difference
between these two methods is, legacy_calc_ecc_layout set the chunk size
larger chan oob size and then set the maximum ECC strength that oob can
afford. While the calc_ecc_layout_by_info set chunk size and ECC
strength according to NAND spec. It has been proved that the first
method cannot provide safe ECC strength for some modern NAND chips, so
in current code,

1. Driver read NAND parameters first and then chose the proper ECC
layout setting method.

2. If the oob is large or NAND required data chunk larger than oob size,
chose calc_ecc_for_large_oob, otherwise use calc_ecc_layout_by_info

3. legacy_calc_ecc_layout only used for some NAND chips does not contains
necessary information. So this is only a backup plan, it is NOT
recommended to use these NAND chips.

Signed-off-by: Han Xu &lt;b45815@freescale.com&gt;
Signed-off-by: Ye Li &lt;ye.li@nxp.com&gt;
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nand: mxs_nand: add API for switching different BCH layouts</title>
<updated>2019-11-03T20:49:19+00:00</updated>
<author>
<name>Igor Opaniuk</name>
<email>igor.opaniuk@toradex.com</email>
</author>
<published>2019-11-03T15:49:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9ab5f221a5e2b79ec98efa6b44f7e3d03c518bf8'/>
<id>9ab5f221a5e2b79ec98efa6b44f7e3d03c518bf8</id>
<content type='text'>
On i.MX7 in a sake of reducing the disturbances caused by a neighboring
cells in the FCB page in the NAND chip, a randomizer is enabled when
reading the FCB page by ROM bootloader.

Add API for setting BCH to specific layout (and restoring it back) used by
ROM bootloader to be able to burn it in a proper way to NAND using
nandbcb command.

Signed-off-by: Igor Opaniuk &lt;igor.opaniuk@toradex.com&gt;
Signed-off-by: Anti Sullin &lt;anti.sullin@artecdesign.ee&gt;
Tested-by: Max Krummenacher &lt;max.krummenacher@toradex.com&gt;
Reviewed-by: Oleksandr Suvorov &lt;oleksandr.suvorov@toradex.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On i.MX7 in a sake of reducing the disturbances caused by a neighboring
cells in the FCB page in the NAND chip, a randomizer is enabled when
reading the FCB page by ROM bootloader.

Add API for setting BCH to specific layout (and restoring it back) used by
ROM bootloader to be able to burn it in a proper way to NAND using
nandbcb command.

Signed-off-by: Igor Opaniuk &lt;igor.opaniuk@toradex.com&gt;
Signed-off-by: Anti Sullin &lt;anti.sullin@artecdesign.ee&gt;
Tested-by: Max Krummenacher &lt;max.krummenacher@toradex.com&gt;
Reviewed-by: Oleksandr Suvorov &lt;oleksandr.suvorov@toradex.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>i.MX6: nand: add nandbcb command for imx</title>
<updated>2019-07-19T12:51:25+00:00</updated>
<author>
<name>Shyam Saini</name>
<email>shyam.saini@amarulasolutions.com</email>
</author>
<published>2019-06-14T07:35:33+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1d43e24b946e99cb99839a7a9607db62224fb3fc'/>
<id>1d43e24b946e99cb99839a7a9607db62224fb3fc</id>
<content type='text'>
Writing/updating boot image in nand device is not
straight forward in i.MX6 platform and it requires
boot control block(BCB) to be configured.

It becomes difficult to use uboot 'nand' command to
write BCB since it requires platform specific attributes
need to be taken care of.

It is even difficult to use existing msx-nand.c driver by
incorporating BCB attributes like mxs_dma_desc does
because it requires change in mtd and nand command.

So, cmd_nandbcb implemented in arch/arm/mach-imx

BCB contains two data structures, Firmware Configuration Block(FCB)
and Discovered Bad Block Table(DBBT). FCB has nand timings,
DBBT search area, page address of firmware.

On summary, nandbcb update will
- erase the entire partition
- create BCB by creating 2 FCB/DBBT block followed by
  1 FW block based on partition size and erasesize.
- fill FCB/DBBT structures
- write FW/SPL on FW1
- write FCB/DBBT in first 2 blocks

for nand boot, up on reset bootrom look for FCB structure in
first block's if FCB found the nand timings are loaded for
further reads. once FCB read done, DTTB will load and finally
firmware will be loaded which is boot image.

Refer section "NAND Boot" from doc/imx/common/imx6.txt for more usage
information.

Reviewed-by: Stefano Babic &lt;sbabic@denx.de&gt;
Signed-off-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
Signed-off-by: Sergey Kubushyn &lt;ksi@koi8.net&gt;
Signed-off-by: Shyam Saini &lt;shyam.saini@amarulasolutions.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Writing/updating boot image in nand device is not
straight forward in i.MX6 platform and it requires
boot control block(BCB) to be configured.

It becomes difficult to use uboot 'nand' command to
write BCB since it requires platform specific attributes
need to be taken care of.

It is even difficult to use existing msx-nand.c driver by
incorporating BCB attributes like mxs_dma_desc does
because it requires change in mtd and nand command.

So, cmd_nandbcb implemented in arch/arm/mach-imx

BCB contains two data structures, Firmware Configuration Block(FCB)
and Discovered Bad Block Table(DBBT). FCB has nand timings,
DBBT search area, page address of firmware.

On summary, nandbcb update will
- erase the entire partition
- create BCB by creating 2 FCB/DBBT block followed by
  1 FW block based on partition size and erasesize.
- fill FCB/DBBT structures
- write FW/SPL on FW1
- write FCB/DBBT in first 2 blocks

for nand boot, up on reset bootrom look for FCB structure in
first block's if FCB found the nand timings are loaded for
further reads. once FCB read done, DTTB will load and finally
firmware will be loaded which is boot image.

Refer section "NAND Boot" from doc/imx/common/imx6.txt for more usage
information.

Reviewed-by: Stefano Babic &lt;sbabic@denx.de&gt;
Signed-off-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
Signed-off-by: Sergey Kubushyn &lt;ksi@koi8.net&gt;
Signed-off-by: Shyam Saini &lt;shyam.saini@amarulasolutions.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
