public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Yao Zi <me@ziyao.cc>
To: Raymond Mao <raymondmaoca@gmail.com>
Cc: u-boot@lists.denx.de, uboot@riscstar.com,
	Raymond Mao <raymond.mao@riscstar.com>,
	Rick Chen <rick@andestech.com>, Leo <ycliang@andestech.com>,
	Tom Rini <trini@konsulko.com>, Lukasz Majewski <lukma@denx.de>,
	Heiko Schocher <hs@nabladev.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Peng Fan <peng.fan@nxp.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Randolph Sheng-Kai Lin <randolph@andestech.com>,
	Yixun Lan <dlan@gentoo.org>,
	Junhui Liu <junhui.liu@pigmoral.tech>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Quentin Schulz <quentin.schulz@cherry.de>,
	Samuel Holland <samuel@sholland.org>
Subject: Re: [PATCH 14/17] spacemit: k1: Add DDR firmware support to SPL
Date: Thu, 22 Jan 2026 14:43:29 +0000	[thread overview]
Message-ID: <aXI3kc8t9bPRmnkM@pie> (raw)
In-Reply-To: <CAMDkj5yGNxL0Hkw5k0Kae=SjPb51Bu9T0M60Dpaj5OVckN3R1g@mail.gmail.com>

On Wed, Jan 21, 2026 at 06:24:01PM -0500, Raymond Mao wrote:
> Hi Yao Zi,
> 
> On Mon, Jan 19, 2026 at 4:41 AM Yao Zi <me@ziyao.cc> wrote:
> 
> > (My mail provider complains about the huge list of recipients, so I
> > reduced it a little.)
> >
> > On Sat, Jan 17, 2026 at 02:01:48PM -0500, Raymond Mao wrote:
> > > From: Raymond Mao <raymond.mao@riscstar.com>
> > >
> > > Include DDR initialization firmware in the SPL image. The firmware
> > > path can be specified via the DDR_FW_FILE environment variable. If
> > > the firmware is not found, an empty placeholder file is created to
> > > allow the build to proceed without DDR initialization support.
> > >
> > > Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
> > > ---
> > >  arch/riscv/dts/k1-spl.dts      |  34 ++++++++++++++++++++++++++++++++-
> > >  board/spacemit/k1/Kconfig      |   8 ++++++++
> > >  board/spacemit/k1/Makefile     |  19 ++++++++++++++++++
> > >  board/spacemit/k1/spl.c        |  30 +++++++++++++++++++++++++++++
> > >  include/configs/k1.h           |   3 +++
> > >  lib/vendor/spacemit/ddr_fw.bin | Bin 0 -> 19416 bytes
> >
> > It's unusual to ship binary firmware in U-Boot repository. Please place
> > the firmware somewhere else, and give a clear instruction in the
> > board/architecture documentation explaining how to obtain/build it.
> >
> > >  6 files changed, 93 insertions(+), 1 deletion(-)
> > >  create mode 100644 lib/vendor/spacemit/ddr_fw.bin
> >
> > ...
> >
> > > diff --git a/board/spacemit/k1/Kconfig b/board/spacemit/k1/Kconfig
> > > index 9f9c806d00d..a5fa788f660 100644
> > > --- a/board/spacemit/k1/Kconfig
> > > +++ b/board/spacemit/k1/Kconfig
> > > @@ -15,6 +15,14 @@ config SYS_CONFIG_NAME
> > >  config TEXT_BASE
> > >       default 0x00200000
> > >
> > > +config SPL_DDR_FIRMWARE_OFFSET
> > > +     hex "DDR firmware offset in SPL image"
> > > +     depends on SPL
> > > +     default 0x20000
> > > +     help
> > > +       Offset where DDR firmware should be placed in the SPL
> > > +       image.
> > > +
> > >  config SPL_OPENSBI_LOAD_ADDR
> > >       default 0x00000000
> > >
> > > diff --git a/board/spacemit/k1/Makefile b/board/spacemit/k1/Makefile
> > > index 7bce47bac8c..ebe6e55867c 100644
> > > --- a/board/spacemit/k1/Makefile
> > > +++ b/board/spacemit/k1/Makefile
> > > @@ -5,3 +5,22 @@
> > >
> > >  obj-y := board.o
> > >  obj-$(CONFIG_SPL_BUILD) += spl.o
> > > +
> > > +DDR_FW_SRC ?= $(DDR_FW_FILE)
> > > +FW_TARGET = $(srctree)/lib/vendor/spacemit/ddr_fw.bin
> > > +
> > > +DDR_FW_HEADER = $(objtree)/include/generated/ddr_fw_info.h
> > > +
> > > +$(obj)/spl.o: $(DDR_FW_HEADER)
> > > +
> > > +$(DDR_FW_HEADER): $(FW_TARGET)
> > > +     @echo "/* DDR firmware info - $$(date) */" > $@
> > > +     @if [ -f "$(FW_TARGET)" ]; then \
> > > +             SIZE=$$(stat -c%s "$(FW_TARGET)" 2>/dev/null || echo 0); \
> > > +     else \
> > > +             SIZE=0; \
> > > +     fi; \
> > > +     echo "#define DDR_FW_FILE_SIZE  $$SIZE" >> $@
> > > +     @echo "/* Note: Update ADDR if binman layout changes */" >> $@
> > > +
> > > +clean-files += $(FW_TARGET) $(DDR_FW_HEADER)
> >
> > Please make use of existing binman[1] facibilities to avoid the extra
> > Kconfig and Makefile pieces. binman_sym() could be used for obtaining
> > both size and offset of a binman entry.
> >
> > It doesn't work at all in SPL. I checked the binman symbol table
> that was totally empty.

