public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 00/24] Introduce Allwinner H6/H616 NAND controller support
@ 2025-10-16 14:27 Richard Genoud
  2025-10-16 14:27 ` [PATCH 01/24] mtd: rawnand: sunxi: cosmetic: remove needless comment Richard Genoud
                   ` (23 more replies)
  0 siblings, 24 replies; 43+ messages in thread
From: Richard Genoud @ 2025-10-16 14:27 UTC (permalink / raw)
  To: Jagan Teki, Andre Przywara, Tom Rini, Hans de Goede,
	Lukasz Majewski, Sean Anderson, Dario Binacchi, Michael Trimarchi
  Cc: Jernej Skrabec, Chen-Yu Tsai, Andrey Skvortsov, Marek Vasut,
	Dinesh Maniyam, Anand Gore, Linus Walleij, david regan,
	Andrew Goodbody, Miquel Raynal, Thomas Petazzoni, u-boot,
	Richard Genoud

Hi everyone,

This patch series introduce H6/H616 NAND controller support (but not yet
the DMA/MDMA part).

All the work was done on a H616 board with a Kioxia TC58NVG1S3HTA00 NAND
chip.
ECC is supported, as well as scrambling.

Support for booting from NAND is not part of this series, but it's almost
ready. (It needs quite some modifications in sunxi-spl-image-builder.c
and sunxi_toc0.c)

H6 SoC has not been tested, but it shares all registers with H616, plus
some registers dedicated to Embedded Crypto Engine that H616 lacks.

This IP has quite some register fields modified from the A10/A23, but in
the end, it works more or less the same.
Main differences with A10/A23 are:
- The need for 2 more clocks (for ECC and MBUS)
- The use of a new USER_DATA_LEN register
- More ECC strengths (44, 52, 68, 72, 76 and 80 bits / 1KB)
- MDMA based on chained buffers
- some registers layouts have changed (mainly due do the stronger ECC)

Patches 1 and 2 are small fixes

Patches 3-6 harmonize the registers definitions between U-Boot and SPL,
and ultimately merge those definitions in an include file, without
functional change.

Patches 7-19 are paving the way to the introduction of H6/H616 NAND
controller by adding per SoC capabilities for both drivers. They are
small for an easier review, without functional change.

Patches 20-21 are adding missing NAND related clocks definitions for
H6/H616

Patch 22 adds the support for H6/H616 NAND controller in U-Boot.

Patch 23 adds the support for H6/H616 NAND controller in SPL.

Patch 24 fixes warnings in sunxi_nand_spl.c

A similar series for this NAND controller support in Linux has been sent
and being reviewed.

Richard Genoud (24):
  mtd: rawnand: sunxi: cosmetic: remove needless comment
  mtd: rawnand: sunxi_spl: fix pointer from integer without a cast
  mtd: rawnand: sunxi_spl: cosmetic: harmonize register defines with non
    spl file
  mtd: rawnand: sunxi_spl: cosmetic: use definitions from
    linux/mtd/rawnand.h
  mtd: rawnand: sunxi_spl: cosmetic: replace AHB_DIV_1 by
    CCM_NAND_CTRL_M/N
  mtd: rawnand: sunxi: cosmetic: merge register definitions for
    sunxi_nand{,_spl}.c
  mtd: rawnand: sunxi: cosmetic: add per SoC capabilities
  mtd: rawnand: sunxi: cosmetic: move ECC_ERR_CNT register offset in SoC
    caps
  mtd: rawnand: sunxi: cosmetic: move USER_DATA register offset in SoC
    caps
  mtd: rawnand: sunxi: cosmetic: move ECC_PAT_FOUND register in SoC caps
  mtd: rawnand: sunxi: cosmetic: add has_ecc_block_512 capability
  mtd: rawnand: sunxi: cosmetic: move NFC_ECC_MODE offset in SoC caps
  mtd: rawnand: sunxi: cosmetic: introduce reg_pat_id in sunxi_nfc_caps
  mtd: rawnand: sunxi_spl: cosmetic: add per SoC capabilities
  mtd: rawnand: sunxi: cosmetic: move NFC_RANDOM_EN register offset in
    SoC caps
  mtd: rawnand: sunxi: cosmetic: introduce reg_spare_area in
    sunxi_nfc_caps
  mtd: rawnand: sunxi_spl: use NFC_ECC_ERR_MSK and NFC_ECC_PAT_FOUND
  mtd: rawnand: sunxi_spl: increase max_oobsize for 2KiB pages
  mtd: rawnand: sunxi_spl: cosmetic: use NFC_ECC_MODE and
    NFC_RANDOM_SEED macros
  sunxi: clock: H6: add NAND controller clock registers
  clk: sunxi: Add MBUS Master Clock Gating Register
  mtd: rawnand: sunxi: add support for H6/H616 nand controller
  mtd: rawnand: sunxi_spl: add support for H6/H616 nand controller
  mtd: rawnand: sunxi_spl: Fix cast to pointer from integer warnings

 .../include/asm/arch-sunxi/clock_sun50i_h6.h  |  24 ++
 board/sunxi/board.c                           |  17 +-
 drivers/clk/sunxi/clk_h6.c                    |   2 +
 drivers/clk/sunxi/clk_h616.c                  |   2 +
 drivers/mtd/nand/raw/Kconfig                  |   3 +-
 drivers/mtd/nand/raw/sunxi_nand.c             | 301 ++++++++---------
 drivers/mtd/nand/raw/sunxi_nand.h             | 229 +++++++++++++
 drivers/mtd/nand/raw/sunxi_nand_spl.c         | 305 +++++++++++-------
 8 files changed, 616 insertions(+), 267 deletions(-)
 create mode 100644 drivers/mtd/nand/raw/sunxi_nand.h


