public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 0/5] sunxi: H616: improve DRAM setup and add LPDDR3 support
@ 2023-06-07  0:07 Andre Przywara
  2023-06-07  0:07 ` [PATCH 1/5] sunxi: dram: make MBUS configuration functions static Andre Przywara
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Andre Przywara @ 2023-06-07  0:07 UTC (permalink / raw)
  To: Jagan Teki, Mikhail Kalashnikov
  Cc: Jernej Skrabec, Samuel Holland, Icenowy Zheng, Piotr Oniszczuk,
	u-boot, linux-sunxi

Hi,

this series picks up on Mikhail's H616 LPDDR3 DRAM support (many thanks
again for sending that!), and prepends some patches that help to keep
the code size down.
This was triggered by Mikhail's patches creating bigger binaries, even
though the DRAM type is known at compile time, and the compiler should
optimise out the unused code parts.
Looking at the disassembly I found some issues that this series fixes:
- One function was not declared static, so was issued separately in the
  object file (patch 1/5).
- Many functions do not change the values in the struct that gets passed
  in, so we should mark this pointer as "const", to help the compiler
  with the "constant propagation" optimisation (patch 2/5).
- This alone does not really help, as this structure contains both
  variable and fixed fields. Patch 3/5 splits that up, so we can define
  one struct as "static const", which finally convinces the compiler to
  fold the compile-time constants into the code, and removes the code
  for the unused DRAM variant, along with other code parts. Even without
  the LPDDR3 support this reduces the code size by about 2KB(!), and
  allows the LPDDR3 patches to come for free, code-size wise.
- The final two patches are Mikhail's patches, slightly massaged: white
  space issue, keeping the static const phy_init[] array, rebased on
  top of the "const" work above. I haven't reviewed the patch in anger,
  though.

Please have a look and test.

Cheers,
Andre

Andre Przywara (3):
  sunxi: dram: make MBUS configuration functions static
  sunxi: H616: dram: const-ify DRAM function parameters
  sunxi: H616: dram: split struct dram_para

iuncuim (2):
  sunxi: H616: add DRAM type selection
  sunxi: H616: add LPDDR3 DRAM support

 .../include/asm/arch-sunxi/dram_sun50i_h616.h |  12 +-
 arch/arm/mach-sunxi/Kconfig                   |  18 +-
 arch/arm/mach-sunxi/dram_sun50i_h6.c          |   3 +-
 arch/arm/mach-sunxi/dram_sun50i_h616.c        | 383 +++++++++++-------
 arch/arm/mach-sunxi/dram_sunxi_dw.c           |  18 +-
 arch/arm/mach-sunxi/dram_timings/Makefile     |   4 +-
 .../mach-sunxi/dram_timings/h616_ddr3_1333.c  |   2 +-
 .../arm/mach-sunxi/dram_timings/h616_lpddr3.c |  95 +++++
 configs/orangepi_zero2_defconfig              |   1 +
 configs/x96_mate_defconfig                    |   1 +
 10 files changed, 372 insertions(+), 165 deletions(-)
 create mode 100644 arch/arm/mach-sunxi/dram_timings/h616_lpddr3.c

-- 
2.35.8


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

end of thread, other threads:[~2023-06-09 22:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-07  0:07 [PATCH 0/5] sunxi: H616: improve DRAM setup and add LPDDR3 support Andre Przywara
2023-06-07  0:07 ` [PATCH 1/5] sunxi: dram: make MBUS configuration functions static Andre Przywara
2023-06-09 20:24   ` Jernej Škrabec
2023-06-07  0:07 ` [PATCH 2/5] sunxi: H616: dram: const-ify DRAM function parameters Andre Przywara
2023-06-09 20:24   ` Jernej Škrabec
2023-06-07  0:07 ` [PATCH 3/5] sunxi: H616: dram: split struct dram_para Andre Przywara
2023-06-09 20:26   ` Jernej Škrabec
2023-06-09 22:48     ` Andre Przywara
2023-06-07  0:07 ` [PATCH 4/5] sunxi: H616: add DRAM type selection Andre Przywara
2023-06-09 20:29   ` Jernej Škrabec
2023-06-07  0:07 ` [PATCH 5/5] sunxi: H616: add LPDDR3 DRAM support Andre Przywara
2023-06-09 20:38   ` Jernej Škrabec
2023-06-09 21:15     ` Andre Przywara

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