I've tried commit fd871fc6bb49 ("pinctrl: mediatek: mt8365: add PUPD
registers") with th1520_lpi4a_defconfig, and
drivers/ram/thead/th1520_ddr.c, which makes use of binman_sym(), does
work.

This suggests binman facilities do work on RISC-V, at least after the
last time when I fixed it[1]. Are you testing on a U-Boot version
earlier than v2025.07? Otherwise there's likely something (configuration
or code) wrong on your side.

btw, every first line of your replied paragraphs has the wrong level of
quotes, which is a little confusing.

Best regards,
Yao Zi

[1]: https://lore.kernel.org/u-boot/20250416162533.1396-1-ziyao@disroot.org/

  reply	other threads:[~2026-01-22 14:44 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-17 19:01 [PATCH 00/17] Add board support for Spacemit K1 SoC in SPL Raymond Mao
2026-01-17 19:01 ` [PATCH 01/17] spacemit: k1: support multi-board infrastructure Raymond Mao
2026-01-23 10:27   ` Heinrich Schuchardt
2026-01-23 10:46     ` Heinrich Schuchardt
2026-01-17 19:01 ` [PATCH 02/17] spacemit: k1: enable SPL with debug UART Raymond Mao
2026-01-18  8:50   ` Yao Zi
2026-01-23 14:51   ` Heinrich Schuchardt
2026-02-03 14:24     ` Raymond Mao
2026-01-17 19:01 ` [PATCH 03/17] configs: k1: enable early timer support Raymond Mao
2026-01-17 19:01 ` [PATCH 04/17] reset: k1: add SPL support and enable TWSI8 reset Raymond Mao
2026-01-18  9:10   ` Yao Zi
2026-01-21 23:17     ` Raymond Mao
2026-01-17 19:01 ` [PATCH 05/17] dt-bindings: clock: import k1-syscon from upstream Raymond Mao
2026-01-17 19:01 ` [PATCH 06/17] dts: k1: import dts file from upstream folder Raymond Mao
2026-01-17 23:03   ` Yixun Lan
2026-01-18  8:56     ` Yao Zi
2026-01-17 19:01 ` [PATCH 07/17] clk: spacemit: Add support for K1 SoC Raymond Mao
2026-01-17 19:01 ` [PATCH 08/17] dts: k1: enable clocks in SPL Raymond Mao
2026-01-17 19:01 ` [PATCH 09/17] board: k1: initialize clock and serial devices " Raymond Mao
2026-01-17 19:01 ` [PATCH 10/17] configs: k1: add default option for clock driver " Raymond Mao
2026-01-17 19:01 ` [PATCH 11/17] i2c: k1: add I2C driver support Raymond Mao
2026-01-19  5:24   ` Heiko Schocher
2026-01-17 19:01 ` [PATCH 12/17] dt-bindings: pinctrl: add k1 support Raymond Mao
2026-01-18  9:26   ` Yao Zi
2026-01-21 23:20     ` Raymond Mao
2026-01-22 14:55       ` Yao Zi
2026-01-17 19:01 ` [PATCH 13/17] spacemit: k1: add TLV EEPROM support in SPL Raymond Mao
2026-01-17 19:01 ` [PATCH 14/17] spacemit: k1: Add DDR firmware support to SPL Raymond Mao
2026-01-19  9:40   ` Yao Zi
2026-01-21 23:24     ` Raymond Mao
2026-01-22 14:43       ` Yao Zi [this message]
2026-01-17 19:01 ` [PATCH 15/17] power: pmic: add support for Spacemit P1 PMIC Raymond Mao
2026-01-17 19:01 ` [PATCH 16/17] power: regulator: add support for Spacemit P1 SoC Raymond Mao
2026-01-17 19:01 ` [PATCH 17/17] board: k1: enable pmic in spl Raymond Mao
2026-01-17 23:13 ` [PATCH 00/17] Add board support for Spacemit K1 SoC in SPL Yixun Lan
2026-01-22  8:29 ` Heinrich Schuchardt
2026-01-23 14:58   ` Raymond Mao

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=aXI3kc8t9bPRmnkM@pie \
    --to=me@ziyao.cc \
    --cc=dlan@gentoo.org \
    --cc=hs@nabladev.com \
    --cc=jh80.chung@samsung.com \
    --cc=junhui.liu@pigmoral.tech \
    --cc=lukma@denx.de \
    --cc=neil.armstrong@linaro.org \
    --cc=peng.fan@nxp.com \
    --cc=quentin.schulz@cherry.de \
    --cc=randolph@andestech.com \
    --cc=raymond.mao@riscstar.com \
    --cc=raymondmaoca@gmail.com \
    --cc=rick@andestech.com \
    --cc=samuel@sholland.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot@riscstar.com \
    --cc=xypron.glpk@gmx.de \
    --cc=ycliang@andestech.com \
    /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