Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v8 0/4] Add Cortina Systems CS7542 NAND controller support
@ 2026-12-04 14:03 Fil Dunsky via B4 Relay
  2026-12-04 14:03 ` [PATCH v8 1/4] mtd: rawnand: Honor controller raw page callbacks in ECC_NONE Fil Dunsky via B4 Relay
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Fil Dunsky via B4 Relay @ 2026-12-04 14:03 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Philipp Zabel
  Cc: linux-mtd, devicetree, linux-kernel

Add a programmed-I/O driver for the Cortina CS7542 NAND controller.
The controller accepts complete command, address and data phases. Use
the NAND core operation parser to validate and issue those phases.

The binding describes both chip selects, both bus widths and the
Hamming and BCH engines. The driver supports one 8-bit target,
on-host Hamming with the existing Almond+ layout, software ECC and
raw data. It initializes the reset and NAND timing at probe.

On Almond+, the reviewed driver identified the 512 MiB Spansion
S34ML04G1 and read matching U-Boot and kernel samples from RAM. It
returned to the installed OpenWrt with all partitions read-only.

I also used one isolated spare physical eraseblock per ECC mode on
Almond+. Hardware Hamming, software Hamming and ECC_NONE each passed
page writes and reads, erase verification, auto OOB and raw data/OOB.
The Hamming modes corrected an injected single-bit change. ECC_NONE
returned the altered byte without correction. Each test restored the
original UBI erase-counter header and left the rest of the block
erased, then returned to OpenWrt with the five UBI volumes intact.

---
Changes in v8:
- Use the NAND operation parser and transfer data directly to and from
  the caller's buffers.
- Reject unsupported transfers before programming the controller.
- Reset the controller and program its default asynchronous timing.
- Keep controller-supplied raw page callbacks in the NAND core for
  ECC_NONE. Disable on-host ECC for software ECC and NONE. Keep the geometry
  checks and the full-page write constraint local to on-host Hamming.
- Use the standard MTD name and remove informational probe messages.
- Link to v7: https://patch.msgid.link/20261202-b4-cs7542-nand-v7-0-81d3ed341c77@gmail.com

Changes in v7:
- Keep the 100 ms PIO transfer budget independent of NAND WAITRDY.
- Use time-based tight polling for generic PIO completion.
- Reproduce the v6 regression and check full parameter and page reads,
  readiness errors and a stuck request in mocked MMIO; compile the
  affected ARM object for Linux and OpenWrt.
- Share the 100 ms transfer budget across Hamming page data and OOB.
  Keep separate ECC and ready/busy waits, and the per-word stall limit.
- Treat a cleared request bit on the final word as completion. Cover
  expiry at the boundary, a delayed observation of completion and a
  final request still pending at the deadline in the MMIO model.
- Before the final-word change, the driver in an OpenWrt RAM kernel
  on Almond+   matched ECC data and raw/generic OOB for 128 pages across all four
  banks, with all MTD partitions read-only. The watchdog returned to
  OpenWrt. The Hamming write and timeout faults were tested in MMIO
  mocks with GCC and Clang.
- Link to v6: https://patch.msgid.link/20261201-b4-cs7542-nand-v6-0-e6b0d712745b@gmail.com

Changes in v6:
- Bound each PIO transfer with one deadline and preserve the cached
  read position when rejecting a change-column request.
- Link to v5: https://patch.msgid.link/20261127-b4-cs7542-nand-v5-0-45b1a92bd13d@gmail.com

Changes in v5:
- Select the available NAND child, including CS1 when CS0 is disabled.
- Reject ECC_NONE; retain software ECC and monolithic raw transfers.
- Check the changed attach and probe paths with actual-source tests.
- Link to v4: https://patch.msgid.link/20261126-b4-cs7542-nand-v4-0-38e488f6f8b1@gmail.com

Changes in v4:
- Address Miquel Raynal's binding and driver review on v2.
- Describe controller capabilities rather than only the initial driver.
- Add the AXI clock, flash IRQ, optional reset and data aperture binding.
- Separate supports_op() and remove the NAND opcode whitelist.
- Use core page helpers for hardware ECC; allow software ECC/raw transfers.
- Support either chip select and reject multiple connected targets explicitly.
- Preserve bus timing through clock rate exclusivity; do not pulse flash reset.
- Clarify the vendor EXTADDR convention; retain the existing Hamming layout.
- Link to v3: https://patch.msgid.link/20261125-b4-cs7542-nand-v3-0-0b6d141c102e@gmail.com

---
Fil Dunsky (4):
      mtd: rawnand: Honor controller raw page callbacks in ECC_NONE
      dt-bindings: mtd: Add Cortina CS7542 NAND controller
      mtd: rawnand: Add Cortina CS7542 controller support
      MAINTAINERS: Add Cortina CS7542 NAND controller entry

 .../bindings/mtd/cortina,cs7542-nand.yaml          |  89 +++
 MAINTAINERS                                        |   7 +
 drivers/mtd/nand/raw/Kconfig                       |  11 +
 drivers/mtd/nand/raw/Makefile                      |   1 +
 drivers/mtd/nand/raw/cs752x_nand.c                 | 756 +++++++++++++++++++++
 drivers/mtd/nand/raw/nand_base.c                   |  10 +-
 6 files changed, 870 insertions(+), 4 deletions(-)
---
base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f
change-id: 20261123-b4-cs7542-nand-87997e300079

Best regards,
--  
Fil Dunsky <filipp.dunsky@gmail.com>



______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-12-04 15:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 14:03 [PATCH v8 0/4] Add Cortina Systems CS7542 NAND controller support Fil Dunsky via B4 Relay
2026-12-04 14:03 ` [PATCH v8 1/4] mtd: rawnand: Honor controller raw page callbacks in ECC_NONE Fil Dunsky via B4 Relay
2026-12-04 14:03 ` [PATCH v8 2/4] dt-bindings: mtd: Add Cortina CS7542 NAND controller Fil Dunsky via B4 Relay
2026-12-04 14:12   ` Philipp Zabel
2026-12-04 14:38   ` sashiko-bot
2026-12-04 14:03 ` [PATCH v8 3/4] mtd: rawnand: Add Cortina CS7542 controller support Fil Dunsky via B4 Relay
2026-12-04 14:12   ` Philipp Zabel
2026-12-04 15:37     ` Fil Dunsky
2026-12-04 15:05   ` sashiko-bot
2026-12-04 14:03 ` [PATCH v8 4/4] MAINTAINERS: Add Cortina CS7542 NAND controller entry Fil Dunsky via B4 Relay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox