From: Yao Zi <me@ziyao.cc>
To: Hiago De Franco <hfranco@baylibre.com>,
u-boot@lists.u-boot-project.org, Yao Zi <me@ziyao.cc>
Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,
Alper Nebi Yasak <alpernebiyasak@gmail.com>,
Marek Vasut <marex@nabladev.com>,
Tim Ouyang <tim609@andestech.com>,
Leo Liang <leo.liang@sifive.com>,
Kongyang Liu <seashell11234455@gmail.com>,
Neha Malcom Francis <n-francis@ti.com>, Bin Liu <b-liu@ti.com>,
Quentin Schulz <quentin.schulz@cherry.de>,
Andrei Lalaev <andrey.lalaev@gmail.com>,
Zhuxu Ran <zhuxu_ran@zohomail.com>, Udit Kumar <u-kumar1@ti.com>
Subject: Re: [PATCH 2/8] riscv: cv1800b: add SPL support
Date: Tue, 3 Nov 2026 13:53:44 +0000 [thread overview]
Message-ID: <aunnaN0SOzsRBtlG@pie> (raw)
In-Reply-To: <20261021-milkv-duo-spl-v1-2-ee7618860237@baylibre.com>
On Wed, Oct 21, 2026 at 09:54:18AM -0300, Hiago De Franco wrote:
> Add SUPPORT_SPL and SPL_CPU.
>
> harts_early_init() enables the C906 caches and T-HEAD ISA extensions.
>
> Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
> ---
> arch/riscv/cpu/cv1800b/Kconfig | 2 ++
> arch/riscv/cpu/cv1800b/Makefile | 4 ++++
> arch/riscv/cpu/cv1800b/spl.c | 31 +++++++++++++++++++++++++++++++
> 3 files changed, 37 insertions(+)
...
> diff --git a/arch/riscv/cpu/cv1800b/spl.c b/arch/riscv/cpu/cv1800b/spl.c
> new file mode 100644
> index 00000000000..6fd62d66da7
> --- /dev/null
> +++ b/arch/riscv/cpu/cv1800b/spl.c
> @@ -0,0 +1,31 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (c) 2026, Hiago De Franco <hfranco@baylibre.com>
> + *
> + * CSR setup based on the Sophgo FSBL (https://github.com/sophgo/fsbl),
> + * lib/cpu/riscv/bl2_entrypoint.S.
> + */
> +
> +#include <asm/csr.h>
> +#include <linux/bitops.h>
> +
> +#define CSR_MCOR 0x7c2
> +#define CSR_MCOR_CACHE_INV BIT(4)
> +#define CSR_MCOR_CACHE_SEL_BOTH (BIT(1) | BIT(0))
> +#define CSR_MHCR 0x7c1
> +#define CSR_MHCR_DE BIT(1)
> +#define CSR_MHCR_IE BIT(0)
MHCR-related stuff looks the same on both C906 and C910
(the TH1520 platform). I did a quick check for C908[1] (used in K230)
and C920[2] (used in SG2042), all of them have DE/IE in MHCR
(CSR 0x7c1), so I think it makes sense to move th1520/cache.c to
something like lib/thead_cache.c to re-use it for your series, reducing
some code duplication.
Regards,
Yao Zi
[1]: https://github.com/OctopusET/XuanTie-C908-docs/blob/master/XuanTie-C908-UserManual_xrvm_20240530.pdf
[2]: https://www.xmosc.org.cn/UserFiles/upload/file/20251230/%E7%8E%84%E9%93%81C910%E4%B8%8EC920R1S6%E7%94%A8%E6%88%B7%E6%89%8B%E5%86%8C_Rev.09_20251114.pdf
next prev parent reply other threads:[~2026-11-03 13:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 12:54 [PATCH 0/8] riscv: sophgo: add SPL support for the Milk-V Duo Hiago De Franco
2026-10-21 12:54 ` [PATCH 1/8] binman: add Sophgo CV18xx FIP entry type Hiago De Franco
2026-11-03 14:54 ` Simon Glass
2026-10-21 12:54 ` [PATCH 2/8] riscv: cv1800b: add SPL support Hiago De Franco
2026-11-03 13:53 ` Yao Zi [this message]
2026-10-21 12:54 ` [PATCH 3/8] ram: sophgo: add CV180x DDR2 driver Hiago De Franco
2026-10-21 12:54 ` [PATCH 4/8] board: sophgo: milkv_duo: add SPL support Hiago De Franco
2026-11-04 3:56 ` Yao Zi
2026-10-21 12:54 ` [PATCH 5/8] board: sophgo: milkv_duo: initialize PLLs in SPL Hiago De Franco
2026-11-04 4:19 ` Yao Zi
2026-10-21 12:54 ` [PATCH 6/8] board: sophgo: milkv_duo: enable RTC power and reset Hiago De Franco
2026-11-03 17:31 ` João Paulo Gonçalves
2026-11-04 3:59 ` Yao Zi
2026-10-21 12:54 ` [PATCH 7/8] doc: board: sophgo: milkv_duo: update documentation Hiago De Franco
2026-10-21 12:54 ` [PATCH 8/8] doc: board: sophgo: milkv_duo: document the SPL boot flow Hiago De Franco
2026-10-25 17:33 ` [PATCH 0/8] riscv: sophgo: add SPL support for the Milk-V Duo Andrei Lalaev
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=aunnaN0SOzsRBtlG@pie \
--to=me@ziyao.cc \
--cc=alpernebiyasak@gmail.com \
--cc=andrey.lalaev@gmail.com \
--cc=b-liu@ti.com \
--cc=hfranco@baylibre.com \
--cc=leo.liang@sifive.com \
--cc=marex@nabladev.com \
--cc=n-francis@ti.com \
--cc=quentin.schulz@cherry.de \
--cc=seashell11234455@gmail.com \
--cc=sjg@chromium.org \
--cc=tim609@andestech.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
--cc=u-kumar1@ti.com \
--cc=zhuxu_ran@zohomail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.