* [PATCH RESEND 0/2] sh: add initial SH7305 CPU support
@ 2026-10-02 4:07 Artem Novak
2026-10-02 4:07 ` [PATCH RESEND 1/2] sh: guard SH4 no-FPU compiler fallback Artem Novak
2026-10-02 4:08 ` [PATCH RESEND 2/2] sh: add SH7305 CPU subtype support Artem Novak
0 siblings, 2 replies; 3+ messages in thread
From: Artem Novak @ 2026-10-02 4:07 UTC (permalink / raw)
To: John Paul Adrian Glaubitz; +Cc: linux-sh, linux-kernel, cacioandpepe
From: cacioandpepe <artem122novak@gmail.com>
Add initial SuperH support for the Renesas SH7305 processor.
The first patch fixes SH4 compiler flag fallback handling for toolchains
which support SH4A targets but do not provide the plain -m4-nofpu
option.
The second patch adds the SH7305 CPU subtype, processor name and CPU
probe.
This is the first small architecture level part of ongoing SH7305
enablement. Platform specific clock, interrupt controller, timer and
board support are intentionally left for separate patches.
The SH7305 support has been compile tested with GCC 14.3.0 targeting
big endian SH4A.
cacioandpepe (2):
sh: guard SH4 no-FPU compiler fallback
sh: add SH7305 CPU subtype support
arch/sh/Kconfig | 9 +++++++++
arch/sh/Makefile | 2 +-
arch/sh/include/asm/processor.h | 2 +-
arch/sh/kernel/cpu/proc.c | 3 ++-
arch/sh/kernel/cpu/sh4/probe.c | 3 +++
5 files changed, 16 insertions(+), 3 deletions(-)
base-commit: 551c722f40809618230001baccf219193e22fc5a
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH RESEND 1/2] sh: guard SH4 no-FPU compiler fallback
2026-10-02 4:07 [PATCH RESEND 0/2] sh: add initial SH7305 CPU support Artem Novak
@ 2026-10-02 4:07 ` Artem Novak
2026-10-02 4:08 ` [PATCH RESEND 2/2] sh: add SH7305 CPU subtype support Artem Novak
1 sibling, 0 replies; 3+ messages in thread
From: Artem Novak @ 2026-10-02 4:07 UTC (permalink / raw)
To: John Paul Adrian Glaubitz; +Cc: linux-sh, linux-kernel, cacioandpepe
From: cacioandpepe <artem122novak@gmail.com>
The SH4 compiler flag selection falls back to -m4-nofpu when
-mno-implicit-fp is unavailable without checking whether the compiler
supports -m4-nofpu itself.
This breaks SH4A-only toolchains which support -m4a and -m4a-nofpu
but do not provide the plain SH4 -m4-nofpu option.
Use a nested cc-option so the fallback is emitted only when supported.
Signed-off-by: cacioandpepe <artem122novak@gmail.com>
---
arch/sh/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 7b420424b6d7..238c701ab14b 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -36,7 +36,7 @@ cflags-$(CONFIG_CPU_SH2A) += $(call cc-option,-m2a,) \
$(call cc-option,-m4-nofpu,)
cflags-$(CONFIG_CPU_SH3) := $(call cc-option,-m3,)
cflags-$(CONFIG_CPU_SH4) := $(call cc-option,-m4,) \
- $(call cc-option,-mno-implicit-fp,-m4-nofpu)
+ $(call cc-option,-mno-implicit-fp,$(call cc-option,-m4-nofpu,))
cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \
$(call cc-option,-m4a-nofpu,)
cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,)
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH RESEND 2/2] sh: add SH7305 CPU subtype support
2026-10-02 4:07 [PATCH RESEND 0/2] sh: add initial SH7305 CPU support Artem Novak
2026-10-02 4:07 ` [PATCH RESEND 1/2] sh: guard SH4 no-FPU compiler fallback Artem Novak
@ 2026-10-02 4:08 ` Artem Novak
1 sibling, 0 replies; 3+ messages in thread
From: Artem Novak @ 2026-10-02 4:08 UTC (permalink / raw)
To: John Paul Adrian Glaubitz; +Cc: linux-sh, linux-kernel, cacioandpepe
From: cacioandpepe <artem122novak@gmail.com>
Add the SH7305 as an SH4AL-DSP CPU subtype.
Recognize the SH7305 in the SH-4 CPU probe using the existing
0x300b PVR family with PRR value 0xc0, and expose the processor
name through the SH CPU information interface.
Signed-off-by: cacioandpepe <artem122novak@gmail.com>
---
arch/sh/Kconfig | 9 +++++++++
arch/sh/include/asm/processor.h | 2 +-
arch/sh/kernel/cpu/proc.c | 3 ++-
arch/sh/kernel/cpu/sh4/probe.c | 3 +++
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index d60f1d5a94c0..e71b5476769e 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -467,6 +467,15 @@ config CPU_SUBTYPE_SHX3
# SH4AL-DSP Processor Support
+config CPU_SUBTYPE_SH7305
+ bool "Support SH7305 processor"
+ select CPU_SH4AL_DSP
+ help
+ Select this option to build the kernel for systems based on the
+ Renesas SH7305 processor. The SH7305 belongs to the SH4AL-DSP
+ processor family and is used in embedded systems such as Casio
+ graphing calculators.
+
config CPU_SUBTYPE_SH7343
bool "Support SH7343 processor"
select CPU_SH4AL_DSP
diff --git a/arch/sh/include/asm/processor.h b/arch/sh/include/asm/processor.h
index 2a0b5713ab80..96321c46ce85 100644
--- a/arch/sh/include/asm/processor.h
+++ b/arch/sh/include/asm/processor.h
@@ -36,7 +36,7 @@ enum cpu_type {
CPU_SH7723, CPU_SH7724, CPU_SH7757, CPU_SH7734, CPU_SHX3,
/* SH4AL-DSP types */
- CPU_SH7343, CPU_SH7722, CPU_SH7366, CPU_SH7372,
+ CPU_SH7343, CPU_SH7305, CPU_SH7722, CPU_SH7366, CPU_SH7372,
/* Unknown subtype */
CPU_SH_NONE
diff --git a/arch/sh/kernel/cpu/proc.c b/arch/sh/kernel/cpu/proc.c
index 5f6d0e827bae..b6fbe27742e0 100644
--- a/arch/sh/kernel/cpu/proc.c
+++ b/arch/sh/kernel/cpu/proc.c
@@ -25,7 +25,8 @@ static const char *cpu_name[] = {
[CPU_SH7786] = "SH7786", [CPU_SH7757] = "SH7757",
[CPU_SH7722] = "SH7722", [CPU_SHX3] = "SH-X3",
[CPU_MXG] = "MX-G", [CPU_SH7723] = "SH7723",
- [CPU_SH7366] = "SH7366", [CPU_SH7724] = "SH7724",
+ [CPU_SH7305] = "SH7305", [CPU_SH7366] = "SH7366",
+ [CPU_SH7724] = "SH7724",
[CPU_SH7372] = "SH7372", [CPU_SH7734] = "SH7734",
[CPU_J2] = "J2",
[CPU_SH_NONE] = "Unknown"
diff --git a/arch/sh/kernel/cpu/sh4/probe.c b/arch/sh/kernel/cpu/sh4/probe.c
index ef4dd6295263..7f77fc64258c 100644
--- a/arch/sh/kernel/cpu/sh4/probe.c
+++ b/arch/sh/kernel/cpu/sh4/probe.c
@@ -143,6 +143,9 @@ void cpu_probe(void)
break;
case 0x300b:
switch (prr) {
+ case 0xc0:
+ boot_cpu_data.type = CPU_SH7305;
+ break;
case 0x20:
boot_cpu_data.type = CPU_SH7724;
boot_cpu_data.flags |= CPU_HAS_L2_CACHE;
--
2.55.0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-02 4:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-02 4:07 [PATCH RESEND 0/2] sh: add initial SH7305 CPU support Artem Novak
2026-10-02 4:07 ` [PATCH RESEND 1/2] sh: guard SH4 no-FPU compiler fallback Artem Novak
2026-10-02 4:08 ` [PATCH RESEND 2/2] sh: add SH7305 CPU subtype support Artem Novak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®