mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] sh: add initial SH7305 CPU support
@ 2026-10-02  4:12 Artem Novak
  2026-10-02  4:12 ` [PATCH v2 1/2] sh: guard SH4 no-FPU compiler fallback Artem Novak
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Artem Novak @ 2026-10-02  4:12 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz; +Cc: linux-sh, linux-kernel, Artem Novak

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.

Changes in v2:
- Use my full name, Artem Novak, for authorship and Signed-off-by.
- No code changes.

Artem Novak (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] 6+ messages in thread

* [PATCH v2 1/2] sh: guard SH4 no-FPU compiler fallback
  2026-10-02  4:12 [PATCH v2 0/2] sh: add initial SH7305 CPU support Artem Novak
@ 2026-10-02  4:12 ` Artem Novak
  2026-10-02  4:12 ` [PATCH v2 2/2] sh: add SH7305 CPU subtype support Artem Novak
  2026-11-09  6:43 ` [PATCH v2 0/2] sh: add initial SH7305 CPU support Artem Novak
  2 siblings, 0 replies; 6+ messages in thread
From: Artem Novak @ 2026-10-02  4:12 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz; +Cc: linux-sh, linux-kernel, Artem Novak

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: Artem Novak <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] 6+ messages in thread

* [PATCH v2 2/2] sh: add SH7305 CPU subtype support
  2026-10-02  4:12 [PATCH v2 0/2] sh: add initial SH7305 CPU support Artem Novak
  2026-10-02  4:12 ` [PATCH v2 1/2] sh: guard SH4 no-FPU compiler fallback Artem Novak
@ 2026-10-02  4:12 ` Artem Novak
  2026-11-09  6:43 ` [PATCH v2 0/2] sh: add initial SH7305 CPU support Artem Novak
  2 siblings, 0 replies; 6+ messages in thread
From: Artem Novak @ 2026-10-02  4:12 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz; +Cc: linux-sh, linux-kernel, Artem Novak

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: Artem Novak <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] 6+ messages in thread

* Re: [PATCH v2 0/2] sh: add initial SH7305 CPU support
  2026-10-02  4:12 [PATCH v2 0/2] sh: add initial SH7305 CPU support Artem Novak
  2026-10-02  4:12 ` [PATCH v2 1/2] sh: guard SH4 no-FPU compiler fallback Artem Novak
  2026-10-02  4:12 ` [PATCH v2 2/2] sh: add SH7305 CPU subtype support Artem Novak
@ 2026-11-09  6:43 ` Artem Novak
  2026-11-09  7:04   ` John Paul Adrian Glaubitz
  2 siblings, 1 reply; 6+ messages in thread
From: Artem Novak @ 2026-11-09  6:43 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz; +Cc: linux-sh, linux-kernel

Hello,

I wanted to follow up on this patch series,
as it's been a little over five weeks since the v2 submission.

I'm happy to revise and resubmit if necessary.

Thanks.

Best regards,
Artem

On Thu, Oct 1, 2026 at 10:12 PM Artem Novak <artem122novak@gmail.com> wrote:
>
> 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.
>
> Changes in v2:
> - Use my full name, Artem Novak, for authorship and Signed-off-by.
> - No code changes.
>
> Artem Novak (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] 6+ messages in thread

* Re: [PATCH v2 0/2] sh: add initial SH7305 CPU support
  2026-11-09  6:43 ` [PATCH v2 0/2] sh: add initial SH7305 CPU support Artem Novak
@ 2026-11-09  7:04   ` John Paul Adrian Glaubitz
  2026-11-09  7:11     ` Artem Novak
  0 siblings, 1 reply; 6+ messages in thread
From: John Paul Adrian Glaubitz @ 2026-11-09  7:04 UTC (permalink / raw)
  To: Artem Novak; +Cc: linux-sh, linux-kernel

Hi Artem,

On Mon, 2026-11-09 at 00:43 -0600, Artem Novak wrote:
> I wanted to follow up on this patch series,
> as it's been a little over five weeks since the v2 submission.

I'm sorry, but there has been too much else on my plate in the
past weeks. And before I can get to your patches, there are a
few others still lingering on Patchwork for SH that I need to
review and pick up.

See: https://patchwork.kernel.org/project/linux-sh/list/

> I'm happy to revise and resubmit if necessary.

Not necessary. I will let you know.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/2] sh: add initial SH7305 CPU support
  2026-11-09  7:04   ` John Paul Adrian Glaubitz
@ 2026-11-09  7:11     ` Artem Novak
  0 siblings, 0 replies; 6+ messages in thread
From: Artem Novak @ 2026-11-09  7:11 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz; +Cc: linux-sh, linux-kernel

Hi Adrian,

No problem, thanks for the update

Best regards,
Artem

On Mon, Nov 9, 2026 at 1:04 AM John Paul Adrian Glaubitz
<glaubitz@physik.fu-berlin.de> wrote:
>
> Hi Artem,
>
> On Mon, 2026-11-09 at 00:43 -0600, Artem Novak wrote:
> > I wanted to follow up on this patch series,
> > as it's been a little over five weeks since the v2 submission.
>
> I'm sorry, but there has been too much else on my plate in the
> past weeks. And before I can get to your patches, there are a
> few others still lingering on Patchwork for SH that I need to
> review and pick up.
>
> See: https://patchwork.kernel.org/project/linux-sh/list/
>
> > I'm happy to revise and resubmit if necessary.
>
> Not necessary. I will let you know.
>
> Adrian
>
> --
>  .''`.  John Paul Adrian Glaubitz
> : :' :  Debian Developer
> `. `'   Physicist
>   `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-09  7:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-02  4:12 [PATCH v2 0/2] sh: add initial SH7305 CPU support Artem Novak
2026-10-02  4:12 ` [PATCH v2 1/2] sh: guard SH4 no-FPU compiler fallback Artem Novak
2026-10-02  4:12 ` [PATCH v2 2/2] sh: add SH7305 CPU subtype support Artem Novak
2026-11-09  6:43 ` [PATCH v2 0/2] sh: add initial SH7305 CPU support Artem Novak
2026-11-09  7:04   ` John Paul Adrian Glaubitz
2026-11-09  7:11     ` 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®