From: Jernej Skrabec <jernej.skrabec@gmail.com>
To: jagan@amarulasolutions.com, andre.przywara@arm.com
Cc: trini@konsulko.com, macromorgan@hotmail.com, uwu@icenowy.me,
u-boot@lists.denx.de, linux-sunxi@lists.linux.dev,
Jernej Skrabec <jernej.skrabec@gmail.com>
Subject: [PATCH 0/5] sunxi: h6/h616: consolidate DRAM code
Date: Fri, 11 Apr 2025 18:14:34 +0200 [thread overview]
Message-ID: <20250411161439.4743-1-jernej.skrabec@gmail.com> (raw)
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
--
2.49.0
next reply other threads:[~2025-04-11 16:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-11 16:14 Jernej Skrabec [this message]
2025-04-11 16:14 ` [PATCH 1/5] sunxi: h616: Panic if DRAM size is not detected Jernej Skrabec
2025-04-11 16:14 ` [PATCH 2/5] sunxi: H6: Remove useless DRAM timings parameter Jernej Skrabec
2025-04-15 23:05 ` Andre Przywara
2025-04-11 16:14 ` [PATCH 3/5] sunxi: H6: DRAM: Constify function parameters Jernej Skrabec
2025-04-15 23:06 ` Andre Przywara
2025-04-11 16:14 ` [PATCH 4/5] sunxi: h6: dram: split dram_para struct Jernej Skrabec
2025-04-28 13:40 ` Andre Przywara
2025-04-11 16:14 ` [PATCH 5/5] sunxi: h6/h616: Reuse common DRAM infrastructure Jernej Skrabec
2025-04-15 23:40 ` Andre Przywara
2025-04-16 16:30 ` Jernej Škrabec
2025-04-17 0:18 ` Andre Przywara
2025-04-26 18:43 ` Jernej Škrabec
2025-04-28 14:01 ` Andre Przywara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250411161439.4743-1-jernej.skrabec@gmail.com \
--to=jernej.skrabec@gmail.com \
--cc=andre.przywara@arm.com \
--cc=jagan@amarulasolutions.com \
--cc=linux-sunxi@lists.linux.dev \
--cc=macromorgan@hotmail.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=uwu@icenowy.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox