The CZ.NIC Turris 1.x device tree asks the eLBC FCM NAND driver for
software BCH. Without CONFIG_NAND_ECC_BCH, nand_scan_tail() reaches
BUG() while probing the NAND chip and the board resets:
BUG at drivers/mtd/nand/raw/nand_base.c:5074/nand_scan_tail()!
This broke with commit b182816c1fb4 ("turris_1x: Normalize Kconfig
usage"), which moved the board Kconfig defaults to the defconfigs.
NAND_ECC_BCH has no prompt, so a defconfig cannot set it.
Make NAND_FSL_ELBC_DT select NAND_ECC_BCH and NAND_ECC_BCH select BCH,
and drop the now redundant CONFIG_BCH=y from the turris_1x and
kmcoge5ne defconfigs. This comes after enabling LTO on the Turris 1.x,
without which the turris_1x_sdcard u-boot.bin does not fit into the
1 MiB its SPL loads from the card.
Tested on CZ.NIC Turris 1.1.
Fixes: b182816c1fb4 ("turris_1x: Normalize Kconfig usage")
Signed-off-by: Josef Schlehofer <[email protected]>
Reviewed-by: Marek Mojík <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Heiko Schocher <[email protected]>
Cc: Michael Trimarchi <[email protected]>
Cc: Dario Binacchi <[email protected]>
Cc: Holger Brunck <[email protected]>
Cc: Priyanka Jain <[email protected]>
Cc: Marek Mojík <[email protected]>
---
Changes in v2:
- reword why this comes after enabling LTO
- move the note on BOARD_SIZE_CHECK to "configs: turris_1x: Enable LTO"
The Reviewed-by of v1 is kept: the diff is the same, only the commit
message changed.
Only the two Turris 1.x defconfigs enable NAND_FSL_ELBC_DT, so the ECC
of no other board changes.
---
configs/kmcoge5ne_defconfig | 1 -
configs/turris_1x_nor_defconfig | 1 -
configs/turris_1x_sdcard_defconfig | 1 -
drivers/mtd/nand/raw/Kconfig | 2 ++
4 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/configs/kmcoge5ne_defconfig b/configs/kmcoge5ne_defconfig
index 69ef6cf3b9b..ef03f02d1e5 100644
--- a/configs/kmcoge5ne_defconfig
+++ b/configs/kmcoge5ne_defconfig
@@ -200,5 +200,4 @@ CONFIG_QE_UEC=y
# CONFIG_PINCTRL_FULL is not set
CONFIG_QE=y
CONFIG_SYS_NS16550=y
-CONFIG_BCH=y
CONFIG_POST=y
diff --git a/configs/turris_1x_nor_defconfig b/configs/turris_1x_nor_defconfig
index d8ce4aed4a7..35df37fbc70 100644
--- a/configs/turris_1x_nor_defconfig
+++ b/configs/turris_1x_nor_defconfig
@@ -119,5 +119,4 @@ CONFIG_USB_EHCI_FSL=y
CONFIG_USB_STORAGE=y
CONFIG_WDT=y
CONFIG_WDT_MAX6370=y
-CONFIG_BCH=y
# CONFIG_BINMAN_FDT is not set
diff --git a/configs/turris_1x_sdcard_defconfig
b/configs/turris_1x_sdcard_defconfig
index 982a6cb0703..5e99d895b2f 100644
--- a/configs/turris_1x_sdcard_defconfig
+++ b/configs/turris_1x_sdcard_defconfig
@@ -151,4 +151,3 @@ CONFIG_USB_EHCI_FSL=y
CONFIG_WDT=y
CONFIG_WDT_MAX6370=y
CONFIG_FAT_WRITE=y
-CONFIG_BCH=y
diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
index 6084b614358..b0ae441900b 100644
--- a/drivers/mtd/nand/raw/Kconfig
+++ b/drivers/mtd/nand/raw/Kconfig
@@ -240,6 +240,7 @@ config NAND_FSL_ELBC
config NAND_FSL_ELBC_DT
bool "Support Freescale Enhanced Local Bus Controller FCM NAND driver
(DT mode)"
depends on NAND_FSL_ELBC
+ select NAND_ECC_BCH
config NAND_FSL_IFC
bool "Support Freescale Integrated Flash Controller NAND driver"
@@ -259,6 +260,7 @@ config NAND_KIRKWOOD
config NAND_ECC_BCH
bool
+ select BCH
config NAND_KMETER1
bool "Support KMETER1 NAND controller"
--
2.54.0 (Apple Git-157)