All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: linux-sh@vger.kernel.org
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>,
	glaubitz@physik.fu-berlin.de
Subject: [RESEND RFC PATCH 03/12] sh: SH4 OF support.
Date: Thu, 31 Aug 2023 10:11:50 +0900	[thread overview]
Message-ID: <4a138cf1ff14ff6166a66851db7476096fa3f009.1693444193.git.ysato@users.sourceforge.jp> (raw)
In-Reply-To: <cover.1693444193.git.ysato@users.sourceforge.jp>

- switch generic framework in clock / PCI.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
 arch/sh/drivers/Makefile        |  2 ++
 arch/sh/include/asm/io.h        | 10 ++++++++++
 arch/sh/include/asm/pci.h       |  4 ++++
 arch/sh/kernel/cpu/Makefile     |  8 ++++++--
 arch/sh/kernel/cpu/clock.c      |  3 ++-
 arch/sh/kernel/cpu/sh4/Makefile |  2 ++
 6 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/arch/sh/drivers/Makefile b/arch/sh/drivers/Makefile
index 56b0acace6e7..eacbcefb26b2 100644
--- a/arch/sh/drivers/Makefile
+++ b/arch/sh/drivers/Makefile
@@ -5,7 +5,9 @@
 
 obj-y		+= dma/ platform_early.o
 
+ifndef CONFIG_SH_DEVICE_TREE
 obj-$(CONFIG_PCI)		+= pci/
+endif
 obj-$(CONFIG_SUPERHYWAY)	+= superhyway/
 obj-$(CONFIG_PUSH_SWITCH)	+= push-switch.o
 obj-$(CONFIG_HEARTBEAT)		+= heartbeat.o
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index d8f3537ef57f..d14adf034780 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -292,4 +292,14 @@ static inline void iounmap(volatile void __iomem *addr) { }
 int valid_phys_addr_range(phys_addr_t addr, size_t size);
 int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
 
+
+#ifdef __KERNEL__
+#define PCI_IOBASE	0xfe240000UL
+
+#define HAVE_ARCH_PIO_SIZE
+#define PIO_OFFSET	PCI_IOBASE
+#define PIO_MASK	0x3ffffUL
+#define PIO_RESERVED	0x40000UL
+#endif /* __KERNEL__ */
+
 #endif /* __ASM_SH_IO_H */
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h
index 54c30126ea17..92b3bd604319 100644
--- a/arch/sh/include/asm/pci.h
+++ b/arch/sh/include/asm/pci.h
@@ -2,6 +2,7 @@
 #ifndef __ASM_SH_PCI_H
 #define __ASM_SH_PCI_H
 
+#ifndef CONFIG_SH_DEVICE_TREE
 /* Can be used to override the logic in pci_scan_bus for skipping
    already-configured bus numbers - to be used for buggy BIOSes
    or architectures with incomplete PCI setup by the loader */
@@ -88,4 +89,7 @@ static inline int pci_proc_domain(struct pci_bus *bus)
 	return hose->need_domain_info;
 }
 
+#else /* CONFIG_SH_DEVICE_TREE */
+#include <asm-generic/pci.h>
+#endif
 #endif /* __ASM_SH_PCI_H */
diff --git a/arch/sh/kernel/cpu/Makefile b/arch/sh/kernel/cpu/Makefile
index 46118236bf04..e462a9552c92 100644
--- a/arch/sh/kernel/cpu/Makefile
+++ b/arch/sh/kernel/cpu/Makefile
@@ -16,6 +16,10 @@ obj-$(CONFIG_ARCH_SHMOBILE)	+= shmobile/
 # Common interfaces.
 
 obj-$(CONFIG_SH_ADC)		+= adc.o
+ifndef CONFIG_COMMON_CLK
 obj-$(CONFIG_SH_CLK_CPG_LEGACY)	+= clock-cpg.o
