Skip to contentSkip to conversation

This series of patches add support for the Cortina Access

PATCH New Alex Nemirovsky 1 participant 3 messages Mar 26, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover This series of patches add support for the Cortina Access

RAW NAND controller found in CAxxxx SoCs. Additionally, initial support is integrated into into the Cortina Access Presidio Engineering Board.

Alex Nemirovsky (1):
board: presidio-asic: Add RAW Parallel NAND support

Jason Li (1):
mtd: rawnand: ca_nand: add Cortina Access Parallel NAND controller
support

 MAINTAINERS                                   |    4 +
 configs/cortina_presidio-asic-bch16_defconfig |   35 +
 configs/cortina_presidio-asic-bch24_defconfig |   36 +
 configs/cortina_presidio-asic-bch40_defconfig |   36 +
 configs/cortina_presidio-asic-bch8_defconfig  |   36 +
 drivers/mtd/nand/raw/Kconfig                  |   30 +
 drivers/mtd/nand/raw/Makefile                 |    1 +
 drivers/mtd/nand/raw/ca_nand.c                | 4914 +++++++++++++++++++++++++
 drivers/mtd/nand/raw/ca_nand.h                | 3899 ++++++++++++++++++++
 include/configs/presidio_asic.h               |   15 +
 10 files changed, 9006 insertions(+)
 create mode 100644 configs/cortina_presidio-asic-bch16_defconfig
 create mode 100644 configs/cortina_presidio-asic-bch24_defconfig
 create mode 100644 configs/cortina_presidio-asic-bch40_defconfig
 create mode 100644 configs/cortina_presidio-asic-bch8_defconfig
 create mode 100644 drivers/mtd/nand/raw/ca_nand.c
 create mode 100644 drivers/mtd/nand/raw/ca_nand.h
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 mtd: rawnand: ca_nand: add Cortina Access Parallel NAND controller support

From: Jason Li <[email protected]>

Supports all CAxxxx SoCs which support a parallel nand controller. It should be noted that some CAxxxx Soc also support an separate SPI serial NAND controller.

This driver only supports the parallel NAND controller. A different driver supports the SPI NAND interface controller.

---

 MAINTAINERS                    |    4 +
 drivers/mtd/nand/raw/Kconfig   |   30 +
 drivers/mtd/nand/raw/Makefile  |    1 +
 drivers/mtd/nand/raw/ca_nand.c | 4914 ++++++++++++++++++++++++++++++++++++++++
 drivers/mtd/nand/raw/ca_nand.h | 3899 +++++++++++++++++++++++++++++++
 5 files changed, 8848 insertions(+)
 create mode 100644 drivers/mtd/nand/raw/ca_nand.c
 create mode 100644 drivers/mtd/nand/raw/ca_nand.h
MAINTAINERS +4 -0
index 82e4159..914f151 100644
@@ -180,6 +180,8 @@ F:	board/cortina/common/
 F:	drivers/gpio/cortina_gpio.c
 F:	drivers/watchdog/cortina_wdt.c
 F:	drivers/serial/serial_cortina.c
+F:	drivers/mtd/nand/raw/ca_nand.c
+F:	drivers/mtd/nand/raw/ca_nand.h
 
 ARM/CZ.NIC TURRIS MOX SUPPORT
 M:	Marek Behun <[email protected]>
@@ -670,6 +672,8 @@ F:	board/cortina/common/
 F:	drivers/gpio/cortina_gpio.c
 F:	drivers/watchdog/cortina_wdt.c
 F:	drivers/serial/serial_cortina.c
+F:	drivers/mtd/nand/raw/ca_nand.c
+F:	drivers/mtd/nand/raw/ca_nand.h
 
 MIPS MSCC
 M:	Gregory CLEMENT <[email protected]>
drivers/mtd/nand/raw/Kconfig +30 -0
index 23201ca..493aff6 100644
@@ -102,6 +102,36 @@ config NAND_BRCMNAND_63158
        help
          Enable support for broadcom nand driver on bcm63158.
 
