diff mbox series

[OpenWrt-Devel,2/2] ath79: Prepare NAND subtarget for upstream support of SPI NAND

Message ID 20191025035501.3063-3-lede@allycomm.com
State Superseded
Headers show
Series ath79: Prepare NAND subtarget for upstream support of SPI | expand

Commit Message

Jeff Kletsky Oct. 25, 2019, 3:55 a.m. UTC
From: Jeff Kletsky <git-commits@allycomm.com>

Linux 4.19 supplies the upstream spi-nand framework,
permitting porting and support of boards with SPI NAND.

  * Adjusted nand/target.mk to provide FEATURES += squashfs nand

  * Updated config-default to provide current MTD and UBI support

Defaults selected for:

  CONFIG_MTD_UBI_WL_THRESHOLD=4096
  CONFIG_MTD_UBI_BEB_LIMIT=20
  # CONFIG_MTD_UBI_FASTMAP is not set
  # CONFIG_MTD_UBI_GLUEBI is not set

The bad-block reservation limit technically should be 21 for Paragon
SPI NAND but most other devices in the class are 20 blocks per Gbit.
In Linux 5.2 this is specified on a per-chip basis through NAND_MEMORG

Includes config required for CONFIG_MTD_NAND_AR934X=y
as introduced to the ath79 platform with commit 758a4d1766

Cc: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>

---
 target/linux/ath79/nand/config-default | 27 ++++++++++++++++++--------
 target/linux/ath79/nand/target.mk      |  7 ++++---
 2 files changed, 23 insertions(+), 11 deletions(-)

Comments

Michal Cieslakiewicz Oct. 26, 2019, 10:54 a.m. UTC | #1
On Thu, 24 Oct 2019 20:55:01 -0700
Jeff Kletsky <lede@allycomm.com> wrote:

> 
> Cc: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
> 
> [...]
>
> diff --git a/target/linux/ath79/nand/config-default
> b/target/linux/ath79/nand/config-default index c8114a4985..695afdce88
> 100644 --- a/target/linux/ath79/nand/config-default
> +++ b/target/linux/ath79/nand/config-default
> @@ -1,15 +1,26 @@
> -CONFIG_BCH=y
> +CONFIG_BLK_MQ_PCI=y
>  CONFIG_MTD_NAND=y
>  CONFIG_MTD_NAND_AR934X=y
> -CONFIG_MTD_NAND_BCH=y
> +CONFIG_MTD_NAND_CORE=y
>  CONFIG_MTD_NAND_ECC=y
> -CONFIG_MTD_NAND_ECC_BCH=y
> -CONFIG_MTD_SPINAND_MT29F=y
> -CONFIG_MTD_SPINAND_ONDIEECC=y
> +CONFIG_MTD_SPI_NAND=y
>  CONFIG_MTD_UBI=y
> +CONFIG_MTD_UBI_BLOCK=y
> +CONFIG_MTD_UBI_WL_THRESHOLD=4096
>  CONFIG_MTD_UBI_BEB_LIMIT=20
> -# CONFIG_MTD_UBI_BLOCK is not set
>  # CONFIG_MTD_UBI_FASTMAP is not set
>  # CONFIG_MTD_UBI_GLUEBI is not set
> -CONFIG_MTD_UBI_WL_THRESHOLD=4096
> -# CONFIG_UBIFS_FS is not set
> +CONFIG_OF_ADDRESS_PCI=y
> +CONFIG_OF_PCI=y
> +CONFIG_OF_PCI_IRQ=y
> +CONFIG_PCI=y
> +# CONFIG_PCI_AR71XX is not set
> +CONFIG_PCI_AR724X=y
> +CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
> +CONFIG_PCI_DOMAINS=y
> +# CONFIG_PHY_AR7100_USB is not set
> +CONFIG_PHY_AR7200_USB=y
> +CONFIG_UBIFS_FS=y
> +CONFIG_UBIFS_FS_ADVANCED_COMPR=y
> +CONFIG_UBIFS_FS_LZO=y
> +CONFIG_UBIFS_FS_ZLIB=y

Hi Jeff,

Kernel config supplied here works OK with my Netgear WNDR4300 ath79/nand
support patch and provides full functionality.
I will drop 'config-default' file from my patchset and rely on your
version.

Tested-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
diff mbox series

Patch

diff --git a/target/linux/ath79/nand/config-default b/target/linux/ath79/nand/config-default
index c8114a4985..695afdce88 100644
--- a/target/linux/ath79/nand/config-default
+++ b/target/linux/ath79/nand/config-default
@@ -1,15 +1,26 @@ 
-CONFIG_BCH=y
+CONFIG_BLK_MQ_PCI=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_AR934X=y
-CONFIG_MTD_NAND_BCH=y
+CONFIG_MTD_NAND_CORE=y
 CONFIG_MTD_NAND_ECC=y
-CONFIG_MTD_NAND_ECC_BCH=y
-CONFIG_MTD_SPINAND_MT29F=y
-CONFIG_MTD_SPINAND_ONDIEECC=y
+CONFIG_MTD_SPI_NAND=y
 CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BLOCK=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
 CONFIG_MTD_UBI_BEB_LIMIT=20
-# CONFIG_MTD_UBI_BLOCK is not set
 # CONFIG_MTD_UBI_FASTMAP is not set
 # CONFIG_MTD_UBI_GLUEBI is not set
-CONFIG_MTD_UBI_WL_THRESHOLD=4096
-# CONFIG_UBIFS_FS is not set
+CONFIG_OF_ADDRESS_PCI=y
+CONFIG_OF_PCI=y
+CONFIG_OF_PCI_IRQ=y
+CONFIG_PCI=y
+# CONFIG_PCI_AR71XX is not set
+CONFIG_PCI_AR724X=y
+CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PHY_AR7100_USB is not set
+CONFIG_PHY_AR7200_USB=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_ZLIB=y
diff --git a/target/linux/ath79/nand/target.mk b/target/linux/ath79/nand/target.mk
index 91afe675c5..c565c9b2b8 100644
--- a/target/linux/ath79/nand/target.mk
+++ b/target/linux/ath79/nand/target.mk
@@ -1,9 +1,10 @@ 
 BOARDNAME := Generic devices with NAND flash
-FEATURES += squashfs nand rtc
+
+FEATURES += squashfs nand
 
 DEFAULT_PACKAGES += wpad-basic
 
 define Target/Description
-	Build firmware for Atheros AR71xx/AR913x based boards with
-	NAND flash, e.g. Netgear WNDR4300.
+	Firmware for boards using Qualcomm Atheros, MIPS-based SoCs
+	in the ar72xx and subsequent series, with support for NAND flash
 endef