Re: [PATCH v3 5/8] MIPS: Ingenic: Update Ingenic XBurst implementation IDs
From: Paul Cercueil
Date: Mon Nov 30 2026 - 11:58:10 EST
Nevermind my answer on [4/8], I found the "Update Ingenic XBurst implementation
IDs" patch :)
Le samedi 28 novembre 2026 à 18:20 +0100, H. Nikolaus Schaller a écrit :
> Add PRID implementation constants for Ingenic XBurst and XBurst II
> processors and handle the corresponding implementation IDs in
> cpu_probe_ingenic().
>
> The PRID table is updated based on Programming Manuals and hardware tests:
> - jz4780: 0x3ee1024f (confirmed on CI20 board)
> - x1000: 0x2ed1024f (unconfirmed)
> - x1600: 0x00d00000 (confirmed on LX16 board)
> - X1830: 0x00d00100 (unconfirmed)
> - X2000: 0x00132000 (read out from LX20 board)
> - X2600: 0x001320xx (confirmed 0x00132000 on LX26 board)
>
> Additionally, clean up extra spaces in the comments for
> PRID_IMP_XBURST_REV2 and PRID_IMP_XBURST2.
>
> Distinguish XBurst1 implementations with different SIMD ISA revisions
> and identify XBurst II processors using PRID_IMP_XBURST2.
> The XBurst II classification follows the Ingenic vendor kernel.
> Set CPU_XBURST2 for XBurst II instead of the generic CPU_XBURST.
>
> Preserve the existing idle, non-coherent DMA and TLB handling when
> changing the CPU type of XBurst II from CPU_XBURST to CPU_XBURST2.
> The secondary cache geometry workarounds in sc-mips.c remain restricted
> to CPU_XBURST as they only apply to specific XBurst I SoCs.
>
> Use _CACHE_UNCACHED_ACCELERATED for the newly recognized XBurst1
> implementation. Leave the writecombine handling of existing PRID
> cases unchanged; the alternative X1600 cache attribute remains an
> open question.
>
> Public references:
> - Ingenic Community, public SoC datasheets and programming manuals:
> https://github.com/Ingenic-community/datasheets/tree/main/X
> Includes the X1600 programming manual (X1600_PM_20220117.pdf)
> and documentation for other X-series SoCs, including X1000,
> X1830 and X2000.
> - Ingenic, XBurst1 CPU Core Programming Manual:
> https://cdn.hackaday.io/files/1855627939084608/XBurst1_Core_PM.pdf
> Documents the XBurst1 core architecture and CP0 configuration.
> - Ingenic, XBurst Instruction Set Architecture Programming Manual:
> https://www.setphaserstostun.org/ci20/X1000_M200_XBurst_ISA_MXU_PM.pdf
> Documents the original XBurst SIMD instruction set.
> - Ingenic, XBurst2 CPU Core Programming Manual:
> https://www.manualslib.com/manual/2646351/Ingenic-Xburst-2-Cpu-Core.html
> Documents the XBurst2 core architecture.
> - Ingenic, MIPS-LINUX toolchain R6.0.0 release notes:
> https://www.ingenic.com.cn/news-detail/nid-343.html
> Distinguishes MSA, MXA and MXU/MXU2 support in the toolchain.
> - Ingenic, MIPS-LINUX toolchain R6.2.1 release notes:
> https://www.ingenic.com.cn/news-detail/nid-348.html
> Documents MXU3 support and identifies X2000 as an MSA target.
>
> The public references document the available CPU, SoC and ISA
> information. The PRID implementation handling follows the Ingenic
> vendor kernel.
>
> AI assistance: ChatGPT was used to help review the PRID definitions,
> compare the Ingenic vendor implementation with the upstream code,
> and draft the commit message with public references. The code changes,
> hardware observations, and final patch were reviewed by the authors.
>
> Co-developed-by: Paul Boddie <paul@xxxxxxxxxxxxx>
> Signed-off-by: Paul Boddie <paul@xxxxxxxxxxxxx>
> Signed-off-by: H. Nikolaus Schaller <hns@xxxxxxxxxxxxx>
Reviewed-by: Paul Cercueil <paul@xxxxxxxxxxxxxxx>
Cheers,
-Paul
> ---
>
> Notes:
> Changes in v3:
> - Assign CPU_XBURST2 to the existing XBurst II CPU probe case.
> - Hardware readings of Config1.C2 on JZ4780, X1600, X2000 and X2600
> all returned zero. Without reliable documentation connecting this bit
> to MXU variants, no new MXU capability assumptions are introduced.
>
> Changes in v2:
> - removed the PRID_IMP_XBURST2_R2 definition and hints for an x2100 as
> there is no public reference
> - merged into single commit changing the PRID definitions and code
> - reviewed details and rewrote commit message
>
> Open Issue:
> Olivier Louvignes <olivier@xxxxxxxxx> pointed out that he has
> simply reused the definition of the X1830 for the X1600. This
> sets c->writecombine differently (_CACHE_CACHABLE_WA) from
> _CACHE_UNCACHED_ACCELERATED as we do here.
> Both settings appear to work but it needs expert comment which
> is the right/better one.
>
> Review: Olivier Louvignes discussed the PRID microarchitecture
> interpretation and the alternative X1600 writecombine setting.
> Paul Cercueil requested checking the X1600 MXU capabilities and
> noted the missing CPU DT binding. Hunter Laux suggested reading
> CP0 Config1.C2; the hardware measurements and their limitations
> are documented above.
>
> Additional v3 review against v7.4-rc4:
> - Preserve idle, non-coherent DMA and TLB handling for CPU_XBURST2.
> - Keep the XBurst I secondary cache geometry workarounds unchanged.
>
> arch/mips/include/asm/cpu.h | 9 +++++----
> arch/mips/kernel/cpu-probe.c | 9 ++++++++-
> arch/mips/kernel/idle.c | 1 +
> arch/mips/mm/dma-noncoherent.c | 1 +
> arch/mips/mm/tlbex.c | 1 +
> 5 files changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
> index add26f08e8029..79fd9a0747cf2 100644
> --- a/arch/mips/include/asm/cpu.h
> +++ b/arch/mips/include/asm/cpu.h
> @@ -47,7 +47,7 @@
> #define PRID_COMP_CAVIUM 0x0d0000
> #define PRID_COMP_LOONGSON 0x140000
> #define PRID_COMP_INGENIC_13 0x130000 /* X2000, X2100 */
> -#define PRID_COMP_INGENIC_D0 0xd00000 /* JZ4730, JZ4740, JZ4750,
> JZ4755, JZ4760, X1830 */
> +#define PRID_COMP_INGENIC_D0 0xd00000 /* JZ4730, JZ4740, JZ4750,
> JZ4755, JZ4760, X1830, X1600 */
> #define PRID_COMP_INGENIC_D1 0xd10000 /* JZ4770, JZ4775, X1000 */
> #define PRID_COMP_INGENIC_E1 0xe10000 /* JZ4780 */
>
> @@ -186,9 +186,10 @@
> * These are the PRID's for when 23:16 == PRID_COMP_INGENIC_*
> */
>
> -#define PRID_IMP_XBURST_REV1 0x0200 /* XBurst®1 with MXU1.0/MXU1.1 SIMD
> ISA */
> -#define PRID_IMP_XBURST_REV2 0x0100 /* XBurst®1 with MXU2.0 SIMD
> ISA */
> -#define PRID_IMP_XBURST2 0x2000 /* XBurst®2 with MXU2.1 SIMD
> ISA */
> +#define PRID_IMP_XBURST 0x0000 /* XBurst1 */
> +#define PRID_IMP_XBURST_REV1 0x0200 /* XBurst1 with MXU1.0/MXU1.1 SIMD
> ISA */
> +#define PRID_IMP_XBURST_REV2 0x0100 /* XBurst1 with MXU2.0 SIMD ISA */
> +#define PRID_IMP_XBURST2 0x2000 /* XBurst2 with MXU2.1 SIMD ISA */
>
> /*
> * These are the PRID's for when 23:16 == PRID_COMP_NETLOGIC
> diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
> index 489612ed9d498..e84025d4c1a6a 100644
> --- a/arch/mips/kernel/cpu-probe.c
> +++ b/arch/mips/kernel/cpu-probe.c
> @@ -1768,6 +1768,13 @@ static inline void cpu_probe_ingenic(struct
> cpuinfo_mips *c, unsigned int cpu)
>
> switch (c->processor_id & PRID_IMP_MASK) {
>
> + /* XBurst®1 */
> + case PRID_IMP_XBURST:
> + c->cputype = CPU_XBURST;
> + c->writecombine = _CACHE_UNCACHED_ACCELERATED;
> + __cpu_name[cpu] = "Ingenic XBurst";
> + break;
> +
> /* XBurst®1 with MXU1.0/MXU1.1 SIMD ISA */
> case PRID_IMP_XBURST_REV1:
>
> @@ -1824,7 +1831,7 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips
> *c, unsigned int cpu)
>
> /* XBurst®2 with MXU2.1 SIMD ISA */
> case PRID_IMP_XBURST2:
> - c->cputype = CPU_XBURST;
> + c->cputype = CPU_XBURST2;
> __cpu_name[cpu] = "Ingenic XBurst II";
> break;
>
> diff --git a/arch/mips/kernel/idle.c b/arch/mips/kernel/idle.c
> index 80e8a04a642e0..2c3683c3763cd 100644
> --- a/arch/mips/kernel/idle.c
> +++ b/arch/mips/kernel/idle.c
> @@ -157,6 +157,7 @@ void __init check_wait(void)
> case CPU_CAVIUM_OCTEON2:
> case CPU_CAVIUM_OCTEON3:
> case CPU_XBURST:
> + case CPU_XBURST2:
> case CPU_LOONGSON32:
> cpu_wait = r4k_wait;
> break;
> diff --git a/arch/mips/mm/dma-noncoherent.c b/arch/mips/mm/dma-noncoherent.c
> index 30ef3e247eb7a..0f9aa7aee9977 100644
> --- a/arch/mips/mm/dma-noncoherent.c
> +++ b/arch/mips/mm/dma-noncoherent.c
> @@ -33,6 +33,7 @@ static inline bool cpu_needs_post_dma_flush(void)
> case CPU_BMIPS5000:
> case CPU_LOONGSON2EF:
> case CPU_XBURST:
> + case CPU_XBURST2:
> return true;
> default:
> /*
> diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
> index 69ea54bdc0c36..d9b90fc6186da 100644
> --- a/arch/mips/mm/tlbex.c
> +++ b/arch/mips/mm/tlbex.c
> @@ -568,6 +568,7 @@ void build_tlb_write_entry(u32 **p, struct uasm_label **l,
> break;
>
> case CPU_XBURST:
> + case CPU_XBURST2:
> tlbw(p);
> uasm_i_nop(p);
> break;