From: Yao Zi <ziyao@disroot.org>
To: Uros Stajic <uros.stajic@htecgroup.com>,
"u-boot@lists.denx.de" <u-boot@lists.denx.de>
Cc: Djordje Todorovic <Djordje.Todorovic@htecgroup.com>,
Chao-ying Fu <cfu@mips.com>
Subject: Re: [PATCH v4 01/10] riscv: Add initial support for P8700 SoC
Date: Thu, 9 Oct 2025 10:23:08 +0000 [thread overview]
Message-ID: <aOeNDPxxdq6oZ6wt@pie> (raw)
In-Reply-To: <20250819103021.1518687-2-uros.stajic@htecgroup.com>
On Tue, Aug 19, 2025 at 10:31:42AM +0000, Uros Stajic wrote:
> From: Chao-ying Fu <cfu@mips.com>
>
> Add initial platform support for the P8700-F, a high-performance
> multi-core RV64GC SoC with optional multi-cluster configuration and
> hardware multithreading.
>
> This patch introduces the initial platform code necessary to support
> the P8700 CPU in U-Boot.
>
> Signed-off-by: Chao-ying Fu <cfu@mips.com>
> Signed-off-by: Uros Stajic <uros.stajic@htecgroup.com>
> ---
> arch/riscv/Kconfig | 1 +
> arch/riscv/cpu/p8700/Kconfig | 14 ++
> arch/riscv/cpu/p8700/Makefile | 9 ++
> arch/riscv/cpu/p8700/cache.c | 93 +++++++++++
> arch/riscv/cpu/p8700/cpu.c | 13 ++
> arch/riscv/cpu/p8700/dram.c | 37 +++++
> arch/riscv/cpu/p8700/p8700_platform_setup.S | 169 ++++++++++++++++++++
> arch/riscv/include/asm/arch-p8700/p8700.h | 110 +++++++++++++
> 8 files changed, 446 insertions(+)
> create mode 100644 arch/riscv/cpu/p8700/Kconfig
> create mode 100644 arch/riscv/cpu/p8700/Makefile
> create mode 100644 arch/riscv/cpu/p8700/cache.c
> create mode 100644 arch/riscv/cpu/p8700/cpu.c
> create mode 100644 arch/riscv/cpu/p8700/dram.c
> create mode 100644 arch/riscv/cpu/p8700/p8700_platform_setup.S
> create mode 100644 arch/riscv/include/asm/arch-p8700/p8700.h
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 04eb0e6f23c..4eaf0e3db71 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -131,6 +131,7 @@ source "arch/riscv/cpu/jh7110/Kconfig"
> source "arch/riscv/cpu/k1/Kconfig"
> source "arch/riscv/cpu/k230/Kconfig"
> source "arch/riscv/cpu/th1520/Kconfig"
> +source "arch/riscv/cpu/p8700/Kconfig"
>
> # architecture-specific options below
>
> diff --git a/arch/riscv/cpu/p8700/Kconfig b/arch/riscv/cpu/p8700/Kconfig
> new file mode 100644
> index 00000000000..7023575a6be
> --- /dev/null
> +++ b/arch/riscv/cpu/p8700/Kconfig
> @@ -0,0 +1,14 @@
> +# SPDX-License-Identifier: GPL-2.0+
> +#
> +# Copyright (C) 2021, Chao-ying Fu <cfu@mips.com>
> +
> +config P8700_RISCV
> + bool
> + select ARCH_EARLY_INIT_R
> + imply CPU
> + imply CPU_RISCV
> + imply SIFIVE_CLINT if (RISCV_MMODE || SPL_RISCV_MMODE)
SIFIVE_CLINT has been renamed as RISCV_ACLINT back to 2023, and in
PATCH 2 you change SIFIVE_CLINT to RISCV_ACLINT. I think you should
squash the change into PATCH 1.
> + imply CMD_CPU
> + imply SPL_CPU_SUPPORT
> + imply SPL_OPENSBI
> + imply SPL_LOAD_FIT
...
> diff --git a/arch/riscv/cpu/p8700/p8700_platform_setup.S b/arch/riscv/cpu/p8700/p8700_platform_setup.S
> new file mode 100644
> index 00000000000..7c4475a03dd
> --- /dev/null
> +++ b/arch/riscv/cpu/p8700/p8700_platform_setup.S
Could this file be converted to C language? Then it'll be easier to
maintain. I think nothing prevents this if you could put the
initialization off until harts_early_init().
Futhermore I don't see this file is included in any of your Makefile,
which is suspicious.
...
> diff --git a/arch/riscv/include/asm/arch-p8700/p8700.h b/arch/riscv/include/asm/arch-p8700/p8700.h
> new file mode 100644
> index 00000000000..5ca9b4b9497
> --- /dev/null
> +++ b/arch/riscv/include/asm/arch-p8700/p8700.h
> @@ -0,0 +1,110 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * Copyright (C) 2021, Chao-ying Fu <cfu@mips.com>
> + */
> +
> +#ifndef __P8700_H__
> +#define __P8700_H__
> +
> +#define CSR_MIPSCONFIG7 0x7d7
> +#define CSR_PMACFG0 0x7e0
> +
> +#define MHARTID_HART_SHIFT 0
> +#define MHARTID_HART_MASK 0xf
> +#define MHARTID_CORE_SHIFT 4
> +#define MHARTID_CORE_MASK 0xff
> +#define MHARTID_CLUSTER_SHIFT 16
> +#define MHARTID_CLUSTER_MASK 0xf
> +
> +#define MARCHID_UARCH_SHIFT 0
> +#define MARCHID_UARCH_MASK 0xff
> +#define MARCHID_CLASS_SHIFT 8
> +#define MARCHID_CLASS_MASK 0xff
If you convert p8700_platform_setup.S to a C file, these macros could be
simplified with GENMASK() and FIELD_GET/PUT().
Best regards,
Yao Zi
next prev parent reply other threads:[~2025-10-09 10:23 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-19 10:31 [PATCH v4 00/10] riscv: Add support for P8700 platform on Boston board Uros Stajic
2025-08-19 10:31 ` [PATCH v4 01/10] riscv: Add initial support for P8700 SoC Uros Stajic
2025-10-09 10:23 ` Yao Zi [this message]
2026-01-13 7:12 ` Uros Stajic
2025-08-19 10:32 ` [PATCH v4 02/10] board: boston-riscv: Add initial support for P8700 Boston board Uros Stajic
2025-10-09 10:46 ` Yao Zi
2025-08-19 10:32 ` [PATCH v4 03/10] gpio: Add GPIO driver for Intel EG20T Uros Stajic
2025-08-19 10:32 ` [PATCH v4 04/10] pci: xilinx: Avoid writing memory base/limit for root bridge Uros Stajic
2025-08-19 10:32 ` [PATCH v4 05/10] riscv: Add support for MIPS GIC syscon on RISC-V SoCs Uros Stajic
2025-10-09 10:53 ` Yao Zi
2025-08-19 10:33 ` [PATCH v4 06/10] net: pch_gbe: Add PHY reset and MAC address fallback for RISC-V Uros Stajic
2025-08-19 10:33 ` [PATCH v4 07/10] libfdt: Allow non-64b aligned memreserve entries Uros Stajic
2025-08-19 10:33 ` [PATCH v4 08/10] riscv: p8700: Add Coherence Manager (CM) and IOCU support Uros Stajic
2025-08-19 10:34 ` [PATCH v4 09/10] riscv: boston: Add support for LED character display command Uros Stajic
2025-10-09 11:15 ` Yao Zi
2026-01-13 8:19 ` Uros Stajic
2025-08-19 10:34 ` [PATCH v4 10/10] cmd: riscv: Add 'startharts' command to start multiple harts Uros Stajic
2025-10-09 11:43 ` Yao Zi
2026-01-13 8:20 ` Uros Stajic
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=aOeNDPxxdq6oZ6wt@pie \
--to=ziyao@disroot.org \
--cc=Djordje.Todorovic@htecgroup.com \
--cc=cfu@mips.com \
--cc=u-boot@lists.denx.de \
--cc=uros.stajic@htecgroup.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