+config NAND_CORTINA
+        tristate "Support Cortina-Access Parallel NAND cntlr."
+	select SYS_NAND_SELF_INIT
+        help
+          This enables the driver for the Cortina-Access Soc
+
+config NAND_CORTINA_ECC_LEVEL
+        int "Cortina-Access Parallel Nand driver HW ECC algorithm"
+        default 3
+        range 0 5
+        depends on NAND_CORTINA
+        help
+          NAND Flash ECC algorithm. Value range from 0 to 5.
+          The default value is 3.
+
+          0: Hamming algorithm. Correct 3 bad bits in 256 btyes.
+          1: Hamming algorithm. Correct 3 bad bits in 512 btyes.
+          2: BCH algorithm. Correct 8 bad bits in 1K btyes.
+          3: BCH algorithm. Correct 16 bad bits in 1K btyes.
+          4: BCH algorithm. Correct 24 bad bits in 1K btyes.
+          5: BCH algorithm. Correct 40 bad bits in 1K btyes.
+
+config NAND_CORTINA_ECC_HW_BCH
+     bool
+     default y
+     depends on NAND_CORTINA_ECC_LEVEL=2 \
+             || NAND_CORTINA_ECC_LEVEL=3 \
+             || NAND_CORTINA_ECC_LEVEL=4 \
+             || NAND_CORTINA_ECC_LEVEL=5
+
 config NAND_DAVINCI
 	bool "Support TI Davinci NAND controller"
 	help
drivers/mtd/nand/raw/Makefile +1 -0
index 9337f64..572e9e6 100644
@@ -42,6 +42,7 @@ obj-$(CONFIG_NAND_ECC_BCH) += nand_bch.o
 obj-$(CONFIG_NAND_ATMEL) += atmel_nand.o
 obj-$(CONFIG_NAND_ARASAN) += arasan_nfc.o
 obj-$(CONFIG_NAND_BRCMNAND) += brcmnand/
+obj-$(CONFIG_NAND_CORTINA) += ca_nand.o
 obj-$(CONFIG_NAND_DAVINCI) += davinci_nand.o
 obj-$(CONFIG_NAND_DENALI) += denali.o
 obj-$(CONFIG_NAND_DENALI_DT) += denali_dt.o
drivers/mtd/nand/raw/ca_nand.c new file +4914 -0

2,941 lines not on this page · raw message

drivers/mtd/nand/raw/ca_nand.h new file +3899 -0

3,899 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.7.4

Part of the diff is not shown here. View the raw message.

#2 lore raw

PATCH 2/2 board: presidio-asic: Add RAW Parallel NAND support

In reply to Alex Nemirovsky

Add Parallel NAND CAxxxx support to Cortina Access Presidio Engineering Board support

---

 configs/cortina_presidio-asic-bch16_defconfig | 35 ++++++++++++++++++++++++++
 configs/cortina_presidio-asic-bch24_defconfig | 36 +++++++++++++++++++++++++++
 configs/cortina_presidio-asic-bch40_defconfig | 36 +++++++++++++++++++++++++++
 configs/cortina_presidio-asic-bch8_defconfig  | 36 +++++++++++++++++++++++++++
 include/configs/presidio_asic.h               | 15 +++++++++++
 5 files changed, 158 insertions(+)
 create mode 100644 configs/cortina_presidio-asic-bch16_defconfig
 create mode 100644 configs/cortina_presidio-asic-bch24_defconfig
 create mode 100644 configs/cortina_presidio-asic-bch40_defconfig
 create mode 100644 configs/cortina_presidio-asic-bch8_defconfig