-
-obj-y	+= irq/ init.o clock.o fpu.o pfc.o proc.o
+endif
+ifndef CONFIG_GENERIC_IRQ_CHIP
+obj-y	+= irq/
+endif
+obj-y	+= init.o clock.o fpu.o pfc.o proc.o
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c
index 6fb34410d630..e6c75d4ba7e1 100644
--- a/arch/sh/kernel/cpu/clock.c
+++ b/arch/sh/kernel/cpu/clock.c
@@ -14,12 +14,13 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/clk.h>
+#include <linux/of.h>
 #include <asm/clock.h>
 #include <asm/machvec.h>
 
 int __init clk_init(void)
 {
-	int ret;
+	int ret = 0;
 
 #ifndef CONFIG_COMMON_CLK
 	ret = arch_clk_init();
diff --git a/arch/sh/kernel/cpu/sh4/Makefile b/arch/sh/kernel/cpu/sh4/Makefile
index 00c16331e07e..1e196c320b96 100644
--- a/arch/sh/kernel/cpu/sh4/Makefile
+++ b/arch/sh/kernel/cpu/sh4/Makefile
@@ -15,6 +15,7 @@ perf-$(CONFIG_CPU_SUBTYPE_SH7750)	:= perf_event.o
 perf-$(CONFIG_CPU_SUBTYPE_SH7750S)	:= perf_event.o
 perf-$(CONFIG_CPU_SUBTYPE_SH7091)	:= perf_event.o
 
+ifndef CONFIG_OF
 # CPU subtype setup
 obj-$(CONFIG_CPU_SUBTYPE_SH7750)	+= setup-sh7750.o
 obj-$(CONFIG_CPU_SUBTYPE_SH7750R)	+= setup-sh7750.o
@@ -32,6 +33,7 @@ endif
 
 # Additional clocks by subtype
 clock-$(CONFIG_CPU_SUBTYPE_SH4_202)	+= clock-sh4-202.o
+endif
 
 obj-y					+= $(clock-y)
 obj-$(CONFIG_PERF_EVENTS)		+= $(perf-y)
-- 
2.39.2


  parent reply	other threads:[~2023-08-31  1:12 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31  1:11 [RESEND RFC PATCH 00/12] DeviceTree support for SH7751 based boards Yoshinori Sato
2023-08-31  1:11 ` [RESEND RFC PATCH 01/12] sh: Add OF target boards Yoshinori Sato
2023-09-01 12:22   ` Geert Uytterhoeven
2023-09-01 14:26   ` Geert Uytterhoeven
2023-09-06  8:05     ` Yoshinori Sato
2023-09-06  8:12       ` John Paul Adrian Glaubitz
2023-09-07  3:28         ` Yoshinori Sato
2023-09-07  3:35     ` Yoshinori Sato
2023-08-31  1:11 ` [RESEND RFC PATCH 02/12] sh: Update OF handling Yoshinori Sato
2023-09-01 12:25   ` Geert Uytterhoeven
2023-08-31  1:11 ` Yoshinori Sato [this message]
2023-09-01 12:26   ` [RESEND RFC PATCH 03/12] sh: SH4 OF support Geert Uytterhoeven
2023-09-13 12:23   ` Geert Uytterhoeven
2023-09-15  9:21     ` Yoshinori Sato
2023-08-31  1:11 ` [RESEND RFC PATCH 04/12] clk: SH7750 / 7751 clk driver Yoshinori Sato
2023-09-01 12:26   ` Geert Uytterhoeven
2023-09-07  3:44     ` Yoshinori Sato
2023-08-31  1:11 ` [RESEND RFC PATCH 05/12] drivers/irqchip: Add SH7751 and boards specific irqchip Yoshinori Sato
2023-09-01 12:49   ` Geert Uytterhoeven
2023-08-31  1:11 ` [RESEND RFC PATCH 06/12] drivers/pci: Add SH7751 PCI Host bridge driver Yoshinori Sato
2023-09-01 12:54   ` Geert Uytterhoeven
2023-08-31  1:11 ` [RESEND RFC PATCH 07/12] clocksource: Update sh_tmu of handling Yoshinori Sato
2023-08-31  6:48   ` Krzysztof Kozlowski
2023-09-01 13:01   ` Geert Uytterhoeven
2023-09-01 13:40     ` Yoshinori Sato
2023-08-31  1:11 ` [RESEND RFC PATCH 08/12] mfd/sm501: Add OF properties Yoshinori Sato
2023-08-31  6:51   ` Krzysztof Kozlowski
2023-09-01 13:09   ` Geert Uytterhoeven
2023-08-31  1:11 ` [RESEND RFC PATCH 09/12] of: FDT vaddr support for SH Yoshinori Sato
2023-08-31  6:48   ` Krzysztof Kozlowski
2023-09-01 13:11   ` Geert Uytterhoeven
2023-09-01 13:33     ` Yoshinori Sato
2023-08-31  1:11 ` [RESEND RFC PATCH 10/12] serial/sh-sci: Fix earlyprintk / earlycon Yoshinori Sato
2023-09-01 13:26   ` Geert Uytterhoeven
2023-09-06  7:27     ` Yoshinori Sato
2023-08-31  1:11 ` [RESEND RFC PATCH 11/12] sh: target dts Yoshinori Sato
2023-09-01 14:23   ` Geert Uytterhoeven
2023-08-31  1:11 ` [RESEND RFC PATCH 12/12] sh: OF defconfig Yoshinori Sato

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=4a138cf1ff14ff6166a66851db7476096fa3f009.1693444193.git.ysato@users.sourceforge.jp \
    --to=ysato@users.sourceforge.jp \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-sh@vger.kernel.org \
    /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.