base-commit: 2ba64e303b2706e5c42a6bf982326d632342ca66

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

end of thread, other threads:[~2025-10-20 14:05 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-16 14:27 [PATCH 00/24] Introduce Allwinner H6/H616 NAND controller support Richard Genoud
2025-10-16 14:27 ` [PATCH 01/24] mtd: rawnand: sunxi: cosmetic: remove needless comment Richard Genoud
2025-10-17  7:56   ` Andre Przywara
2025-10-16 14:27 ` [PATCH 02/24] mtd: rawnand: sunxi_spl: fix pointer from integer without a cast Richard Genoud
2025-10-17  7:57   ` Andre Przywara
2025-10-17 12:48     ` Richard GENOUD
2025-10-16 14:27 ` [PATCH 03/24] mtd: rawnand: sunxi_spl: cosmetic: harmonize register defines with non spl file Richard Genoud
2025-10-17  7:57   ` Andre Przywara
2025-10-17 14:22     ` Richard GENOUD
2025-10-17 14:27       ` Andre Przywara
2025-10-16 14:27 ` [PATCH 04/24] mtd: rawnand: sunxi_spl: cosmetic: use definitions from linux/mtd/rawnand.h Richard Genoud
2025-10-17  9:35   ` Andre Przywara
2025-10-16 14:27 ` [PATCH 05/24] mtd: rawnand: sunxi_spl: cosmetic: replace AHB_DIV_1 by CCM_NAND_CTRL_M/N Richard Genoud
2025-10-17  9:36   ` Andre Przywara
2025-10-17 14:26     ` Richard GENOUD
2025-10-16 14:27 ` [PATCH 06/24] mtd: rawnand: sunxi: cosmetic: merge register definitions for sunxi_nand{, _spl}.c Richard Genoud
2025-10-17 23:09   ` [PATCH 06/24] mtd: rawnand: sunxi: cosmetic: merge register definitions for sunxi_nand{,_spl}.c Andre Przywara
2025-10-16 14:27 ` [PATCH 07/24] mtd: rawnand: sunxi: cosmetic: add per SoC capabilities Richard Genoud
2025-10-17 23:10   ` Andre Przywara
2025-10-16 14:27 ` [PATCH 08/24] mtd: rawnand: sunxi: cosmetic: move ECC_ERR_CNT register offset in SoC caps Richard Genoud
2025-10-17 23:10   ` Andre Przywara
2025-10-16 14:27 ` [PATCH 09/24] mtd: rawnand: sunxi: cosmetic: move USER_DATA " Richard Genoud
2025-10-17 23:10   ` Andre Przywara
2025-10-16 14:27 ` [PATCH 10/24] mtd: rawnand: sunxi: cosmetic: move ECC_PAT_FOUND register " Richard Genoud
2025-10-17 23:11   ` Andre Przywara
2025-10-20  6:46     ` Richard GENOUD
2025-10-16 14:27 ` [PATCH 11/24] mtd: rawnand: sunxi: cosmetic: add has_ecc_block_512 capability Richard Genoud
2025-10-17 23:11   ` Andre Przywara
2025-10-20  7:02     ` Richard GENOUD
2025-10-16 14:27 ` [PATCH 12/24] mtd: rawnand: sunxi: cosmetic: move NFC_ECC_MODE offset in SoC caps Richard Genoud
2025-10-16 14:27 ` [PATCH 13/24] mtd: rawnand: sunxi: cosmetic: introduce reg_pat_id in sunxi_nfc_caps Richard Genoud
2025-10-16 14:27 ` [PATCH 14/24] mtd: rawnand: sunxi_spl: cosmetic: add per SoC capabilities Richard Genoud
2025-10-16 14:27 ` [PATCH 15/24] mtd: rawnand: sunxi: cosmetic: move NFC_RANDOM_EN register offset in SoC caps Richard Genoud
2025-10-16 14:27 ` [PATCH 16/24] mtd: rawnand: sunxi: cosmetic: introduce reg_spare_area in sunxi_nfc_caps Richard Genoud
2025-10-16 14:27 ` [PATCH 17/24] mtd: rawnand: sunxi_spl: use NFC_ECC_ERR_MSK and NFC_ECC_PAT_FOUND Richard Genoud
2025-10-16 14:27 ` [PATCH 18/24] mtd: rawnand: sunxi_spl: increase max_oobsize for 2KiB pages Richard Genoud
2025-10-16 14:27 ` [PATCH 19/24] mtd: rawnand: sunxi_spl: cosmetic: use NFC_ECC_MODE and NFC_RANDOM_SEED macros Richard Genoud
2025-10-16 14:27 ` [PATCH 20/24] sunxi: clock: H6: add NAND controller clock registers Richard Genoud
2025-10-16 14:27 ` [PATCH 21/24] clk: sunxi: Add MBUS Master Clock Gating Register Richard Genoud
2025-10-16 14:27 ` [PATCH 22/24] mtd: rawnand: sunxi: add support for H6/H616 nand controller Richard Genoud
2025-10-20 14:05   ` Richard GENOUD
2025-10-16 14:27 ` [PATCH 23/24] mtd: rawnand: sunxi_spl: " Richard Genoud
2025-10-16 14:27 ` [PATCH 24/24] mtd: rawnand: sunxi_spl: Fix cast to pointer from integer warnings Richard Genoud

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