Skip to content

Introduce Allwinner H6/H616 NAND controller support

Richard Genoud linux-arm-kernel linux-devicetree linux-mtd linux-sunxi lkml 6 versions – Applied

Status from this message: Applied to nand/next after fixing the Links:, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 posting 2/226 patches 0 repliesNew
  2. v2 posting 2/224 patches 14 repliesSuperseded
  3. v4 Latest16 patches 11 repliesApplied
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v3 posting 1/215 patches12 repliesSuperseded
v2 posting 1/215 patches5 repliesSuperseded
v115 patches16 repliesSuperseded

Changes in v4 from the cover letter

- fix patches order by beginning with binding patch and finishing with dts patch
- add a patch to replace user data length hard coded value by a define as suggested by Miquèl
- un-break a line in patch 5 as suggested by Miquèl
- update Geert's series link to v5
- update patch 8 commit message with a mention to Geert's series
- address Miquèl remarks on patch 15:
- change // to /* */
- remove statics set to false

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/16dt-bindings: mtd: sunxi: Add H616 compatibleDocumentation/devicetree/bindings/mtd/allwinner,sun4i-a10-nand.yaml+38 -30 replies
2/16mtd: rawnand: sunxi: Remove superfluous register readingsdrivers/mtd/nand/raw/sunxi_nand.c+1 -20 replies
3/16mtd: rawnand: sunxi: Replace hard coded value by a definedrivers/mtd/nand/raw/sunxi_nand.c+37 -261 reply
4/16mtd: rawnand: sunxi: move ECC strenghts in sunxi_nfc_capsdrivers/mtd/nand/raw/sunxi_nand.c+16 -40 replies
5/16mtd: rawnand: sunxi: introduce reg_ecc_err_cnt in sunxi_nfc_capsdrivers/mtd/nand/raw/sunxi_nand.c+7 -21 reply
6/16mtd: rawnand: sunxi: introduce reg_user_data in sunxi_nfc_capsdrivers/mtd/nand/raw/sunxi_nand.c+8 -41 reply
7/16mtd: rawnand: sunxi: rework pattern found registersdrivers/mtd/nand/raw/sunxi_nand.c+31 -52 replies
8/16mtd: rawnand: sunxi: add has_ecc_block_512 capabilitydrivers/mtd/nand/raw/sunxi_nand.c+12 -21 reply
9/16mtd: rawnand: sunxi: introduce ecc_mode_mask in sunxi_nfc_capsdrivers/mtd/nand/raw/sunxi_nand.c+9 -40 replies
10/16mtd: rawnand: sunxi: introduce random en/dir in sunxi_nfc_capsdrivers/mtd/nand/raw/sunxi_nand.c+12 -40 replies
11/16mtd: rawnand: sunxi: introduce reg_pat_id in sunxi_nfc_capsdrivers/mtd/nand/raw/sunxi_nand.c+7 -21 reply
12/16mtd: rawnand: sunxi: introduce reg_spare_area in sunxi_nfc_capsdrivers/mtd/nand/raw/sunxi_nand.c+7 -21 reply
13/16mtd: rawnand: sunxi: introduce ecc_err_mask in sunxi_nfc_capsdrivers/mtd/nand/raw/sunxi_nand.c+6 -20 replies
14/16mtd: rawnand: sunxi: introduce sram_size in sunxi_nfc_capsdrivers/mtd/nand/raw/sunxi_nand.c+7 -51 reply
15/16mtd: rawnand: sunxi: Add support for H616 nand controllerdrivers/mtd/nand/raw/sunxi_nand.c+177 -80 replies
16/16arm64: dts: allwinner: h616: add NAND controllerarch/arm64/boot/dts/allwinner/sun50i-h616.dtsi+52 -00 replies

Reviews trailers per patch

10 of 16 patches have a Reviewed-by or Acked-by.

