Pull request for u-boot-nand-20230422

Replaces a patch by Linus Walleij merged with pull request
 u-boot-nand-20230417, with a newer version that contains fixes for tests
 run by Tom Rini.
 -----BEGIN PGP SIGNATURE-----
 
 iQJYBAABCgBCFiEE6GOTDNYiFygVXvMmQBtB6IWRjvEFAmRET1IkHGRhcmlvLmJp
 bmFjY2hpQGFtYXJ1bGFzb2x1dGlvbnMuY29tAAoJEEAbQeiFkY7xh+MP/0UmFIKR
 vT0u5HWVStqFRiVYO1Fa3qtolB/cHAXgt7W4zBg1MJUmyySy+h0DpKJhMpZv4Gy6
 DKC6NMpU9icieFbebqr/tomLnhTkGgFY8orvs6xxuOEzNIDUwuOq+FaZ0UBWyorP
 D6WxA53rqw3tKrnuephjupDxevuJzcsA4KKNLixFJrJpa0I73y97VIXDAKIVO+1z
 GyjhedEdjcO3HoWIRSCWpxTvl/TJy1OO7gGW5gvOw/JKmoTw2ISEdn+rbtTKwcaX
 +LFtVUTxvEa5Srgb94+Qi0dfajXh9rFT7v2tfIqfTGErnCsxOODNwxevwBY1fHg6
 gMX5wGCn2YdmGIfAogWS2TgbntRvpEc4tzQzAemu6259tLRTtuUOmJZ58SAODZLB
 8VJuRBvQ9OzVemH1XsA1yVShUcxYiUQENRJaSVWQeoY9sH5T8dC6SBOhmQdNS7S0
 ECFKoL+AmXlJDchq8VEthAydjburTPd3buHuHGGuWJoILE0ePn2YSzvN/B6cKlbO
 iG0xmcqUixtoUO7rjunkr9uOKVa0yILpThCk+8kcvNHcXPXfyl1x0OQidh7PfFYS
 1XUsY9N58ztXQrGEaVLMbyx2XuycCu4lD+1RxPsq3MQ3DhznjpNCT3hizzTwePZb
 BtwNxIkP1hIEnaCrpAcaHyxYsxkyWTV4cM+y
 =vRbu
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-nand-20230422' of https://source.denx.de/u-boot/custodians/u-boot-nand-flash

Pull request for u-boot-nand-20230422

Replaces a patch by Linus Walleij merged with pull request
u-boot-nand-20230417, with a newer version that contains fixes for tests
run by Tom Rini.
This commit is contained in:
Tom Rini 2023-04-22 18:30:31 -04:00
commit 03972a10ac

View file

@ -4514,12 +4514,21 @@ static int nand_dt_init(struct mtd_info *mtd, struct nand_chip *chip, ofnode nod
}
str = ofnode_read_string(node, "nand-ecc-algo");
if (str && !strcmp(str, "bch")) {
ecc_algo = NAND_ECC_BCH;
if (ecc_mode == NAND_ECC_SOFT)
ecc_mode = NAND_ECC_SOFT_BCH;
} else if (!strcmp(str, "hamming")) {
ecc_algo = NAND_ECC_HAMMING;
if (str) {
/*
* If we are in NAND_ECC_SOFT mode, just alter the
* soft mode to BCH here. No change of algorithm.
*/
if (ecc_mode == NAND_ECC_SOFT) {
if (!strcmp(str, "bch"))
ecc_mode = NAND_ECC_SOFT_BCH;
} else {
if (!strcmp(str, "bch")) {
ecc_algo = NAND_ECC_BCH;
} else if (!strcmp(str, "hamming")) {
ecc_algo = NAND_ECC_HAMMING;
}
}
}
ecc_strength = ofnode_read_s32_default(node,
@ -4533,7 +4542,13 @@ static int nand_dt_init(struct mtd_info *mtd, struct nand_chip *chip, ofnode nod
return -EINVAL;
}
chip->ecc.algo = ecc_algo;
/*
* Chip drivers may have assigned default algorithms here,
* onlt override it if we have found something explicitly
* specified in the device tree.
*/
if (ecc_algo != NAND_ECC_UNKNOWN)
chip->ecc.algo = ecc_algo;
if (ecc_mode >= 0)
chip->ecc.mode = ecc_mode;