configs/cortina_presidio-asic-bch16_defconfig new file +35 -0
new file mode 100644
index 0000000..57ef98f
@@ -0,0 +1,35 @@
+CONFIG_ARM=y
+# CONFIG_SYS_ARCH_TIMER is not set
+CONFIG_TARGET_PRESIDIO_ASIC=y
+CONFIG_SYS_TEXT_BASE=0x04000000
+CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x400000
+CONFIG_DM_GPIO=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_IDENT_STRING="Presidio-SoC"
+CONFIG_SHOW_BOOT_PROGRESS=y
+CONFIG_BOOTDELAY=3
+CONFIG_BOARD_EARLY_INIT_R=y
+CONFIG_SYS_PROMPT="G3#"
+CONFIG_CMD_NAND=y
+CONFIG_CMD_WDT=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_TIMER=y
+CONFIG_CMD_SMC=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_UBI=y
+CONFIG_OF_CONTROL=y
+CONFIG_OF_LIVE=y
+CONFIG_DEFAULT_DEVICE_TREE="ca-presidio-engboard"
+CONFIG_ENV_IS_IN_NAND=y
+# CONFIG_NET is not set
+CONFIG_DM=y
+CONFIG_CORTINA_GPIO=y
+# CONFIG_MMC is not set
+CONFIG_MTD=y
+CONFIG_MTD_RAW_NAND=y
+CONFIG_NAND_CORTINA=y
+CONFIG_DM_SERIAL=y
+CONFIG_CORTINA_UART=y
+CONFIG_WDT=y
+CONFIG_WDT_CORTINA=y
configs/cortina_presidio-asic-bch24_defconfig new file +36 -0
new file mode 100644
index 0000000..d22eae7
@@ -0,0 +1,36 @@
+CONFIG_ARM=y
+# CONFIG_SYS_ARCH_TIMER is not set
+CONFIG_TARGET_PRESIDIO_ASIC=y
+CONFIG_SYS_TEXT_BASE=0x04000000
+CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x400000
+CONFIG_DM_GPIO=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_IDENT_STRING="Presidio-SoC"
+CONFIG_SHOW_BOOT_PROGRESS=y
+CONFIG_BOOTDELAY=3
+CONFIG_BOARD_EARLY_INIT_R=y
+CONFIG_SYS_PROMPT="G3#"
+CONFIG_CMD_NAND=y
+CONFIG_CMD_WDT=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_TIMER=y
+CONFIG_CMD_SMC=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_UBI=y
+CONFIG_OF_CONTROL=y
+CONFIG_OF_LIVE=y
+CONFIG_DEFAULT_DEVICE_TREE="ca-presidio-engboard"
+CONFIG_ENV_IS_IN_NAND=y
+# CONFIG_NET is not set
+CONFIG_DM=y
+CONFIG_CORTINA_GPIO=y
+# CONFIG_MMC is not set
+CONFIG_MTD=y
+CONFIG_MTD_RAW_NAND=y
+CONFIG_NAND_CORTINA=y
+CONFIG_NAND_CORTINA_ECC_LEVEL=4
+CONFIG_DM_SERIAL=y
+CONFIG_CORTINA_UART=y
+CONFIG_WDT=y
+CONFIG_WDT_CORTINA=y
configs/cortina_presidio-asic-bch40_defconfig new file +36 -0
new file mode 100644
index 0000000..3c39415
@@ -0,0 +1,36 @@
+CONFIG_ARM=y
+# CONFIG_SYS_ARCH_TIMER is not set
+CONFIG_TARGET_PRESIDIO_ASIC=y
+CONFIG_SYS_TEXT_BASE=0x04000000
+CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x400000
+CONFIG_DM_GPIO=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_IDENT_STRING="Presidio-SoC"
+CONFIG_SHOW_BOOT_PROGRESS=y
+CONFIG_BOOTDELAY=3
+CONFIG_BOARD_EARLY_INIT_R=y
+CONFIG_SYS_PROMPT="G3#"
+CONFIG_CMD_NAND=y
+CONFIG_CMD_WDT=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_TIMER=y
+CONFIG_CMD_SMC=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_UBI=y
+CONFIG_OF_CONTROL=y
+CONFIG_OF_LIVE=y
+CONFIG_DEFAULT_DEVICE_TREE="ca-presidio-engboard"
+CONFIG_ENV_IS_IN_NAND=y
+# CONFIG_NET is not set
+CONFIG_DM=y
+CONFIG_CORTINA_GPIO=y
+# CONFIG_MMC is not set
+CONFIG_MTD=y
+CONFIG_MTD_RAW_NAND=y
+CONFIG_NAND_CORTINA=y
+CONFIG_NAND_CORTINA_ECC_LEVEL=5
+CONFIG_DM_SERIAL=y
+CONFIG_CORTINA_UART=y
+CONFIG_WDT=y
+CONFIG_WDT_CORTINA=y
configs/cortina_presidio-asic-bch8_defconfig new file +36 -0
new file mode 100644
index 0000000..8cda753
@@ -0,0 +1,36 @@
+CONFIG_ARM=y
+# CONFIG_SYS_ARCH_TIMER is not set
+CONFIG_TARGET_PRESIDIO_ASIC=y
+CONFIG_SYS_TEXT_BASE=0x04000000
+CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x400000
+CONFIG_DM_GPIO=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_IDENT_STRING="Presidio-SoC"
+CONFIG_SHOW_BOOT_PROGRESS=y
+CONFIG_BOOTDELAY=3
+CONFIG_BOARD_EARLY_INIT_R=y
+CONFIG_SYS_PROMPT="G3#"
+CONFIG_CMD_NAND=y
+CONFIG_CMD_WDT=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_TIMER=y
+CONFIG_CMD_SMC=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_UBI=y
+CONFIG_OF_CONTROL=y
+CONFIG_OF_LIVE=y
+CONFIG_DEFAULT_DEVICE_TREE="ca-presidio-engboard"
+CONFIG_ENV_IS_IN_NAND=y
+# CONFIG_NET is not set
+CONFIG_DM=y
+CONFIG_CORTINA_GPIO=y
+# CONFIG_MMC is not set
+CONFIG_MTD=y
+CONFIG_MTD_RAW_NAND=y
+CONFIG_NAND_CORTINA=y
+CONFIG_NAND_CORTINA_ECC_LEVEL=2
+CONFIG_DM_SERIAL=y
+CONFIG_CORTINA_UART=y
+CONFIG_WDT=y
+CONFIG_WDT_CORTINA=y
include/configs/presidio_asic.h +15 -0
index 023092e..096aa07 100644
@@ -36,6 +36,8 @@
 
 #define CONFIG_SYS_TIMER_BASE		0xf4321000
 
