Skip to content

sunxi: h6/h616: consolidate DRAM code

Jernej Skrabec linux-sunxi u-boot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5sunxi: h616: Panic if DRAM size is not detectedarch/arm/mach-sunxi/dram_sun50i_h616.c+13 -30 replies
2/5sunxi: H6: Remove useless DRAM timings parameterarch/arm/include/asm/arch-sunxi/dram_sun50i_h6.h arch/arm/mach-sunxi/dram_sun50i_h6.c arch/arm/mach-sunxi/dram_timings/h6_ddr3_1333.c +1 more+4 -41 reply
3/5sunxi: H6: DRAM: Constify function parametersarch/arm/mach-sunxi/dram_sun50i_h6.c+10 -101 reply
4/5sunxi: h6: dram: split dram_para structarch/arm/include/asm/arch-sunxi/dram_sun50i_h6.h arch/arm/mach-sunxi/dram_sun50i_h6.c+82 -701 reply
5/5sunxi: h6/h616: Reuse common DRAM infrastructurearch/arm/include/asm/arch-sunxi/dram_dw_helpers.h arch/arm/mach-sunxi/Makefile arch/arm/mach-sunxi/dram_dw_helpers.c +2 more+190 -2425 replies

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by.

PatchAndre Przywara
1/5
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] sunxi: h6/h616: consolidate DRAM code

While working on A523 support, it became obvious that newer sunxi DRAM drivers are similar in many ways, so it makes sense to share some code between them. Let's start with DRAM size and ranks detection. There were many fixes for it in H616 driver, so make sense to unify code interface and split out h616 part into separate file and reuse it for h6 too. This will probably solve some DRAM size detection issues on h6 reported through the years.

Patch 1 adds more error reporting in case rows or column size is not correctly detected.

Patches 2-4 bring h6 code close enough to h616 so code sharing is possible.

Patch 5 splits out h616 code and reuse it on h6.

Note I'm currently not able test the code, so if anyone else could do it I would appreciate very much.

There are further possibilities regarding code sharing in the future, like:
- memory controller is pretty similar for H6, H616 and A523
- unify config and parameters structures

Best regards,
Jernej

Jernej Skrabec (5):
sunxi: h616: Panic if DRAM size is not detected
sunxi: H6: Remove useless DRAM timings parameter
sunxi: H6: DRAM: Constify function parameters
sunxi: h6: dram: split dram_para struct
sunxi: h6/h616: Reuse common DRAM infrastructure

 .../include/asm/arch-sunxi/dram_dw_helpers.h  |  22 +++
 .../include/asm/arch-sunxi/dram_sun50i_h6.h   |   9 +-
 arch/arm/mach-sunxi/Makefile                  |   4 +-
 arch/arm/mach-sunxi/dram_dw_helpers.c         | 160 ++++++++++++++++
 arch/arm/mach-sunxi/dram_sun50i_h6.c          | 180 +++++-------------
 arch/arm/mach-sunxi/dram_sun50i_h616.c        | 145 +-------------
 .../mach-sunxi/dram_timings/h6_ddr3_1333.c    |   2 +-
 arch/arm/mach-sunxi/dram_timings/h6_lpddr3.c  |   2 +-
 8 files changed, 247 insertions(+), 277 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-sunxi/dram_dw_helpers.h
 create mode 100644 arch/arm/mach-sunxi/dram_dw_helpers.c
Signature · 1 line
2.49.0