PatchConor DooleyJernej SkrabecChen-Yu Tsai
1/16A-b
2/16R-b
3/16A-b
4/16R-b
5/16R-b
6/16R-b
7/16
8/16R-b
9/16
10/16
11/16R-b
12/16R-b
13/16
14/16R-b
15/16
16/16

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 00/16] Introduce Allwinner H6/H616 NAND controller support

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.

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)

Patch 1 introduces allwinner,sun50i-h616-nand-controller compatible in order to differentiate from the A10 and A23.

Patch 2 removes a superfluous call, and is independent from the others.

Patch 3 replaces the hard coded value '4' used for user data length by a more meaningful define

Patches 4-14 are paving the way to the introduction of H616 NAND controller support.
They are small, without functional change and easier to review than a big patch.
They move a fixed value (register offset, field mask, SRAM size) into the struct sunxi_nfc_caps when this value is different on H6/H616.

Patch 15 introduces the support for H6/H616 NAND controller.

Patch 16 adds the NAND controller node to sun50i-h616.dtsi

Changes from v3:
- fix patches order by beginning with binding patch and finishing with dts patch
- add a patch to replace user data length hard coded value by a define as suggested by Miquèl
- un-break a line in patch 5 as suggested by Miquèl
- update Geert's series link to v5
- update patch 8 commit message with a mention to Geert's series
- address Miquèl remarks on patch 15:
- change // to /* */
- remove statics set to false

Changes from v2:
- add missing 'status = "disabled";' in nand controller node.
- factorize back clock/clock-names in binding.
- pick-up reviewed-by

Changes from v1:
- reorder patches to have dtsi/bindings patches at the end.
- reorder nand-controller and pins nodes to respect the order.
- add /omit-if-no-ref/ on pins that may be unused.
- remove pinctrl from nand controller node (this should be added to device DT).
- rework dt binding.
- fix H616 comment on chained descriptors support.
- add missing mbus_clk description.
- make ECC clock mandatory for H6 (because it's indeed mandatory).
- harmonize new clock retrieving error messages with older ones.
- harmonize commits subjects (mtd: rawnand: sunxi).
- reword commit messages to use imperative mood.
- pick-up reviewed-by

Thanks Krzysztof, Jernej, Chen-Yu and Miquèl for the reviews!

Regards,
Richard

Richard Genoud (16):
dt-bindings: mtd: sunxi: Add H616 compatible
mtd: rawnand: sunxi: Remove superfluous register readings
mtd: rawnand: sunxi: Replace hard coded value by a define
mtd: rawnand: sunxi: move ECC strenghts in sunxi_nfc_caps
mtd: rawnand: sunxi: introduce reg_ecc_err_cnt in sunxi_nfc_caps
mtd: rawnand: sunxi: introduce reg_user_data in sunxi_nfc_caps
mtd: rawnand: sunxi: rework pattern found registers
mtd: rawnand: sunxi: add has_ecc_block_512 capability
mtd: rawnand: sunxi: introduce ecc_mode_mask in sunxi_nfc_caps
mtd: rawnand: sunxi: introduce random en/dir in sunxi_nfc_caps
mtd: rawnand: sunxi: introduce reg_pat_id in sunxi_nfc_caps
mtd: rawnand: sunxi: introduce reg_spare_area in sunxi_nfc_caps
mtd: rawnand: sunxi: introduce ecc_err_mask in sunxi_nfc_caps
mtd: rawnand: sunxi: introduce sram_size in sunxi_nfc_caps
mtd: rawnand: sunxi: Add support for H616 nand controller
arm64: dts: allwinner: h616: add NAND controller

 .../mtd/allwinner,sun4i-a10-nand.yaml         |  41 +-
 .../arm64/boot/dts/allwinner/sun50i-h616.dtsi |  52 +++
 drivers/mtd/nand/raw/sunxi_nand.c             | 407 +++++++++++++++---
 3 files changed, 426 insertions(+), 74 deletions(-)

base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787

Signature · 1 line
2.47.3