+#define GLOBAL_SOFTWARE2		0xf43200c4
+
 /* Use external clock source */
 #define PRESIDIO_APB_CLK		125000000
 #define CORTINA_PER_IO_FREQ		PRESIDIO_APB_CLK
@@ -72,4 +74,17 @@
 #define CONFIG_SYS_MAXARGS		64
 #define CONFIG_EXTRA_ENV_SETTINGS	"silent=y\0"
 
+/* Macros for Flash */
+#define CORTINA_FLASH_CTRL_BASE	  	0xf4324000
+#define CORTINA_DMA_GLB_BASE		0xf7001000
+#define CORTINA_DMA_SSP_BASE		0xf7001a00
+#define CONFIG_SYS_FLASH_BASE		0xe0000000
+
+#ifdef CONFIG_NAND_CORTINA
+	#define CONFIG_SYS_MAX_NAND_DEVICE	1
+	#define CONFIG_SYS_NAND_MAX_CHIPS	1
+	#define CONFIG_SYS_NAND_BASE		CONFIG_SYS_FLASH_BASE
+	#define CONFIG_SYS_NAND_BASE_LIST	{ CONFIG_SYS_NAND_BASE }
+#endif
+
 #endif /* __PRESIDIO_ASIC_H */
Signature · 1 line
2.7.4