Device Tree support for SH7751 based board
Subsystems (12)
Yoshinori Sato
maintainercover Device Tree support for SH7751 based board
This is an updated version of something I wrote about 7 years ago. Minimum support for R2D-plus and LANDISK.
I think R2D-1 will work if you add AX88796 to dts.
And board-specific functions and SCI's SPI functions are not supported.
Yoshinori Sato (12):
sh: Add OF target boards.
sh: Update OF handling.
sh: SH4 OF support.
clk: SH7750 / 7751 clk driver.
drivers/irqchip: Add SH7751 and boards specific irqchip. drivers/pci: Add SH7751 PCI Host bridge driver.
clocksource: Update sh_tmu of handling. mfd/sm501: Add OF properties.
of: FDT vaddr support for SH.
serial/sh-sci: Fix earlyprintk / earlycon.
sh: target dts.
sh: OF defconfig.
.../devicetree/bindings/display/sm501fb.txt | 11 + arch/sh/Kconfig | 12 +- arch/sh/boards/Kconfig | 28 ++ arch/sh/boards/of-generic.c | 28 +- arch/sh/boot/compressed/head_32.S | 5 +- arch/sh/boot/dts/include/dt-bindings | 1 + arch/sh/boot/dts/landisk.dts | 142 +++++++ arch/sh/boot/dts/rts7751r2dplus.dts | 168 ++++++++ arch/sh/boot/dts/usl-5p.dts | 146 +++++++ arch/sh/configs/landisk-of_defconfig | 161 ++++++++ arch/sh/configs/rts7751r2dplus-of_defconfig | 159 ++++++++ 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 + arch/sh/kernel/head_32.S | 2 +- arch/sh/kernel/setup.c | 26 +- drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/sh/Kconfig | 7 + drivers/clk/sh/Makefile | 2 + drivers/clk/sh/clk-sh7750.c | 193 +++++++++ drivers/clk/sh/clk-shdiv.c | 341 ++++++++++++++++ drivers/clocksource/sh_tmu.c | 33 +- drivers/irqchip/Kconfig | 4 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-iodata-julian.c | 163 ++++++++ drivers/irqchip/irq-renesas-r2d.c | 175 ++++++++ drivers/irqchip/irq-renesas-sh7751.c | 186 +++++++++ drivers/mfd/sm501.c | 113 +++++- drivers/of/fdt.c | 3 + drivers/pci/controller/Kconfig | 9 + drivers/pci/controller/Makefile | 1 + drivers/pci/controller/pci-sh7751.c | 382 ++++++++++++++++++ drivers/pci/controller/pci-sh7751.h | 267 ++++++++++++ drivers/sh/Makefile | 2 + drivers/tty/serial/sh-sci.c | 10 +- 39 files changed, 2779 insertions(+), 33 deletions(-) create mode 120000 arch/sh/boot/dts/include/dt-bindings create mode 100644 arch/sh/boot/dts/landisk.dts create mode 100644 arch/sh/boot/dts/rts7751r2dplus.dts create mode 100644 arch/sh/boot/dts/usl-5p.dts create mode 100644 arch/sh/configs/landisk-of_defconfig create mode 100644 arch/sh/configs/rts7751r2dplus-of_defconfig create mode 100644 drivers/clk/sh/Kconfig create mode 100644 drivers/clk/sh/Makefile create mode 100644 drivers/clk/sh/clk-sh7750.c create mode 100644 drivers/clk/sh/clk-shdiv.c create mode 100644 drivers/irqchip/irq-iodata-julian.c create mode 100644 drivers/irqchip/irq-renesas-r2d.c create mode 100644 drivers/irqchip/irq-renesas-sh7751.c create mode 100644 drivers/pci/controller/pci-sh7751.c create mode 100644 drivers/pci/controller/pci-sh7751.h
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerRFC PATCH 1/12 sh: Add OF target boards.
--- arch/sh/Kconfig | 12 +++++++++--- arch/sh/boards/Kconfig | 28 ++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-)
arch/sh/Kconfig +9 -3
@@ -64,10 +64,10 @@ config SUPERH select MODULES_USE_ELF_RELA select NEED_SG_DMA_LENGTH select NO_DMA if !MMU && !DMA_COHERENT - select NO_GENERIC_PCI_IOPORT_MAP if PCI + select NO_GENERIC_PCI_IOPORT_MAP if !SH_DEVICE_TREE select OLD_SIGACTION select OLD_SIGSUSPEND - select PCI_DOMAINS if PCI + select PCI_DOMAINS if PCI && !SH_DEVICE_TREE select PERF_EVENTS select PERF_USE_VMALLOC select RTC_LIB
@@ -363,14 +363,17 @@ config CPU_SUBTYPE_SH7091 config CPU_SUBTYPE_SH7750R bool "Support SH7750R processor" select CPU_SH4 + select COMMON_CLK_SH7750 if COMMMON_CLK config CPU_SUBTYPE_SH7750S bool "Support SH7750S processor" select CPU_SH4 + select COMMON_CLK_SH7750 if COMMMON_CLK config CPU_SUBTYPE_SH7751 bool "Support SH7751 processor" select CPU_SH4 + select COMMON_CLK_SH7750 if COMMMON_CLK help Select SH7751 if you have a 166 Mhz SH-4 HD6417751 CPU, or if you have a HD6417751R CPU.
@@ -378,6 +381,8 @@ config CPU_SUBTYPE_SH7751 config CPU_SUBTYPE_SH7751R bool "Support SH7751R processor" select CPU_SH4 + select COMMON_CLK_SH7750 if COMMMON_CLK + select PCI_SH7751 if SH_DEVICE_TREE config CPU_SUBTYPE_SH7760 bool "Support SH7760 processor"
@@ -702,7 +707,7 @@ config BUILTIN_DTB_SOURCE config ZERO_PAGE_OFFSET hex default "0x00010000" if PAGE_SIZE_64KB || SH_RTS7751R2D || \ - SH_7751_SOLUTION_ENGINE + SH_7751_SOLUTION_ENGINE || SH_RTS7751R2D_OF default "0x00004000" if PAGE_SIZE_16KB || SH_SH03 default "0x00002000" if PAGE_SIZE_8KB default "0x00001000"
@@ -744,6 +749,7 @@ config ROMIMAGE_MMCIF choice prompt "Kernel command line" optional + depends on !SH_DEVICE_TREE default CMDLINE_OVERWRITE help Setting this option allows the kernel command line arguments
arch/sh/boards/Kconfig +28 -0
@@ -16,9 +16,14 @@ config SH_DEVICE_TREE bool select OF select OF_EARLY_FLATTREE + select OF_ADDRESS select TIMER_OF select COMMON_CLK select GENERIC_CALIBRATE_DELAY + select GENERIC_IOMAP + select GENERIC_IRQ_CHIP + select SYS_SUPPORTS_PCI + select GENERIC_PCI_IOMAP if PCI config SH_JCORE_SOC bool "J-Core SoC"
@@ -161,6 +166,17 @@ config SH_RTS7751R2D Select RTS7751R2D if configuring for a Renesas Technology Sales SH-Graphics board. +config SH_RTS7751R2D_OF + bool "RTS7751R2D (DeviceTree)" + depends on CPU_SUBTYPE_SH7751R + select HAVE_PCI + select IO_TRAPPED if MMU + select SH_DEVICE_TREE + select COMMON_CLK + help + Select RTS7751R2D if configuring for a Renesas Technology + Sales SH-Graphics board. (Use DeviceTree) + config SH_RSK bool "Renesas Starter Kit" depends on CPU_SUBTYPE_SH7201 || CPU_SUBTYPE_SH7203 || \
@@ -300,8 +316,20 @@ config SH_LANDISK bool "LANDISK" depends on CPU_SUBTYPE_SH7751R select HAVE_PCI + select SYS_SUPPORTS_PCI + help + I-O DATA DEVICE, INC. "LANDISK Series" support. + +config SH_LANDISK_OF + bool "LANDISK (DeviceTree)" + depends on CPU_SUBTYPE_SH7751R + select HAVE_PCI + select SYS_SUPPORTS_PCI + select SH_DEVICE_TREE + select COMMON_CLK help I-O DATA DEVICE, INC. "LANDISK Series" support. + Use Device Tree. config SH_TITAN bool "TITAN"
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerRFC PATCH 2/12 sh: Update OF handling.
In reply to Yoshinori Sato- avoid build warning.
- reserve external dtb area.
- use generic interfaces on internal peripheral driver.
--- arch/sh/boards/of-generic.c | 28 +++++++++++++++++++++++++--- arch/sh/boot/compressed/head_32.S | 5 +++-- arch/sh/kernel/head_32.S | 2 +- arch/sh/kernel/setup.c | 26 +++++++++++++++++++++++++- 4 files changed, 54 insertions(+), 7 deletions(-)
arch/sh/boards/of-generic.c +25 -3
@@ -8,6 +8,7 @@#include <linux/of.h> #include <linux/of_clk.h> #include <linux/of_fdt.h> +#include <linux/of_platform.h> #include <linux/clocksource.h> #include <linux/irqchip.h> #include <asm/machvec.h>
@@ -107,7 +108,7 @@ static int noopi(void)return 0 ; } -static void __init sh_of_mem_reserve (void ) +static void __init sh_of_mem_init (void ) {early_init_fdt_reserve_self ();early_init_fdt_scan_reserved_mem ();
@@ -116,6 +117,8 @@ static void __init sh_of_mem_reserve(void)static void __init sh_of_setup (char **cmdline_p) {struct device_node *root; +struct device_node *cpu; +int freq; sh_mv.mv_name ="Unknown SH model" ; root =of_find_node_by_path ("/" );
@@ -125,6 +128,9 @@ static void __init sh_of_setup(char **cmdline_p) }sh_of_smp_probe (); + cpu =of_find_node_by_name (NULL ,"cpu" ); +if (!of_property_read_u32 (cpu,"clock-frequency" , &freq)) + preset_lpj = freq /500 ; }static int sh_of_irq_demux (int irq)
@@ -157,8 +163,7 @@ static struct sh_machine_vector __initmv sh_of_generic_mv = { .mv_init_irq = sh_of_init_irq, .mv_clk_init = sh_of_clk_init, .mv_mode_pins = noopi, - .mv_mem_init = noop, - .mv_mem_reserve = sh_of_mem_reserve, + .mv_mem_init = sh_of_mem_init, };struct sh_clk_ops ;
@@ -170,3 +175,20 @@ void __init __weak arch_init_clk_ops(struct sh_clk_ops **ops, int idx)void __init __weak plat_irq_setup (void ) { } + +static int __init sh_of_device_init (void ) +{ +pr_info ("SH generic board support: populating platform devices\n" ); +if (of_have_populated_dt ()) { +of_platform_populate (NULL , of_default_bus_match_table, +NULL ,NULL ); + }else { +pr_crit ("Device tree not populated\n" ); + } +return 0 ; +} +arch_initcall_sync (sh_of_device_init); + +void intc_finalize (void ) +{ +}
arch/sh/boot/compressed/head_32.S +3 -2
@@ -15,7 +15,8 @@ startup: /* Load initial status register */ mov.l init_sr, r1 ldc r1, sr - + /* Save FDT address */ + mov r4, r13 /* Move myself to proper location if necessary */ mova 1f, r0 mov.l 1f, r2
@@ -84,7 +85,7 @@ l1: /* Jump to the start of the decompressed kernel */ mov.l kernel_start_addr, r0 jmp @r0 - nop + mov r13,r4 .align 2 bss_start_addr:
arch/sh/kernel/head_32.S +1 -1
@@ -56,7 +56,7 @@ ENTRY(empty_zero_page) */ ENTRY(_stext) ! Initialize Status Register - mov.l 1f, r0 ! MD=1, RB=0, BL=0, IMASK=0xF + mov.l 1f, r0 ! MD=1, RB=0, BL=1, IMASK=0xF ldc r0, sr ! Initialize global interrupt mask #ifdef CONFIG_CPU_HAS_SR_RB
arch/sh/kernel/setup.c +25 -1
@@ -31,6 +31,7 @@#include <linux/memblock.h> #include <linux/of.h> #include <linux/of_fdt.h> +#include <linux/libfdt.h> #include <linux/uaccess.h> #include <uapi/linux/mount.h> #include <asm/io.h>
@@ -79,7 +80,9 @@ extern int root_mountflags;#define RAMDISK_PROMPT_FLAG 0x8000#define RAMDISK_LOAD_FLAG 0x4000 +#ifndef CONFIG_OF static char __initdata command_line[COMMAND_LINE_SIZE ] = {0 , }; +#endif static struct resource code_resource = { .name ="Kernel code" ,
@@ -104,6 +107,10 @@ unsigned long memory_limit = 0;static struct resource mem_resources[MAX_NUMNODES ]; +#if defined(CONFIG_OF ) +static void *dt_virt; +#endif +int l1i_cache_shape, l1d_cache_shape, l2_cache_shape;static int __init early_parse_mem (char *p)
@@ -180,7 +187,12 @@ void __init check_for_initrd(void)#ifndef CONFIG_GENERIC_CALIBRATE_DELAY void calibrate_delay (void ) { +#ifndef CONFIG_OF struct clk *clk =clk_get (NULL ,"cpu_clk" ); +#else +struct device_node *cpu =of_find_node_by_name (NULL ,"cpu" ); +struct clk *clk =of_clk_get_by_name (cpu,NULL ); +#endif if (IS_ERR (clk))panic ("Need a sane CPU clock definition!" );
@@ -249,7 +261,6 @@ void __init __weak plat_early_device_setup(void)void __ref sh_fdt_init (phys_addr_t dt_phys) {static int done =0 ; -void *dt_virt;/* Avoid calling an __init function on secondary cpus. */ if (done)return ;
@@ -274,8 +285,16 @@ void __ref sh_fdt_init(phys_addr_t dt_phys)void __init setup_arch (char **cmdline_p) { +#ifdef CONFIG_OF +#ifndef CONFIG_USE_BUILTIN_DTB +memblock_reserve (__pa (dt_virt),fdt_totalsize (dt_virt)); +#endif +unflatten_device_tree (); +#endif enable_mmu (); + +#ifndef CONFIG_OF ROOT_DEV =old_decode_dev (ORIG_ROOT_DEV ); printk(KERN_NOTICE "Boot params:\n"
@@ -313,10 +332,15 @@ void __init setup_arch(char **cmdline_p)strlcat (command_line,CONFIG_CMDLINE ,sizeof (command_line));#endif #endif +#endif +#if !defined(CONFIG_OF ) || defined(USE_BUILTIN_DTB )/* Save unparsed command line copy for /proc/cmdline */ memcpy (boot_command_line, command_line,COMMAND_LINE_SIZE ); *cmdline_p = command_line; +#else + *cmdline_p = boot_command_line; +#endif parse_early_param ();
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerRFC PATCH 3/12 sh: SH4 OF support.
In reply to Yoshinori Sato- switch generic framework in clock / PCI.
--- 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(-)
arch/sh/drivers/Makefile +2 -0
@@ -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
arch/sh/include/asm/io.h +10 -0
@@ -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 */
arch/sh/include/asm/pci.h +4 -0
@@ -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 */
arch/sh/kernel/cpu/Makefile +6 -2
@@ -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
arch/sh/kernel/cpu/clock.c +2 -1
@@ -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 ();
arch/sh/kernel/cpu/sh4/Makefile +2 -0
@@ -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)
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerRFC PATCH 4/12 clk: SH7750 / 7751 clk driver.
In reply to Yoshinori SatoUse COMMON_CLK framework clock driver.
--- drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/sh/Kconfig | 7 + drivers/clk/sh/Makefile | 2 + drivers/clk/sh/clk-sh7750.c | 193 ++++++++++++++++++++ drivers/clk/sh/clk-shdiv.c | 341 ++++++++++++++++++++++++++++++++++++ drivers/sh/Makefile | 2 + 7 files changed, 547 insertions(+) create mode 100644 drivers/clk/sh/Kconfig create mode 100644 drivers/clk/sh/Makefile create mode 100644 drivers/clk/sh/clk-sh7750.c create mode 100644 drivers/clk/sh/clk-shdiv.c
drivers/clk/Kconfig +1 -0
@@ -485,6 +485,7 @@ source "drivers/clk/ralink/Kconfig" source "drivers/clk/renesas/Kconfig" source "drivers/clk/rockchip/Kconfig" source "drivers/clk/samsung/Kconfig" +source "drivers/clk/sh/Kconfig" source "drivers/clk/sifive/Kconfig" source "drivers/clk/socfpga/Kconfig" source "drivers/clk/sprd/Kconfig"
drivers/clk/Makefile +1 -0
@@ -136,3 +136,4 @@ endif obj-y += xilinx/ obj-$(CONFIG_ARCH_ZYNQ) += zynq/ obj-$(CONFIG_COMMON_CLK_ZYNQMP) += zynqmp/ +obj-$(CONFIG_SUPERH) += sh/
drivers/clk/sh/Kconfig new file +7 -0
@@ -0,0 +1,7 @@ +config COMMON_CLK_SH7750 + bool "Clcok driver for SH7750/SH7751" + depends on CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7750S || \ + CPU_SUBTYPE_SH7750R || \ + CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7751R + help + This driver supports the Renesas SH7750 and SH7751 CPG.
drivers/clk/sh/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +obj-$(CONFIG_COMMON_CLK_SH7750) += clk-sh7750.o +obj-$(CONFIG_COMMON_CLK_SH7750) += clk-shdiv.o
drivers/clk/sh/clk-sh7750.c new file +193 -0
193 lines not on this page · raw message
drivers/clk/sh/clk-shdiv.c new file +341 -0
341 lines not on this page · raw message
drivers/sh/Makefile +2 -0
@@ -2,7 +2,9 @@ # # Makefile for the SuperH specific drivers. # +ifneq ($(CONFIG_RENESAS_SH_INTC),y) obj-$(CONFIG_SH_INTC) += intc/ +endif ifneq ($(CONFIG_COMMON_CLK),y) obj-$(CONFIG_HAVE_CLK) += clk/ endif
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerRFC PATCH 5/12 drivers/irqchip: Add SH7751 and boards specific irqchip.
In reply to Yoshinori Sato- irq-renesas-sh7751: Renesas SH7751 internal INTC.
- irq-renesas-r2d: Renesas RTS7751R2D external interrupt encoder.
- irq-iodata-julian: IO DATA Device LANDISK external interrupt encoder.
--- drivers/irqchip/Kconfig | 4 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-iodata-julian.c | 163 +++++++++++++++++++++++ drivers/irqchip/irq-renesas-r2d.c | 175 +++++++++++++++++++++++++ drivers/irqchip/irq-renesas-sh7751.c | 186 +++++++++++++++++++++++++++ 5 files changed, 529 insertions(+) create mode 100644 drivers/irqchip/irq-iodata-julian.c create mode 100644 drivers/irqchip/irq-renesas-r2d.c create mode 100644 drivers/irqchip/irq-renesas-sh7751.c
drivers/irqchip/Kconfig +4 -0
@@ -660,6 +660,10 @@ config APPLE_AIC help Support for the Apple Interrupt Controller found on Apple Silicon SoCs, such as the M1. +config RENESAS_SH_INTC + def_bool y if SH_DEVICE_TREE + select IRQ_DOMAIN + select IRQ_DOMAIN_HIERARCHY config MCHP_EIC bool "Microchip External Interrupt Controller"
drivers/irqchip/Makefile +1 -0
@@ -120,3 +120,4 @@ obj-$(CONFIG_IRQ_IDT3243X) += irq-idt3243x.o obj-$(CONFIG_APPLE_AIC) += irq-apple-aic.o obj-$(CONFIG_MCHP_EIC) += irq-mchp-eic.o obj-$(CONFIG_SUNPLUS_SP7021_INTC) += irq-sp7021-intc.o +obj-$(CONFIG_RENESAS_SH_INTC) += irq-renesas-sh7751.o irq-iodata-julian.o irq-renesas-r2d.o
drivers/irqchip/irq-iodata-julian.c new file +163 -0
163 lines not on this page · raw message
drivers/irqchip/irq-renesas-r2d.c new file +175 -0
175 lines not on this page · raw message
drivers/irqchip/irq-renesas-sh7751.c new file +186 -0
186 lines not on this page · raw message
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerRFC PATCH 6/12 drivers/pci: Add SH7751 PCI Host bridge driver.
In reply to Yoshinori SatoUse Common framework host bridge driver.
--- drivers/pci/controller/Kconfig | 9 + drivers/pci/controller/Makefile | 1 + drivers/pci/controller/pci-sh7751.c | 382 ++++++++++++++++++++++++++++ drivers/pci/controller/pci-sh7751.h | 267 +++++++++++++++++++ 4 files changed, 659 insertions(+) create mode 100644 drivers/pci/controller/pci-sh7751.c create mode 100644 drivers/pci/controller/pci-sh7751.h
drivers/pci/controller/Kconfig +9 -0
@@ -343,6 +343,15 @@ config PCIE_XILINX_CPM Say 'Y' here if you want kernel support for the Xilinx Versal CPM host bridge. +config PCI_SH7751 + bool "Renesas SH7751 PCI controller" + depends on OF + depends on CPU_SUBTYPE_SH7751 || CPU_SUBTYPE_SH7751R + select PCI_HOST_COMMON + help + Say 'Y' here if you want kernel to support the Renesas SH7751 PCI + Host Bridge driver. + source "drivers/pci/controller/cadence/Kconfig" source "drivers/pci/controller/dwc/Kconfig" source "drivers/pci/controller/mobiveil/Kconfig"
drivers/pci/controller/Makefile +1 -0
@@ -39,6 +39,7 @@ obj-$(CONFIG_PCI_LOONGSON) += pci-loongson.o obj-$(CONFIG_PCIE_HISI_ERR) += pcie-hisi-error.o obj-$(CONFIG_PCIE_APPLE) += pcie-apple.o obj-$(CONFIG_PCIE_MT7621) += pcie-mt7621.o +obj-$(CONFIG_PCI_SH7751) += pci-sh7751.o # pcie-hisi.o quirks are needed even without CONFIG_PCIE_DW obj-y += dwc/
drivers/pci/controller/pci-sh7751.c new file +382 -0
382 lines not on this page · raw message
drivers/pci/controller/pci-sh7751.h new file +267 -0
267 lines not on this page · raw message
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerRFC PATCH 7/12 clocksource: Update sh_tmu of handling.
In reply to Yoshinori Sato--- drivers/clocksource/sh_tmu.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-)
drivers/clocksource/sh_tmu.c +17 -16
@@ -420,9 +420,6 @@ static void sh_tmu_register_clockevent(struct sh_tmu_channel *ch, ced->suspend = sh_tmu_clock_event_suspend; ced->resume = sh_tmu_clock_event_resume; -dev_info (&ch->tmu->pdev->dev,"ch%u: used for clock events\n" , - ch->index); -clockevents_config_and_register (ced, ch->tmu->rate,0x300 ,0xffffffff ); ret = request_irq(ch->irq, sh_tmu_interrupt,
@@ -500,12 +497,12 @@ static int sh_tmu_parse_dt(struct sh_tmu_device *tmu) tmu->model =SH_TMU ; tmu->num_channels =3 ; -of_property_read_u32 (np,"#renesas,channels" , &tmu->num_channels); - -if (tmu->num_channels !=2 && tmu->num_channels !=3 ) { -dev_err (&tmu->pdev->dev,"invalid number of channels %u\n" , - tmu->num_channels); -return -EINVAL ; +if (of_property_read_u32 (np,"#renesas,channels" , &tmu->num_channels)) { +if (tmu->num_channels !=2 && tmu->num_channels !=3 ) { +dev_err (&tmu->pdev->dev, +"invalid number of channels %u\n" , tmu->num_channels); +return -EINVAL ; + } }return 0 ;
@@ -513,7 +510,6 @@ static int sh_tmu_parse_dt(struct sh_tmu_device *tmu)static int sh_tmu_setup (struct sh_tmu_device *tmu,struct platform_device *pdev) { -unsigned int i;int ret; tmu->pdev = pdev;
@@ -535,6 +531,11 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev)return -ENXIO ; } +if (tmu->num_channels <2 ) { +dev_err (&tmu->pdev->dev,"Invalid channels.\n" ); +return -ENXIO ; + } +/* Get hold of clock. */ tmu->clk =clk_get (&tmu->pdev->dev,"fck" );if (IS_ERR (tmu->clk)) {
@@ -573,12 +574,12 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev)* Use the first channel as a clock event device and the second channel * as a clock source. */ -for (i =0 ; i < tmu->num_channels; ++i) { - ret =sh_tmu_channel_setup (&tmu->channels[i], i, - i ==0 , i ==1 , tmu); -if (ret <0 ) - goto err_unmap; - } + ret =sh_tmu_channel_setup (&tmu->channels[0 ],0 , false, true, tmu); +if (ret <0 ) + goto err_unmap; + ret =sh_tmu_channel_setup (&tmu->channels[1 ],1 , true, false, tmu); +if (ret <0 ) + goto err_unmap;platform_set_drvdata (pdev, tmu);
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerRFC PATCH 8/12 mfd/sm501: Add OF properties.
In reply to Yoshinori SatoSome parameters only platform_device.
Added same parameters in OF property.
--- .../devicetree/bindings/display/sm501fb.txt | 11 ++ drivers/mfd/sm501.c | 113 +++++++++++++++++- 2 files changed, 123 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/display/sm501fb.txt +11 -0
@@ -20,6 +20,17 @@ Optional properties: set different foreign endian. - big-endian: available on little endian systems, to set different foreign endian. +- sm501,devices: select peripheral functions. + available usb-host, usb-gadget, ssp0, ssp,1 uart0, uart1, accel, + ac97, i2s, gpio and all. +- sm501,mclk: SM501 mclk frequency. +- sm501,m1xclk: SM501 m1xclk frequency. +- sm501,misc-timing: SM501 Miscellaneous Timing reg value. +- sm501,misc-control: SM501 Miscellaneous Control reg value. +- sm501,gpio-low: SM501 GPIO31-0 Control reg value. +- sm501,gpio-high: SM501 GPIO63-32 Control reg value. +- sm501,num-i2c: I2C channel number. +- sm501,gpio-i2c: I2C assigned GPIO. Example for MPC5200: display@1,0 {
drivers/mfd/sm501.c +112 -1
137 lines not on this page · raw message
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerRFC PATCH 9/12 of: FDT vaddr support for SH.
In reply to Yoshinori Satosh using virt address in FDT.
--- drivers/of/fdt.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/of/fdt.c +3 -0
@@ -643,6 +643,9 @@ void __init early_init_fdt_scan_reserved_mem(void)fdt_get_mem_rsv (initial_boot_params, n, &base, &size);if (!size)break ; +#ifdef CONFIG_SUPERH + base =virt_to_phys (base); +#endif memblock_reserve (base, size); }
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerRFC PATCH 10/12 serial/sh-sci: Fix earlyprintk / earlycon.
In reply to Yoshinori Sato- earlyprintk having fault.
- fix shortname conflict.
- fix SCI regshift in SH4.
--- drivers/tty/serial/sh-sci.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/tty/serial/sh-sci.c +7 -3
@@ -2721,7 +2721,7 @@ static int sci_remap_port(struct uart_port *port)if (port->membase)return 0 ; -if (port->dev->of_node || (port->flags &UPF_IOREMAP )) { +if ((port->dev && port->dev->of_node) || (port->flags &UPF_IOREMAP )) { port->membase =ioremap (port->mapbase, sport->reg_size);if (unlikely (!port->membase)) {dev_err (port->dev,"can't remap port#%d\n" , port->line);
@@ -3507,6 +3507,10 @@ static int __init early_console_setup(struct earlycon_device *device,if (!device->port.membase)return -ENODEV ; +if (type ==PORT_SCI && + (IS_ENABLED (CONFIG_CPU_SH3 ) ||IS_ENABLED (CONFIG_CPU_SH4 ))) { + device->port.regshift =2 ; + } device->port.serial_in = sci_serial_in; device->port.serial_out = sci_serial_out; device->port.type = type;
@@ -3556,8 +3560,8 @@ static int __init hscif_early_console_setup(struct earlycon_device *device,OF_EARLYCON_DECLARE (sci,"renesas,sci" , sci_early_console_setup);OF_EARLYCON_DECLARE (scif,"renesas,scif" , scif_early_console_setup); -OF_EARLYCON_DECLARE (scif,"renesas,scif-r7s9210" , rzscifa_early_console_setup); -OF_EARLYCON_DECLARE (scif,"renesas,scif-r9a07g044" , rzscifa_early_console_setup); +OF_EARLYCON_DECLARE (rzscif,"renesas,scif-r7s9210" , rzscifa_early_console_setup); +OF_EARLYCON_DECLARE (rzscif,"renesas,scif-r9a07g044" , rzscifa_early_console_setup);OF_EARLYCON_DECLARE (scifa,"renesas,scifa" , scifa_early_console_setup);OF_EARLYCON_DECLARE (scifb,"renesas,scifb" , scifb_early_console_setup);OF_EARLYCON_DECLARE (hscif,"renesas,hscif" , hscif_early_console_setup);
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerRFC PATCH 11/12 sh: target dts.
In reply to Yoshinori Sato- rts7751r2dplus - Renesas RTS7751R2D-PLUS board.
- landisk - IO DATA DEVICE LANDISK
- usl-5p - IO DATA DECVICE USL-5P
--- arch/sh/boot/dts/include/dt-bindings | 1 + arch/sh/boot/dts/landisk.dts | 142 ++++++++++++++++++++++ arch/sh/boot/dts/rts7751r2dplus.dts | 168 +++++++++++++++++++++++++++ arch/sh/boot/dts/usl-5p.dts | 146 +++++++++++++++++++++++ 4 files changed, 457 insertions(+) create mode 120000 arch/sh/boot/dts/include/dt-bindings create mode 100644 arch/sh/boot/dts/landisk.dts create mode 100644 arch/sh/boot/dts/rts7751r2dplus.dts create mode 100644 arch/sh/boot/dts/usl-5p.dts
arch/sh/boot/dts/include/dt-bindings new file +1 -0
@@ -0,0 +1 @@ +../../../../../include/dt-bindings
arch/sh/boot/dts/landisk.dts new file +142 -0
142 lines not on this page · raw message
arch/sh/boot/dts/rts7751r2dplus.dts new file +168 -0
168 lines not on this page · raw message
arch/sh/boot/dts/usl-5p.dts new file +146 -0
146 lines not on this page · raw message
Signature · 1 line
2.39.2
Re: [RFC PATCH 11/12] sh: target dts.
Hi Sato-san,
Quoted 5 lines · Yoshinori Sato
- rts7751r2dplus - Renesas RTS7751R2D-PLUS board.
- landisk - IO DATA DEVICE LANDISK
- usl-5p - IO DATA DECVICE USL-5PSigned-off-by Yoshinori Sato <[email protected]>
Thanks for your patch!
Quoted 17 lines
--- arch/sh/boot/dts/include/dt-bindings | 1 + arch/sh/boot/dts/landisk.dts | 142 ++++++++++++++++++++++ arch/sh/boot/dts/rts7751r2dplus.dts | 168 +++++++++++++++++++++++++++ arch/sh/boot/dts/usl-5p.dts | 146 +++++++++++++++++++++++ 4 files changed, 457 insertions(+) create mode 120000 arch/sh/boot/dts/include/dt-bindings create mode 100644 arch/sh/boot/dts/landisk.dts create mode 100644 arch/sh/boot/dts/rts7751r2dplus.dts create mode 100644 arch/sh/boot/dts/usl-5p.dtsarch/sh/boot/dts/include/dt-bindings new file +0
-0
arch/sh/boot/dts/include/dt-bindings line 1
Quoted 1 line
arch/sh/boot/dts/include/dt-bindings new file +1
-0@@ -0,0 +1 @@ +../../../../../include/dt-bindings
This should not be needed.
arch/sh/boot/dts/landisk.dts line 8
Quoted 11 lines
arch/sh/boot/dts/landisk.dts new file +8
-0@@ -0,0 +1,142 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Device Tree source for IO DATA DEVICE LANDISK + * + * Copyright 2023 Yoshinori Sato + */ + +#include <dt-bindings/interrupt-controller/sh_intc.h>
You forgot to post commit d00349bf840505a0 ("sh: SH-INTC helper files") in ysato/sh-of-wip.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Re: [RFC PATCH 11/12] sh: target dts.
Hi Sato-san,
Quoted 16 lines · Geert Uytterhoeven
arch/sh/boot/dts/landisk.dts line 8
Quoted 11 lines · Yoshinori Sato
arch/sh/boot/dts/landisk.dts new file +8
-0@@ -0,0 +1,142 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Device Tree source for IO DATA DEVICE LANDISK + * + * Copyright 2023 Yoshinori Sato + */ + +#include <dt-bindings/interrupt-controller/sh_intc.h>You forgot to post commit
d00349bf840505a0("sh: SH-INTC helper files") in ysato/sh-of-wip.
And that one needs:
include/dt-bindings/interrupt-controller/sh_intc.h +2 -2
@@ -1,2 +1,2 @@ -#define evt2irq (evt) (((evt) >> 5) - 16) -#define irq2evt (irq) (((irq) + 16) << 5) +#define evt2irq (evt) (((evt) >> 5)) +#define irq2evt (irq) (((irq)) << 5)
Cfr. commit a8ac2961148e8c72 ("sh: Avoid using IRQ0 on SH3 and SH4") in v6.5.
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Yoshinori Sato
maintainerRFC PATCH 12/12 sh: OF defconfig.
In reply to Yoshinori Sato--- arch/sh/configs/landisk-of_defconfig | 161 ++++++++++++++++++++ arch/sh/configs/rts7751r2dplus-of_defconfig | 159 +++++++++++++++++++ 2 files changed, 320 insertions(+) create mode 100644 arch/sh/configs/landisk-of_defconfig create mode 100644 arch/sh/configs/rts7751r2dplus-of_defconfig
arch/sh/configs/landisk-of_defconfig new file +161 -0
@@ -0,0 +1,161 @@ +CONFIG_SYSVIPC=y +CONFIG_LOG_BUF_SHIFT=14 +CONFIG_NAMESPACES=y +CONFIG_EMBEDDED=y +CONFIG_PROFILING=y +CONFIG_CPU_SUBTYPE_SH7751R=y +CONFIG_MEMORY_START=0x0c000000 +CONFIG_SH_LANDISK_OF=y +CONFIG_MODULES=y +CONFIG_SLAB=y +CONFIG_FLATMEM_MANUAL=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +# CONFIG_IPV6 is not set +CONFIG_PCI=y +CONFIG_HOTPLUG_PCI=y +CONFIG_UEVENT_HELPER=y +CONFIG_MTD=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_CFI=y +CONFIG_MTD_CFI_AMDSTD=y +CONFIG_MTD_PHYSMAP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_SD=y +# CONFIG_BLK_DEV_BSG is not set +CONFIG_ATA=y +CONFIG_PATA_ATP867X=y +CONFIG_PATA_OF_PLATFORM=y +CONFIG_NETDEVICES=y +# CONFIG_NET_VENDOR_3COM is not set +# CONFIG_NET_VENDOR_ADAPTEC is not set +# CONFIG_NET_VENDOR_AGERE is not set +# CONFIG_NET_VENDOR_ALACRITECH is not set +# CONFIG_NET_VENDOR_ALTEON is not set +# CONFIG_NET_VENDOR_AMAZON is not set +# CONFIG_NET_VENDOR_AMD is not set +# CONFIG_NET_VENDOR_AQUANTIA is not set +# CONFIG_NET_VENDOR_ARC is not set +# CONFIG_NET_VENDOR_ASIX is not set +# CONFIG_NET_VENDOR_ATHEROS is not set +# CONFIG_NET_VENDOR_BROADCOM is not set +# CONFIG_NET_VENDOR_CADENCE is not set +# CONFIG_NET_VENDOR_CAVIUM is not set +# CONFIG_NET_VENDOR_CHELSIO is not set +# CONFIG_NET_VENDOR_CISCO is not set +# CONFIG_NET_VENDOR_CORTINA is not set +# CONFIG_NET_VENDOR_DAVICOM is not set +# CONFIG_NET_VENDOR_DEC is not set +# CONFIG_NET_VENDOR_DLINK is not set +# CONFIG_NET_VENDOR_EMULEX is not set +# CONFIG_NET_VENDOR_ENGLEDER is not set +# CONFIG_NET_VENDOR_EZCHIP is not set +# CONFIG_NET_VENDOR_FUNGIBLE is not set +# CONFIG_NET_VENDOR_GOOGLE is not set +# CONFIG_NET_VENDOR_HUAWEI is not set +# CONFIG_NET_VENDOR_INTEL is not set +# CONFIG_NET_VENDOR_ADI is not set +# CONFIG_NET_VENDOR_LITEX is not set +# CONFIG_NET_VENDOR_MARVELL is not set +# CONFIG_NET_VENDOR_MELLANOX is not set +# CONFIG_NET_VENDOR_MICREL is not set +# CONFIG_NET_VENDOR_MICROCHIP is not set +# CONFIG_NET_VENDOR_MICROSEMI is not set +# CONFIG_NET_VENDOR_MICROSOFT is not set +# CONFIG_NET_VENDOR_MYRI is not set +# CONFIG_NET_VENDOR_NI is not set +# CONFIG_NET_VENDOR_NATSEMI is not set +# CONFIG_NET_VENDOR_NETERION is not set +# CONFIG_NET_VENDOR_NETRONOME is not set +# CONFIG_NET_VENDOR_NVIDIA is not set +# CONFIG_NET_VENDOR_OKI is not set +# CONFIG_NET_VENDOR_PACKET_ENGINES is not set +# CONFIG_NET_VENDOR_PENSANDO is not set +# CONFIG_NET_VENDOR_QLOGIC is not set +# CONFIG_NET_VENDOR_BROCADE is not set +# CONFIG_NET_VENDOR_QUALCOMM is not set +# CONFIG_NET_VENDOR_RDC is not set +CONFIG_8139CP=y +# CONFIG_NET_VENDOR_RENESAS is not set +# CONFIG_NET_VENDOR_ROCKER is not set +# CONFIG_NET_VENDOR_SAMSUNG is not set +# CONFIG_NET_VENDOR_SEEQ is not set +# CONFIG_NET_VENDOR_SILAN is not set +# CONFIG_NET_VENDOR_SIS is not set +# CONFIG_NET_VENDOR_SOLARFLARE is not set +# CONFIG_NET_VENDOR_SMSC is not set +# CONFIG_NET_VENDOR_SOCIONEXT is not set +# CONFIG_NET_VENDOR_STMICRO is not set +# CONFIG_NET_VENDOR_SUN is not set +# CONFIG_NET_VENDOR_SYNOPSYS is not set +# CONFIG_NET_VENDOR_TEHUTI is not set +# CONFIG_NET_VENDOR_TI is not set +# CONFIG_NET_VENDOR_VERTEXCOM is not set +# CONFIG_NET_VENDOR_VIA is not set +# CONFIG_NET_VENDOR_WANGXUN is not set +# CONFIG_NET_VENDOR_WIZNET is not set +# CONFIG_NET_VENDOR_XILINX is not set +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_SERIO is not set +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SERIAL_SH_SCI=y +# CONFIG_SERIAL_SH_SCI_CONSOLE is not set +CONFIG_SERIAL_SH_SCI_EARLYCON=y +CONFIG_HW_RANDOM=y +CONFIG_SPI=y +CONFIG_SPI_SH_SCI=y +CONFIG_MFD_SM501=y +CONFIG_FB=y +CONFIG_FB_SH_MOBILE_LCDC=m +CONFIG_FB_SM501=y +CONFIG_FRAMEBUFFER_CONSOLE=y +CONFIG_LOGO=y +# CONFIG_LOGO_LINUX_MONO is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +# CONFIG_LOGO_LINUX_CLUT224 is not set +# CONFIG_LOGO_SUPERH_MONO is not set +# CONFIG_LOGO_SUPERH_VGA16 is not set +CONFIG_SOUND=y +CONFIG_SND=m +CONFIG_SND_YMFPCI=m +CONFIG_HID_A4TECH=y +CONFIG_HID_BELKIN=y +CONFIG_HID_CHERRY=y +CONFIG_HID_CHICONY=y +CONFIG_HID_CYPRESS=y +CONFIG_HID_EZKEY=y +CONFIG_HID_GYRATION=y +CONFIG_HID_ITE=y +CONFIG_HID_KENSINGTON=y +CONFIG_HID_REDRAGON=y +CONFIG_HID_MICROSOFT=y +CONFIG_HID_MONTEREY=y +CONFIG_HID_PANTHERLORD=y +CONFIG_HID_PETALYNX=y +CONFIG_HID_SAMSUNG=y +CONFIG_HID_SUNPLUS=y +CONFIG_USB=y +CONFIG_USB_ANNOUNCE_NEW_DEVICES=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_STORAGE=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_R9701=y +CONFIG_COMMON_CLK_SH7750=y +CONFIG_EXT2_FS=y +CONFIG_MSDOS_FS=y +CONFIG_VFAT_FS=y +CONFIG_PROC_KCORE=y +CONFIG_TMPFS=y +CONFIG_MINIX_FS=y +CONFIG_NLS_CODEPAGE_932=y +CONFIG_INIT_STACK_NONE=y +CONFIG_CRC_T10DIF=y +CONFIG_DEBUG_INFO_DWARF5=y +CONFIG_DEBUG_FS=y +CONFIG_DEBUG_MEMORY_INIT=y +# CONFIG_FTRACE is not set
arch/sh/configs/rts7751r2dplus-of_defconfig new file +159 -0
159 lines not on this page · raw message
Signature · 1 line
2.39.2