[EXT] [PATCH] mtd: mxs_nand: default to legacy bch and rename to modern bch option

Sean Nyekjaer sean at geanix.com
Thu May 20 11:09:44 CEST 2021


On 13/05/2021 22.02, han.xu wrote:
> On 21/05/11 07:08AM, Sean Nyekjaer wrote:
>> Caution: EXT Email
>>
>> On 11/05/2021 04.49, han.xu wrote:
>>> On 21/05/10 12:00PM, Sean Nyekjaer wrote:
>>>> Caution: EXT Email
>>>>
>>>> Linux kernel defaults to use legacy bch setting, this was creating a
>>>> mismatch between U-boot and Linux default settings.
>>> Kernel uses the NAND chip specified minimum ecc strength and steps by default
>>> not the legacy bch setting, unless users enable it in DT file.
>>>
>>
>> Hi,
>>
>> Adding, mtd-list and Miquel
>>
>> With u-boot dtb:
>> &gpmi {
>>         pinctrl-names = "default";
>>         pinctrl-0 = <&pinctrl_gpmi_nand1>;
>>         compatible = "fsl,imx7d-gpmi-nand";
>>         nand-on-flash-bbt;
>>         status = "okay";
>> };
>>
>> With linux dtb (mainline 5.10):
>> &gpmi {
>>         pinctrl-names = "default";
>>         pinctrl-0 = <&pinctrl_gpmi_nand1>;
>>         nand-on-flash-bbt;
>>         status = "okay";
>> };
>>
>> U-boot prior to commit 51cdf83eea selected 18 bit ECC, after that commit it selects 8 bits.
>> With legacy option it selects 18.
>> Linux is selecting 18 bits ;) So now we have a mismatch.
>>
>> I have been searching for the legacy option in the mainline kernel can't find it ;)
>> Please show me where it is (is it in the NXP fork?)
> 
> You are right, it's only fixed in NXP fork, with kernel driver modification. We
> prefer the current u-boot bch geometry, so I will send out a kernel patch to
> make them align.
> 
Any progress on this?

I see your patch in:
https://source.codeaurora.org/external/imx/linux-imx/commit/drivers/mtd/nand/raw/gpmi-nand?h=imx_5.4.70_2.3.0&id=ae980dccc6189956fab047958ad0a70ec4951439

But I can't find the option for selecting legacy mode in the devicetree...

/Sean


More information about the U-Boot mailing list