Device Tree support for SH7751 based board
Subsystems (13)
Yoshinori Sato
maintainerv7 cover 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.
You can get it working with qemu found here.
https://gitlab.com/yoshinori.sato/qemu/-/tree/landisk
v7 changes.
- sh/kernel/setup.c: fix kernel parameter handling.
- clk-sh7750.c: cleanup.
- sh_tmu.c: cleanup.
- irq-renesas-sh7751.c: IPR definition move to code.
- irq-renesas-sh7751irl.c: update register definition.
- pci-sh7751.c: Register initialization fix.
- sm501 and sm501fb: Re-design Device Tree properties.
v6 changes.
- pci-sh7751: merge register define.
- pci-sh7751: use 'dma-ranges' property.
- pci-sh7751: rename general PCI properties.
- sm501 and sm501fb: Re-design Device Tree properties.
- sh/kernel/setup: cleanup command line setup.
- irq-sh7751.c: some cleanup.
v5 changes.
- pci-sh7751: revert header changes. and some fix in previuous driver.
- sh/kernel/iomap.c: Use SH io functions.
- sm501 and sm501fb: re-write DT support.
v4 changes.
- cpg-sh7750: use clk-divider and clk-gate.
- pci-sh7751: unified header files to old PCI driver.
- irq-renesas-sh7751: IPR registers direct mapping.
- irq-renesas-sh7751irl: useful register bit mapping.
- sm501 and sm501fb: re-write dt parser.
- j2_minus: fix build error.
- dt-binding schema: fix some errors.
- *.dts: cleanup.
v3 changes.
- Rewrite clk drivers.
- Added sh_tmu to OF support.
- Cleanup PCI stuff.
- Update sm501 and sm501fb OF support.
- Update devicetree and documents.
v2 changes.
- Rebasing v6,6-rc1
- re-write irqchip driver.
- Add binding documents.
- Cleanup review comment.
Yoshinori Sato (37):
sh: passing FDT address to kernel startup.
sh: Kconfig unified OF supported targets.
sh: Enable OF support for build and configuration.
dt-bindings: interrupt-controller: Add header for Renesas SH3/4 INTC.
sh: GENERIC_IRQ_CHIP support for CONFIG_OF=y
sh: kernel/setup Update DT support.
sh: Fix COMMON_CLK support in CONFIG_OF=y.
clocksource: sh_tmu: CLOCKSOURCE support.
dt-binding: Add compatible SH7750 SoC
sh: Common PCI Framework driver support.
pci: pci-sh7751: Add SH7751 PCI driver
dt-bindings: pci: pci-sh7751: Add SH7751 PCI
dt-bindings: clock: sh7750-cpg: Add renesas,sh7750-cpg header.
clk: Compatible with narrow registers
clk: renesas: Add SH7750/7751 CPG Driver
irqchip: Add SH7751 INTC driver
dt-bindings: interrupt-controller: renesas,sh7751-intc: Add
json-schema
irqchip: SH7751 external interrupt encoder with enable gate.
dt-bindings: interrupt-controller: renesas,sh7751-irl-ext: Add
json-schema
serial: sh-sci: fix SH4 OF support.
dt-bindings: serial: renesas,scif: Add scif-sh7751.
dt-bindings: display: smi,sm501: SMI SM501 binding json-schema
dt-bindings: display: sm501 register definition helper
mfd: sm501: Convert platform_data to OF property
dt-binding: sh: cpus: Add SH CPUs json-schema
dt-bindings: vendor-prefixes: Add iodata
dt-bindings: ata: ata-generic: Add new targets
dt-bindings: soc: renesas: sh: Add SH7751 based target
sh: SH7751R SoC Internal peripheral definition dtsi.
sh: add RTS7751R2D Plus DTS
sh: Add IO DATA LANDISK dts
sh: Add IO DATA USL-5P dts
sh: j2_mimas_v2.dts update
sh: Add dtbs target support.
sh: RTS7751R2D Plus OF defconfig
sh: LANDISK OF defconfig
sh: j2_defconfig: update
.../devicetree/bindings/ata/ata-generic.yaml | 2 + .../bindings/clock/renesas,sh7750-cpg.yaml | 105 ++++ .../bindings/display/smi,sm501.yaml | 398 +++++++++++++++ .../renesas,sh7751-intc.yaml | 53 ++ .../renesas,sh7751-irl-ext.yaml | 57 +++ .../bindings/pci/renesas,sh7751-pci.yaml | 89 ++++ .../bindings/serial/renesas,scif.yaml | 1 + .../devicetree/bindings/sh/cpus.yaml | 63 +++ .../devicetree/bindings/soc/renesas/sh.yaml | 27 + .../bindings/timer/renesas,tmu.yaml | 2 + .../devicetree/bindings/vendor-prefixes.yaml | 2 + arch/sh/Kconfig | 33 +- arch/sh/boards/Kconfig | 23 +- arch/sh/boards/of-generic.c | 28 +- arch/sh/boot/compressed/head_32.S | 5 +- arch/sh/boot/dts/Makefile | 5 + arch/sh/boot/dts/j2_mimas_v2.dts | 2 +- arch/sh/boot/dts/landisk.dts | 77 +++ arch/sh/boot/dts/rts7751r2dplus.dts | 169 ++++++ arch/sh/boot/dts/sh7751r.dtsi | 105 ++++ arch/sh/boot/dts/usl-5p.dts | 85 ++++ arch/sh/configs/j2_defconfig | 11 +- arch/sh/configs/landisk-of_defconfig | 104 ++++ arch/sh/configs/rts7751r2dplus-of_defconfig | 75 +++ arch/sh/drivers/Makefile | 2 + arch/sh/include/asm/io.h | 8 + arch/sh/include/asm/irq.h | 10 +- arch/sh/include/asm/pci.h | 4 + arch/sh/include/asm/setup.h | 1 + arch/sh/kernel/cpu/Makefile | 6 +- arch/sh/kernel/cpu/irq/imask.c | 17 + arch/sh/kernel/cpu/sh4/Makefile | 3 + arch/sh/kernel/iomap.c | 18 + arch/sh/kernel/setup.c | 36 +- arch/sh/kernel/time.c | 12 + drivers/clk/clk-divider.c | 56 +- drivers/clk/clk-gate.c | 62 ++- drivers/clk/renesas/Kconfig | 13 +- drivers/clk/renesas/Makefile | 1 + drivers/clk/renesas/clk-sh7750.c | 480 ++++++++++++++++++ drivers/clocksource/sh_tmu.c | 198 +++++--- drivers/irqchip/Kconfig | 15 + drivers/irqchip/Makefile | 3 + drivers/irqchip/irq-renesas-sh7751.c | 282 ++++++++++ drivers/irqchip/irq-renesas-sh7751irl.c | 221 ++++++++ drivers/mfd/sm501.c | 315 ++++++++++++ drivers/pci/controller/Kconfig | 9 + drivers/pci/controller/Makefile | 1 + drivers/pci/controller/pci-sh7751.c | 342 +++++++++++++ drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/sh-sci.c | 6 +- drivers/video/fbdev/sm501fb.c | 106 ++++ include/dt-bindings/clock/sh7750-cpg.h | 26 + include/dt-bindings/display/sm501.h | 76 +++ .../renesas,sh7751-intc.h | 19 + include/linux/clk-provider.h | 22 +- include/linux/sh_intc.h | 7 +- 57 files changed, 3713 insertions(+), 187 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/renesas,sh7750-cpg.yaml create mode 100644 Documentation/devicetree/bindings/display/smi,sm501.yaml create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,sh7751-intc.yaml create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,sh7751-irl-ext.yaml create mode 100644 Documentation/devicetree/bindings/pci/renesas,sh7751-pci.yaml create mode 100644 Documentation/devicetree/bindings/sh/cpus.yaml create mode 100644 Documentation/devicetree/bindings/soc/renesas/sh.yaml 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/sh7751r.dtsi 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/renesas/clk-sh7750.c create mode 100644 drivers/irqchip/irq-renesas-sh7751.c create mode 100644 drivers/irqchip/irq-renesas-sh7751irl.c create mode 100644 drivers/pci/controller/pci-sh7751.c create mode 100644 include/dt-bindings/clock/sh7750-cpg.h create mode 100644 include/dt-bindings/display/sm501.h create mode 100644 include/dt-bindings/interrupt-controller/renesas,sh7751-intc.h
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 1/37 sh: passing FDT address to kernel startup.
R4 is caller saved in SH ABI.
Save it so it doesn't get corrupted until it's needed for initialization.
--- arch/sh/boot/compressed/head_32.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
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:
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 2/37 sh: Kconfig unified OF supported targets.
In reply to Yoshinori SatoTargets that support OF should be treated as one board.
--- arch/sh/Kconfig | 1 + arch/sh/boards/Kconfig | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-)
arch/sh/Kconfig +1 -0
@@ -711,6 +711,7 @@ choice prompt "Kernel command line" optional default CMDLINE_OVERWRITE + depends on !OF || USE_BUILTIN_DTB help Setting this option allows the kernel command line arguments to be set.
arch/sh/boards/Kconfig +13 -10
@@ -19,16 +19,9 @@ config SH_DEVICE_TREE select TIMER_OF select COMMON_CLK select GENERIC_CALIBRATE_DELAY - -config SH_JCORE_SOC - bool "J-Core SoC" - select SH_DEVICE_TREE - select CLKSRC_JCORE_PIT - select JCORE_AIC - depends on CPU_J2 - help - Select this option to include drivers core components of the - J-Core SoC, including interrupt controllers and timers. + select GENERIC_IRQ_CHIP + select SYS_SUPPORTS_PCI + select GENERIC_PCI_IOMAP if PCI config SH_SOLUTION_ENGINE bool "SolutionEngine"
@@ -293,6 +286,7 @@ 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.
@@ -369,6 +363,15 @@ config SH_APSH4AD0A help Select AP-SH4AD-0A if configuring for an ALPHAPROJECT AP-SH4AD-0A. +config SH_OF_BOARD + bool "General Open Firmware boards" + select SH_DEVICE_TREE + select CLKSRC_JCORE_PIT if CPU_J2 + select JCORE_AIC if CPU_J2 + select HAVE_PCI if CPU_SUBTYPE_SH7751R + help + This board means general OF supported targets. + source "arch/sh/boards/mach-r2d/Kconfig" source "arch/sh/boards/mach-highlander/Kconfig" source "arch/sh/boards/mach-sdk7780/Kconfig"
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 3/37 sh: Enable OF support for build and configuration.
In reply to Yoshinori SatoIRQ, CLK and PCI will be migrated to a common driver framework. So if OF, disable the SH specific drivers.
--- arch/sh/Kconfig | 11 ++++++----- arch/sh/drivers/Makefile | 2 ++ arch/sh/kernel/cpu/Makefile | 9 +++++++-- arch/sh/kernel/cpu/sh4/Makefile | 3 +++ 4 files changed, 18 insertions(+), 7 deletions(-)
arch/sh/Kconfig +6 -5
@@ -66,10 +66,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
@@ -153,7 +153,7 @@ menu "System type" # config CPU_SH2 bool - select SH_INTC + select SH_INTC if !SH_DEVICE_TREE config CPU_SH2A bool
@@ -179,7 +179,7 @@ config CPU_SH4 select CPU_HAS_INTEVT select CPU_HAS_SR_RB select CPU_HAS_FPU if !CPU_SH4AL_DSP - select SH_INTC + select SH_INTC if !SH_DEVICE_TREE select SYS_SUPPORTS_SH_TMU config CPU_SH4A
@@ -522,6 +522,7 @@ config SH_PCLK_FREQ config SH_CLK_CPG def_bool y + depends on !COMMON_CLK config SH_CLK_CPG_LEGACY depends on SH_CLK_CPG
@@ -666,7 +667,7 @@ config BUILTIN_DTB_SOURCE kernel. config ZERO_PAGE_OFFSET - hex + hex "Zero page offset" default "0x00010000" if PAGE_SIZE_64KB || SH_RTS7751R2D || \ SH_7751_SOLUTION_ENGINE default "0x00004000" if PAGE_SIZE_16KB || SH_SH03
arch/sh/drivers/Makefile +2 -0
@@ -5,6 +5,8 @@ obj-y += dma/ platform_early.o +ifndef CONFIG_SH_DEVICE_TREE obj-$(CONFIG_PCI) += pci/ +endif obj-$(CONFIG_PUSH_SWITCH) += push-switch.o obj-$(CONFIG_HEARTBEAT) += heartbeat.o
arch/sh/kernel/cpu/Makefile +7 -2
@@ -16,6 +16,11 @@ obj-$(CONFIG_ARCH_SHMOBILE) += shmobile/ # Common interfaces. obj-$(CONFIG_SH_ADC) += adc.o +ifndef CONFIG_COMMON_CLK +obj-y += clock.o 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 fpu.o pfc.o proc.o
arch/sh/kernel/cpu/sh4/Makefile +3 -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_SH_DEVICE_TREE # CPU subtype setup obj-$(CONFIG_CPU_SUBTYPE_SH7750) += setup-sh7750.o obj-$(CONFIG_CPU_SUBTYPE_SH7750R) += setup-sh7750.o
@@ -29,5 +30,7 @@ ifndef CONFIG_CPU_SH4A clock-$(CONFIG_CPU_SH4) := clock-sh4.o endif +endif # CONFIG_SH_DEVICE_TREE + obj-y += $(clock-y) obj-$(CONFIG_PERF_EVENTS) += $(perf-y)
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 4/37 dt-bindings: interrupt-controller: Add header for Renesas SH3/4 INTC.
In reply to Yoshinori SatoRenesas SH7751 Interrupt controller priority register define.
--- .../renesas,sh7751-intc.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 include/dt-bindings/interrupt-controller/renesas,sh7751-intc.h
include/dt-bindings/interrupt-controller/renesas,sh7751-intc.h new file +19 -0
@@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +* +* SH3/4 INTC IPR register offsets (Address / bits) +*/ + +#ifndef __DT_BINDINGS_RENESAS_SH7751_INTC +#define __DT_BINDINGS_RENESAS_SH7751_INTC + +#define IPRA 0 +#define IPRB 4 +#define IPRC 8 +#define IPRD 12 +#define INTPRI00 256 +#define IPR_B12 12 +#define IPR_B8 8 +#define IPR_B4 4 +#define IPR_B0 0 + +#endif
Signature · 1 line
2.39.2
Re: [PATCH v7 04/37] dt-bindings: interrupt-controller: Add header for Renesas SH3/4 INTC.
Quoted 3 lines · Yoshinori Sato
Renesas SH7751 Interrupt controller priority register define.
Signed-off-by Yoshinori Sato <[email protected]>
Nothing improved, still NAK.
This is a friendly reminder during the review process.
It seems my or other reviewer's previous comments were not fully addressed. Maybe the feedback got lost between the quotes, maybe you just forgot to apply it. Please go back to the previous discussion and either implement all requested changes or keep discussing them.
Thank you.
Best regards,
Krzysztof
Yoshinori Sato
maintainerPATCH v7 5/37 sh: GENERIC_IRQ_CHIP support for CONFIG_OF=y
In reply to Yoshinori SatoRemove unused function prototype.
Add helper update_sr_imask. use for SH7751 irq driver. Add stub intc_finalize.
--- arch/sh/include/asm/io.h | 2 ++ arch/sh/include/asm/irq.h | 10 ++++++++-- arch/sh/kernel/cpu/Makefile | 5 +---- arch/sh/kernel/cpu/irq/imask.c | 17 +++++++++++++++++ include/linux/sh_intc.h | 7 ++++++- 5 files changed, 34 insertions(+), 7 deletions(-)
arch/sh/include/asm/io.h +2 -0
@@ -121,7 +121,9 @@ __BUILD_MEMORY_STRING(__raw_, q, u64)#define ioport_map ioport_map#define ioport_unmap ioport_unmap +#ifndef CONFIG_SH_DEVICE_TREE #define pci_iounmap pci_iounmap +#endif #define ioread8 ioread8#define ioread16 ioread16
arch/sh/include/asm/irq.h +8 -2
@@ -16,8 +16,8 @@/* * Simple Mask Register Support */ -extern void make_maskreg_irq (unsigned int irq); -extern unsigned short *irq_mask_register; + +void update_sr_imask (unsigned int irq,bool enable);/* * PINT IRQs
@@ -54,4 +54,10 @@ extern void irq_finish(unsigned int irq);#include <asm-generic/irq.h> +/* SH3/4 INTC stuff */ +/* IRL level 0 - 15 */ +#define NR_IRL 15 +/* IRL0 -> IRQ16 */ +#define IRL_BASE_IRQ 16 +#endif /* __ASM_SH_IRQ_H */
arch/sh/kernel/cpu/Makefile +1 -4
@@ -20,7 +20,4 @@ ifndef CONFIG_COMMON_CLK obj-y += clock.o obj-$(CONFIG_SH_CLK_CPG_LEGACY) += clock-cpg.o endif -ifndef CONFIG_GENERIC_IRQ_CHIP -obj-y += irq/ -endif -obj-y += init.o fpu.o pfc.o proc.o +obj-y += init.o fpu.o pfc.o proc.o irq/
arch/sh/kernel/cpu/irq/imask.c +17 -0
@@ -51,6 +51,7 @@ static inline void set_interrupt_registers(int ip) : "t"); } +#ifndef CONFIG_GENERIC_IRQ_CHIP static void mask_imask_irq (struct irq_data *data) {unsigned int irq = data->irq;
@@ -83,3 +84,19 @@ void make_imask_irq(unsigned int irq)irq_set_chip_and_handler_name (irq, &imask_irq_chip, handle_level_irq, "level"); } +#else +void update_sr_imask (unsigned int irq,bool enable) +{ +if (enable) { +set_bit (irq, imask_mask); + interrupt_priority =IMASK_PRIORITY - +find_first_bit (imask_mask,IMASK_PRIORITY ); + }else { +clear_bit (irq, imask_mask); +if (interrupt_priority <IMASK_PRIORITY - irq) + interrupt_priority =IMASK_PRIORITY - irq; + } +set_interrupt_registers (interrupt_priority); +} +EXPORT_SYMBOL (update_sr_imask); +#endif
include/linux/sh_intc.h +6 -1
@@ -139,8 +139,13 @@ struct intc_desc symbol __initdata = { \int register_intc_controller (struct intc_desc *desc);int intc_set_priority (unsigned int irq,unsigned int prio);int intc_irq_lookup (const char *chipname,intc_enum enum_id); +#ifndef CONFIG_SH_DEVICE_TREE void intc_finalize (void ); - +#else +static inline void intc_finalize (void ) +{ +} +#endif #ifdef CONFIG_INTC_USERIMASK int register_intc_userimask (unsigned long addr);#else
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 6/37 sh: kernel/setup Update DT support.
In reply to Yoshinori SatoFix extrnal fdt initialize and bootargs.
--- arch/sh/Kconfig | 23 +++++++++++------------ arch/sh/include/asm/setup.h | 1 + arch/sh/kernel/setup.c | 36 +++++++++++++++++++++++------------- 3 files changed, 35 insertions(+), 25 deletions(-)
arch/sh/Kconfig +11 -12
@@ -708,17 +708,22 @@ config ROMIMAGE_MMCIF first part of the romImage which in turn loads the rest the kernel image to RAM using the MMCIF hardware block. +config CMDLINE + string "Kernel command line arguments string" + default "console=ttySC1,115200" + choice prompt "Kernel command line" - optional - default CMDLINE_OVERWRITE - depends on !OF || USE_BUILTIN_DTB + default CMDLINE_BOOTLOADER + +config CMDLINE_BOOTLOADER + bool "Use bootloader kernel arguments" help - Setting this option allows the kernel command line arguments - to be set. + Uses the command-line options passed by the boot loader. + If boot loader dosen't provide kernel argments, Use built-in argments. config CMDLINE_OVERWRITE - bool "Overwrite bootloader kernel arguments" + bool "Overwrite built-in kernel arguments" help Given string will overwrite any arguments passed in by a bootloader.
@@ -730,12 +735,6 @@ config CMDLINE_EXTEND by a bootloader. endchoice - -config CMDLINE - string "Kernel command line arguments string" - depends on CMDLINE_OVERWRITE || CMDLINE_EXTEND - default "console=ttySC1,115200" - endmenu menu "Bus options"
arch/sh/include/asm/setup.h +1 -0
@@ -21,5 +21,6 @@void sh_mv_setup (void );void check_for_initrd (void );void per_cpu_trap_init (void ); +void sh_fdt_init (phys_addr_t dt_phys);#endif /* _SH_SETUP_H */
arch/sh/kernel/setup.c +23 -13
@@ -30,6 +30,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>
@@ -269,8 +270,22 @@ void __ref sh_fdt_init(phys_addr_t dt_phys)void __init setup_arch (char **cmdline_p) { +#if defined(CONFIG_OF ) && defined(CONFIG_OF_EARLY_FLATTREE ) +if (IS_ENABLED (CONFIG_USE_BUILTIN_DTB )) { +/* Relocate Embedded DTB */ +unflatten_and_copy_device_tree (); + }else if (initial_boot_params) { +/* Reserve external DTB area */ +memblock_reserve (__pa (initial_boot_params), +fdt_totalsize (initial_boot_params)); +unflatten_device_tree (); + } +/* copy from /chosen/bootargs */ +strscpy (command_line, boot_command_line,COMMAND_LINE_SIZE ); +#endif enable_mmu (); +#ifndef CONFIG_OF ROOT_DEV =old_decode_dev (ORIG_ROOT_DEV ); printk(KERN_NOTICE "Boot params:\n"
@@ -299,14 +314,17 @@ void __init setup_arch(char **cmdline_p) bss_resource.start =virt_to_phys (__bss_start); bss_resource.end =virt_to_phys (__bss_stop)-1 ; -#ifdef CONFIG_CMDLINE_OVERWRITE -strscpy (command_line,CONFIG_CMDLINE ,sizeof (command_line)); -#else -strscpy (command_line,COMMAND_LINE ,sizeof (command_line)); +#endif +#if !defined(CONFIG_OF ) || defined(CONFIG_USE_BUILTIN_DTB ) +if (*COMMAND_LINE ) +strscpy (command_line,COMMAND_LINE ,sizeof (command_line)); +#endif +if (*command_line =='\0' ||IS_ENABLED (CONFIG_CMDLINE_OVERWRITE )) +/* Use built-in parameter */ +strscpy (command_line,CONFIG_CMDLINE ,sizeof (command_line));#ifdef CONFIG_CMDLINE_EXTEND strlcat (command_line," " ,sizeof (command_line));strlcat (command_line,CONFIG_CMDLINE ,sizeof (command_line)); -#endif #endif /* Save unparsed command line copy for /proc/cmdline */
@@ -322,14 +340,6 @@ void __init setup_arch(char **cmdline_p)/* Let earlyprintk output early console messages */ sh_early_platform_driver_probe ("earlyprintk" ,1 ,1 ); -#ifdef CONFIG_OF_EARLY_FLATTREE -#ifdef CONFIG_USE_BUILTIN_DTB -unflatten_and_copy_device_tree (); -#else -unflatten_device_tree (); -#endif -#endif -paging_init ();/* Perform the machine specific initialisation */
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 7/37 sh: Fix COMMON_CLK support in CONFIG_OF=y.
In reply to Yoshinori SatoInitialize the clock and timer using the COMMON_CLK procedure. sh's earlytimer mechanism doesn't work properly in OF, so timer initialization is delayed.
If CONFIG_OF=y, perform the general timer initialization procedure.
--- arch/sh/boards/of-generic.c | 28 ++++------------------------ arch/sh/kernel/time.c | 12 ++++++++++++ 2 files changed, 16 insertions(+), 24 deletions(-)
arch/sh/boards/of-generic.c +4 -24
@@ -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>
@@ -98,16 +99,7 @@ static void sh_of_smp_probe(void)#endif -static void noop (void ) -{ -} - -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 ();
@@ -140,25 +132,13 @@ static void __init sh_of_init_irq(void)irqchip_init (); } -static int __init sh_of_clk_init (void ) -{ -#ifdef CONFIG_COMMON_CLK -/* Disabled pending move to COMMON_CLK framework. */ -pr_info ("SH generic board support: scanning for clk providers\n" ); -of_clk_init (NULL ); -#endif -return 0 ; -} - static struct sh_machine_vector __initmv sh_of_generic_mv = { .mv_setup = sh_of_setup, .mv_name ="devicetree" ,/* replaced by DT root's model */ .mv_irq_demux = sh_of_irq_demux, .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_mode_pins = generic_mode_pins, + .mv_mem_init = sh_of_mem_init, };struct sh_clk_ops ;
arch/sh/kernel/time.c +12 -0
@@ -19,7 +19,9 @@#include <asm/clock.h> #include <asm/rtc.h> #include <asm/platform_early.h> +#include <linux/of_clk.h> +#ifndef CONFIG_SH_DEVICE_TREE static void __init sh_late_time_init (void ) {/*
@@ -43,3 +45,13 @@ void __init time_init(void) late_time_init = sh_late_time_init; } +#else +/* CONFIG_SH_DEVICE_TREE */ +void __init time_init (void ) +{ +pr_info ("SH generic board support: scanning for clk providers\n" ); + +of_clk_init (NULL ); +timer_probe (); +} +#endif
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 8/37 clocksource: sh_tmu: CLOCKSOURCE support.
In reply to Yoshinori SatoAllows initialization as CLOCKSOURCE.
--- drivers/clocksource/sh_tmu.c | 198 ++++++++++++++++++++++++----------- 1 file changed, 134 insertions(+), 64 deletions(-)
drivers/clocksource/sh_tmu.c +134 -64
@@ -17,6 +17,8 @@#include <linux/irq.h> #include <linux/module.h> #include <linux/of.h> +#include <linux/of_address.h> +#include <linux/of_irq.h> #include <linux/platform_device.h> #include <linux/pm_domain.h> #include <linux/pm_runtime.h>
@@ -51,6 +53,7 @@ struct sh_tmu_channel {struct sh_tmu_device {struct platform_device *pdev; +struct device_node *np;void __iomem *mapbase;struct clk *clk;
@@ -65,6 +68,7 @@ struct sh_tmu_device {bool has_clockevent;bool has_clocksource; +const char *name; };#define TSTR -1/* shared register */
@@ -148,8 +152,8 @@ static int __sh_tmu_enable(struct sh_tmu_channel *ch)/* enable clock */ ret =clk_enable (ch->tmu->clk);if (ret) { -dev_err (&ch->tmu->pdev->dev,"ch%u: cannot enable clock\n" , - ch->index); +pr_err ("%s ch%u: cannot enable clock\n" , + ch->tmu->name, ch->index);return ret; }
@@ -174,9 +178,10 @@ static int sh_tmu_enable(struct sh_tmu_channel *ch)if (ch->enable_count++ >0 )return 0 ; -pm_runtime_get_sync (&ch->tmu->pdev->dev); -dev_pm_syscore_device (&ch->tmu->pdev->dev, true); - +if (ch->tmu->pdev) { +pm_runtime_get_sync (&ch->tmu->pdev->dev); +dev_pm_syscore_device (&ch->tmu->pdev->dev, true); + }return __sh_tmu_enable (ch); }
@@ -202,8 +207,10 @@ static void sh_tmu_disable(struct sh_tmu_channel *ch)__sh_tmu_disable (ch); -dev_pm_syscore_device (&ch->tmu->pdev->dev, false); -pm_runtime_put (&ch->tmu->pdev->dev); +if (ch->tmu->pdev) { +dev_pm_syscore_device (&ch->tmu->pdev->dev, false); +pm_runtime_put (&ch->tmu->pdev->dev); + } } static void sh_tmu_set_next(struct sh_tmu_channel *ch, unsigned long delta,
@@ -245,7 +252,7 @@ static irqreturn_t sh_tmu_interrupt(int irq, void *dev_id)return IRQ_HANDLED ; } -static struct sh_tmu_channel *cs_to_sh_tmu (struct clocksource *cs) +static inline struct sh_tmu_channel *cs_to_sh_tmu (struct clocksource *cs) { return container_of(cs, struct sh_tmu_channel, cs); }
@@ -292,7 +299,8 @@ static void sh_tmu_clocksource_suspend(struct clocksource *cs)if (--ch->enable_count ==0 ) {__sh_tmu_disable (ch); -dev_pm_genpd_suspend (&ch->tmu->pdev->dev); +if (ch->tmu->pdev) +dev_pm_genpd_suspend (&ch->tmu->pdev->dev); } }
@@ -304,7 +312,8 @@ static void sh_tmu_clocksource_resume(struct clocksource *cs)return ;if (ch->enable_count++ ==0 ) { -dev_pm_genpd_resume (&ch->tmu->pdev->dev); +if (ch->tmu->pdev) +dev_pm_genpd_resume (&ch->tmu->pdev->dev);__sh_tmu_enable (ch); } }
@@ -324,14 +333,14 @@ static int sh_tmu_register_clocksource(struct sh_tmu_channel *ch, cs->mask =CLOCKSOURCE_MASK (32 ); cs->flags =CLOCK_SOURCE_IS_CONTINUOUS ; -dev_info (&ch->tmu->pdev->dev,"ch%u: used as clock source\n" , - ch->index); +pr_info ("%s ch%u: used as clock source\n" , + ch->tmu->name, ch->index);clocksource_register_hz (cs, ch->tmu->rate);return 0 ; } -static struct sh_tmu_channel *ced_to_sh_tmu (struct clock_event_device *ced) +static inline struct sh_tmu_channel *ced_to_sh_tmu (struct clock_event_device *ced) { return container_of(ced, struct sh_tmu_channel, ced); }
@@ -364,8 +373,8 @@ static int sh_tmu_clock_event_set_state(struct clock_event_device *ced,if (clockevent_state_oneshot (ced) ||clockevent_state_periodic (ced))sh_tmu_disable (ch); -dev_info (&ch->tmu->pdev->dev,"ch%u: used for %s clock events\n" , - ch->index, periodic ?"periodic" :"oneshot" ); +pr_info ("%s ch%u: used for %s clock events\n" , + ch->tmu->name, ch->index, periodic ?"periodic" :"oneshot" );sh_tmu_clock_event_start (ch, periodic);return 0 ; }
@@ -417,20 +426,22 @@ static void sh_tmu_register_clockevent(struct sh_tmu_channel *ch, ced->set_state_shutdown = sh_tmu_clock_event_shutdown; ced->set_state_periodic = sh_tmu_clock_event_set_periodic; ced->set_state_oneshot = sh_tmu_clock_event_set_oneshot; - ced->suspend = sh_tmu_clock_event_suspend; - ced->resume = sh_tmu_clock_event_resume; +if (ch->tmu->pdev) { + 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); +pr_info ("%s ch%u: used for clock events\n" , + ch->tmu->name, ch->index);clockevents_config_and_register (ced, ch->tmu->rate,0x300 ,0xffffffff ); ret =request_irq (ch->irq, sh_tmu_interrupt,IRQF_TIMER |IRQF_IRQPOLL |IRQF_NOBALANCING , -dev_name (&ch->tmu->pdev->dev), ch); + ch->tmu->name, ch);if (ret) { -dev_err (&ch->tmu->pdev->dev,"ch%u: failed to request irq %d\n" , - ch->index, ch->irq); +pr_err ("%s ch%u: failed to request irq %d\n" , + ch->tmu->name, ch->index, ch->irq);return ; } }
@@ -465,28 +476,36 @@ static int sh_tmu_channel_setup(struct sh_tmu_channel *ch, unsigned int index,else ch->base = tmu->mapbase +8 + ch->index *12 ; - ch->irq =platform_get_irq (tmu->pdev, index); +if (tmu->pdev) + ch->irq =platform_get_irq (tmu->pdev, index); +if (tmu->np) + ch->irq =of_irq_get (tmu->np, index); +if (ch->irq <0 )return ch->irq; ch->cs_enabled = false; ch->enable_count =0 ; -return sh_tmu_register (ch,dev_name (&tmu->pdev->dev), - clockevent, clocksource); +return sh_tmu_register (ch, tmu->name, clockevent, clocksource); }static int sh_tmu_map_memory (struct sh_tmu_device *tmu) {struct resource *res; - res =platform_get_resource (tmu->pdev,IORESOURCE_MEM ,0 ); -if (!res) { -dev_err (&tmu->pdev->dev,"failed to get I/O memory\n" ); -return -ENXIO ; +if (tmu->pdev) { + res =platform_get_resource (tmu->pdev,IORESOURCE_MEM ,0 ); +if (!res) { +pr_err ("sh_tmu failed to get I/O memory\n" ); +return -ENXIO ; + } + + tmu->mapbase =ioremap (res->start,resource_size (res)); } +if (tmu->np) + tmu->mapbase =of_iomap (tmu->np,0 ); - tmu->mapbase =ioremap (res->start,resource_size (res));if (tmu->mapbase ==NULL )return -ENXIO ;
@@ -495,7 +514,12 @@ static int sh_tmu_map_memory(struct sh_tmu_device *tmu)static int sh_tmu_parse_dt (struct sh_tmu_device *tmu) { -struct device_node *np = tmu->pdev->dev.of_node; +struct device_node *np; + +if (tmu->pdev) + np = tmu->pdev->dev.of_node; +if (tmu->np) + np = tmu->np; tmu->model =SH_TMU ; tmu->num_channels =3 ;
@@ -503,45 +527,19 @@ static int sh_tmu_parse_dt(struct sh_tmu_device *tmu)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); +pr_err ("%s: invalid number of channels %u\n" , + tmu->name, tmu->num_channels);return -EINVAL ; }return 0 ; } -static int sh_tmu_setup (struct sh_tmu_device *tmu,struct platform_device *pdev) +static int sh_tmu_setup (struct sh_tmu_device *tmu) {unsigned int i;int ret; - tmu->pdev = pdev; - -raw_spin_lock_init (&tmu->lock); - -if (IS_ENABLED (CONFIG_OF ) && pdev->dev.of_node) { - ret =sh_tmu_parse_dt (tmu); -if (ret <0 ) -return ret; - }else if (pdev->dev.platform_data) { -const struct platform_device_id *id = pdev->id_entry; -struct sh_timer_config *cfg = pdev->dev.platform_data; - - tmu->model = id->driver_data; - tmu->num_channels =hweight8 (cfg->channels_mask); - }else { -dev_err (&tmu->pdev->dev,"missing platform data\n" ); -return -ENXIO ; - } - -/* Get hold of clock. */ - tmu->clk =clk_get (&tmu->pdev->dev,"fck" ); -if (IS_ERR (tmu->clk)) { -dev_err (&tmu->pdev->dev,"cannot get clock\n" ); -return PTR_ERR (tmu->clk); - } - ret =clk_prepare (tmu->clk);if (ret <0 ) goto err_clk_put;
@@ -557,7 +555,7 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev)/* Map the memory resource. */ ret =sh_tmu_map_memory (tmu);if (ret <0 ) { -dev_err (&tmu->pdev->dev,"failed to remap I/O memory\n" ); +pr_err ("%s: failed to remap I/O memory\n" , tmu->name); goto err_clk_unprepare; }
@@ -580,8 +578,6 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev) goto err_unmap; } -platform_set_drvdata (pdev, tmu); -return 0 ; err_unmap:
@@ -594,6 +590,39 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev)return ret; } +static int sh_tmu_setup_pdev (struct sh_tmu_device *tmu,struct platform_device *pdev) +{ +int ret; + + tmu->pdev = pdev; + +raw_spin_lock_init (&tmu->lock); + +if (IS_ENABLED (CONFIG_OF ) && pdev->dev.of_node) { + ret =sh_tmu_parse_dt (tmu); +if (ret <0 ) +return ret; + }else if (pdev->dev.platform_data) { +const struct platform_device_id *id = pdev->id_entry; +struct sh_timer_config *cfg = pdev->dev.platform_data; + + tmu->model = id->driver_data; + tmu->num_channels =hweight8 (cfg->channels_mask); + }else { +dev_err (&tmu->pdev->dev,"missing platform data\n" ); +return -ENXIO ; + } + + tmu->name =dev_name (&pdev->dev); + tmu->clk =clk_get (&tmu->pdev->dev,"fck" ); +if (IS_ERR (tmu->clk)) { +dev_err (&tmu->pdev->dev,"cannot get clock\n" ); +return PTR_ERR (tmu->clk); + } + +return sh_tmu_setup (tmu); +} +static int sh_tmu_probe (struct platform_device *pdev) {struct sh_tmu_device *tmu =platform_get_drvdata (pdev);
@@ -613,12 +642,13 @@ static int sh_tmu_probe(struct platform_device *pdev)if (tmu ==NULL )return -ENOMEM ; - ret =sh_tmu_setup (tmu, pdev); + ret =sh_tmu_setup_pdev (tmu, pdev);if (ret) {kfree (tmu);pm_runtime_idle (&pdev->dev);return ret; } +platform_set_drvdata (pdev, tmu);if (is_sh_early_platform_device (pdev))return 0 ;
@@ -632,6 +662,45 @@ static int sh_tmu_probe(struct platform_device *pdev)return 0 ; } +static int sh_tmu_setup_of (struct sh_tmu_device *tmu,struct device_node *np) +{ +int ret; + + tmu->np = np; +raw_spin_lock_init (&tmu->lock); + + ret =sh_tmu_parse_dt (tmu); +if (ret <0 ) +return ret; + + tmu->clk =of_clk_get (np,0 ); + tmu->name =of_node_full_name (np); + +if (IS_ERR (tmu->clk)) { +pr_err ("%pOF: cannot get clock\n" , np); +return PTR_ERR (tmu->clk); + } + +return sh_tmu_setup (tmu); +} + +static int __init sh_tmu_of_register (struct device_node *np) +{ +struct sh_tmu_device *tmu; +int ret; + + tmu =kzalloc (sizeof (*tmu),GFP_KERNEL ); +if (tmu ==NULL ) +return -ENOMEM ; + + ret =sh_tmu_setup_of (tmu, np); +if (ret) { +kfree (tmu); +pr_warn ("%pOF: Timer register failed (%d)" , np, ret); + } +return ret; +} +static const struct platform_device_id sh_tmu_id_table[] = { {"sh-tmu" ,SH_TMU }, {"sh-tmu-sh3" ,SH_TMU_SH3 },
@@ -665,6 +734,7 @@ static void __exit sh_tmu_exit(void)platform_driver_unregister (&sh_tmu_device_driver); } +TIMER_OF_DECLARE (sh_tmu,"renesas,tmu" , sh_tmu_of_register);#ifdef CONFIG_SUPERH sh_early_platform_init ("earlytimer" , &sh_tmu_device_driver);#endif
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 9/37 dt-binding: Add compatible SH7750 SoC
In reply to Yoshinori Sato--- Documentation/devicetree/bindings/timer/renesas,tmu.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/timer/renesas,tmu.yaml +2 -0
@@ -39,6 +39,7 @@ properties: - renesas,tmu-r8a779a0 # R-Car V3U - renesas,tmu-r8a779f0 # R-Car S4-8 - renesas,tmu-r8a779g0 # R-Car V4H + - renesas,tmu-sh7750 # SH7750 - const: renesas,tmu reg:
@@ -96,6 +97,7 @@ if: - renesas,tmu-r8a7740 - renesas,tmu-r8a7778 - renesas,tmu-r8a7779 + - renesas,tmu-sh7750 then: required: - resets
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 10/37 sh: Common PCI Framework driver support.
In reply to Yoshinori SatoAdd New OF based PCI Host driver.
This driver conflicts some point in legacy PCI driver. To resolve the conflict, I made some changes to the legacy driver.
--- arch/sh/include/asm/io.h | 6 ++++++ arch/sh/include/asm/pci.h | 4 ++++ arch/sh/kernel/iomap.c | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+)
arch/sh/include/asm/io.h +6 -0
@@ -20,6 +20,7 @@#include <asm/page.h> #include <linux/pgtable.h> #include <asm-generic/iomap.h> +#include <linux/ioport.h> #define __IO_PREFIX generic#include <asm/io_generic.h>
@@ -310,4 +311,9 @@ unsigned long long poke_real_address_q(unsigned long long 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); +#if defined(CONFIG_PCI ) && !defined(CONFIG_GENERIC_IOMAP ) +#define pci_remap_iospace pci_remap_iospace +int pci_remap_iospace (const struct resource *res,phys_addr_t phys_addr); +#endif +#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/iomap.c +18 -0
@@ -160,3 +160,21 @@ void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count)mmio_outsl (addr, src, count); }EXPORT_SYMBOL (iowrite32_rep); + +#if defined(pci_remap_iospace) +int pci_remap_iospace (const struct resource *res,phys_addr_t phys_addr) +{ +unsigned long vaddr = res->start; + +if (!(res->flags &IORESOURCE_IO )) +return -EINVAL ; + +if (res->end >IO_SPACE_LIMIT ) +return -EINVAL ; + +__set_io_port_base (phys_addr); +return vmap_page_range (vaddr, vaddr +resource_size (res), phys_addr, +pgprot_device (PAGE_KERNEL )); +} +EXPORT_SYMBOL (pci_remap_iospace); +#endif
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 11/37 pci: pci-sh7751: Add SH7751 PCI driver
In reply to Yoshinori SatoRenesas SH7751 CPU Internal PCI Controller driver.
--- drivers/pci/controller/Kconfig | 9 + drivers/pci/controller/Makefile | 1 + drivers/pci/controller/pci-sh7751.c | 342 ++++++++++++++++++++++++++++ 3 files changed, 352 insertions(+) create mode 100644 drivers/pci/controller/pci-sh7751.c
drivers/pci/controller/Kconfig +9 -0
@@ -353,6 +353,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 || COMPILE_TEST + 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
@@ -40,6 +40,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 +342 -0
342 lines not on this page · raw message
Signature · 1 line
2.39.2
Re: [PATCH v7 11/37] pci: pci-sh7751: Add SH7751 PCI driver
Hi,
Quoted 55 lines · Yoshinori Sato
Renesas SH7751 CPU Internal PCI Controller driver.
Signed-off-by Yoshinori Sato <[email protected]>--- drivers/pci/controller/Kconfig | 9 + drivers/pci/controller/Makefile | 1 + drivers/pci/controller/pci-sh7751.c | 342 ++++++++++++++++++++++++++++ 3 files changed, 352 insertions(+)create mode 100644
drivers/pci/controller/pci-sh7751.cdrivers/pci/controller/Kconfig +9
-0@@ -353,6 +353,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 || COMPILE_TEST + 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@@ -40,6 +40,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 +7
-0@@ -0,0 +1,342 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* SH7751 PCI driver +* Copyright (C) 2023 Yoshinori Sato +*/ + +#include <linux/kernel.h>
drivers/pci/controller/pci-sh7751.c line 17
Quoted 10 lines
drivers/pci/controller/pci-sh7751.c new file +10
-0+#include <linux/module.h> +#include <linux/of_address.h> +#include <linux/of_pci.h> +#include <linux/of_platform.h> +#include <linux/pci-ecam.h> +#include <linux/platform_device.h> +#include <linux/io.h> +#include <linux/pci.h> +#include <linux/dma-direct.h> +#include <asm/addrspace.h>
can you consider to rearranging headers into alphabetically sorted order ?
Quoted 42 lines
drivers/pci/controller/pci-sh7751.c new file +42
-0+ +/* PCICR and PCICLKCR write enable magic key */ +#define PCIC_WE_KEY (0xa5 << 24) + +/* PCIC registers */ +/* 0x0000 - 0x00ff mapped to PCI device configuration space */ +#define PCIC_PCICR 0x100/* PCI Control Register */ +#define PCIC_PCICR_TRSB BIT(9)/* Target Read Single */ +#define PCIC_PCICR_BSWP BIT(8)/* Target Byte Swap */ +#define PCIC_PCICR_PLUP BIT(7)/* Enable PCI Pullup */ +#define PCIC_PCICR_ARBM BIT(6)/* PCI Arbitration Mode */ +#define PCIC_PCICR_MD10 BIT(5)/* MD10 status */ +#define PCIC_PCICR_MD9 BIT(4)/* MD9 status */ +#define PCIC_PCICR_SERR BIT(3)/* SERR output assert */ +#define PCIC_PCICR_INTA BIT(2)/* INTA output assert */ +#define PCIC_PCICR_PRST BIT(1)/* PCI Reset Assert */ +#define PCIC_PCICR_CFIN BIT(0)/* Central Fun. Init Done */ + +#define PCIC_PCILSR0 0x104/* PCI Local Space Register0 */ +#define PCIC_PCILSR1 0x108/* PCI Local Space Register1 */ +#define PCIC_PCILAR0 0x10c/* PCI Local Addr Register1 */ +#define PCIC_PCILAR1 0x110/* PCI Local Addr Register1 */ +#define PCIC_PCIINT 0x114/* PCI Interrupt Register */ +#define PCIC_PCIINTM 0x118/* PCI Interrupt Mask */ +#define PCIC_PCIALR 0x11c/* Error Address Register */ +#define PCIC_PCICLR 0x120/* Error Command/Data */ +#define PCIC_PCIAINT 0x130/* Arbiter Interrupt Register */ +#define PCIC_PCIAINTM 0x134/* Arbiter Int. Mask Register */ +#define PCIC_PCIBMLR 0x138/* Error Bus Master Register */ +#define PCIC_PCIDMABT 0x140/* DMA Transfer Arb. Register */ +#define PCIC_PCIPAR 0x1c0/* PIO Address Register */ +#define PCIC_PCIMBR 0x1c4/* Memory Base Address */ +#define PCIC_PCIIOBR 0x1c8/* I/O Base Address Register */ + +#define PCIC_PCIPINT 0x1cc/* Power Mgmnt Int. Register */ +#define PCIC_PCIPINT_D3 BIT(1)/* D3 Pwr Mgmt. Interrupt */ +#define PCIC_PCIPINT_D0 BIT(0)/* D0 Pwr Mgmt. Interrupt */ + +#define PCIC_PCIPINTM 0x1d0/* Power Mgmnt Mask Register */ +#define PCIC_PCICLKR 0x1d4/* Clock Ctrl. Register */ +#define PCIC_PCIBCR1 0x1e0/* Memory BCR1 Register */ +#define PCIC_PCIBCR2 0x1e4/* Memory BCR2 Register */
drivers/pci/controller/pci-sh7751.c line 69
Quoted 10 lines
drivers/pci/controller/pci-sh7751.c new file +10
-0+#define PCIC_PCIWCR1 0x1e8/* Wait Control 1 Register */ +#define PCIC_PCIWCR2 0x1ec/* Wait Control 2 Register */ +#define PCIC_PCIWCR3 0x1f0/* Wait Control 3 Register */ +#define PCIC_PCIMCR 0x1f4/* Memory Control Register */ +#define PCIC_PCIBCR3 0x1f8/* Memory BCR3 Register */ +#define PCIC_PCIPDR 0x220/* Port IO Data Register */ + +/* PCI IDs */ +/* Hitachi is the company that led to Renesas. */ +/* The SH7751 was designed by Hitachi, so it has a Hitachi ID. */
multi-line comments way ?
Quoted 11 lines
drivers/pci/controller/pci-sh7751.c new file +11
-0+#define PCI_VENDOR_ID_HITACHI 0x1054 +#define PCI_DEVICE_ID_SH7751 0x3505 +#define PCI_DEVICE_ID_SH7751R 0x350e + +/* BSC registers */ +/* Copy BSC setting to PCI BSC */ +#define BSC_BCR1 0x0000 +#define BSC_BCR1_SLAVE BIT(30) +#define BSC_BCR1_BRQEN BIT(19) +#define BSC_BCR2 0x0004 +#define BSC_BCR3 0x0050
drivers/pci/controller/pci-sh7751.c line 90
Quoted 10 lines
drivers/pci/controller/pci-sh7751.c new file +10
-0+#define BSC_WCR1 0x0008 +#define BSC_WCR2 0x000c +#define BSC_WCR3 0x0010 +#define BSC_MCR 0x0014 +#define BSC_MCR_MRSET BIT(30) +#define BSC_MCR_RFSH BIT(2) + +/* PCIC access wrapper */ +#define pcic_writel (val, base, reg) writel(val, base + (reg)) +#define pcic_readl (base, reg) readl(base + (reg))
Do you really needed these new macros ? Is it for better readability ?
Quoted 9 lines
drivers/pci/controller/pci-sh7751.c new file +9
-0+/* +* We need to avoid collisions with `mirrored' VGA ports +* and other strange ISA hardware, so we always want the +* addresses to be allocated in the 0x000-0x0ff region +* modulo 0x400. +*/ +#define IO_REGION_BASE 0x1000 +resource_size_t pcibios_align_resource (void *data,const struct resource *res, +resource_size_t size,resource_size_t align)
drivers/pci/controller/pci-sh7751.c line 110
Quoted 10 lines
drivers/pci/controller/pci-sh7751.c new file +10
-0+{ +resource_size_t start = res->start; + +if (res->flags &IORESOURCE_IO ) { +if (start <PCIBIOS_MIN_IO +IO_REGION_BASE ) + start =PCIBIOS_MIN_IO +IO_REGION_BASE ; + +/* +* Put everything into 0x00-0xff region modulo 0x400. +*/
single line comment would work. no ?
Quoted 117 lines
drivers/pci/controller/pci-sh7751.c new file +117
-0+if (start &0x300 ) + start = (start +0x3ff ) & ~0x3ff ; + } + +return start; +} + +static int setup_pci_bsc (struct device *dev,void __iomem *pcic, +void __iomem *bsc,unsigned int area,bool bcr3) +{ +u32 word; + + word =__raw_readl (bsc +BSC_BCR1 ); +/* check BCR for SDRAM in area */ +if (((word >> area) &1 ) ==0 ) { +dev_err (dev,"Area %u is not configured for SDRAM. BCR1=0x%x\n" , + area, word); +return -EINVAL ; + } + word |=BSC_BCR1_SLAVE ;/* PCIC BSC is slave only */ +pcic_writel (word, pcic,PCIC_PCIBCR1 ); + + word =__raw_readw (bsc +BSC_BCR2 ); +/* check BCR2 for 32bit SDRAM interface*/ +if (((word >> (area <<1 )) &0x3 ) !=0x3 ) { +dev_err (dev,"Area %u is not 32 bit SDRAM. BCR2=0x%x\n" , + area, word); +return -EINVAL ; + } +pcic_writel (word, pcic,PCIC_PCIBCR2 ); + +if (bcr3) { +/* BCR3 have only SH7751R */ + word =__raw_readw (bsc +BSC_BCR3 ); +pcic_writel (word, pcic,PCIC_PCIBCR3 ); + } + +/* configure the wait control registers */ + word =__raw_readl (bsc +BSC_WCR1 ); +pcic_writel (word, pcic,PCIC_PCIWCR1 ); + word =__raw_readl (bsc +BSC_WCR2 ); +pcic_writel (word, pcic,PCIC_PCIWCR2 ); + word =__raw_readl (bsc +BSC_WCR3 ); +pcic_writel (word, pcic,PCIC_PCIWCR3 ); + word =__raw_readl (bsc +BSC_MCR ); +/* Clear MRSET and RFSH bit */ + word &= ~(BSC_MCR_MRSET |BSC_MCR_RFSH ); +pcic_writel (word, pcic,PCIC_PCIMCR ); + +return 0 ; +} + +#define NUM_AREA 7 +static int set_pci_ranges (struct device *dev, +void __iomem *pcic,void __iomem *bsc,bool bcr3) +{ +struct resource_entry *dma, *tmp; +struct pci_host_bridge *bridge; +u32 bsc_done[NUM_AREA ]; +unsigned int la; + + bridge =dev_get_drvdata (dev); +pcic_writel (0 , pcic,PCIC_PCILAR0 ); +pcic_writel (0 , pcic,PCIC_PCILAR1 ); + la =0 ; +memset (&bsc_done,0 ,sizeof (bsc_done)); +resource_list_for_each_entry_safe (dma, tmp, &bridge->dma_ranges) { +struct resource *res = dma->res; +unsigned int area; +u32 word; + +switch (resource_type (res)) { +case IORESOURCE_IO : +/* BAR0 is I/O space */ + word = res->start |1 ; +pcic_writel (word, pcic,PCI_BASE_ADDRESS_0 ); + word =pcic_readl (pcic,PCI_COMMAND ); + word |=PCI_COMMAND_IO ; +pcic_writel (word, pcic,PCI_COMMAND ); +break ; +case IORESOURCE_MEM : +if (la >4 ) { +dev_err (dev,"Invalid range definition.\n" ); +return -EINVAL ; + } + area = (res->start >>26 ) &0x07 ; + word = res->end - res->start; +if (area >=NUM_AREA ) { +/* Area 7 is reserved. */ +dev_info (dev,"Invalid local address 0x%08x. Ignore it.\n" , + res->start); +break ; + } +pcic_writel (res->start, pcic,PCI_BASE_ADDRESS_1 + la); +/* if dummy entry, skip BSC setup */ +if (word <4 ) +break ; +/* BAR1 is local area 0, BAR2 is local area 1 */ +pcic_writel (word, pcic,PCIC_PCILSR0 + la); + word =P2SEGADDR (res->start); +pcic_writel (word, pcic,PCIC_PCILAR0 + la); + la +=4 ; +if (!bsc_done[area]) { +/* check BCR for SDRAM in specified area. And setup PCI BSC. */ +if (setup_pci_bsc (dev, pcic, bsc, area, bcr3)) +return -EINVAL ; + bsc_done[area] =1 ; + } +break ; + } + } +return 0 ; +} + +static int sh7751_pci_probe (struct platform_device *pdev) +{ +struct resource *res, *bscres;
drivers/pci/controller/pci-sh7751.c line 237
Quoted 10 lines
drivers/pci/controller/pci-sh7751.c new file +10
-0+void __iomem *pcic; +void __iomem *bsc; +u16 vid, did; +u32 word; +int ret; + + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); +if (IS_ERR (res)) +return PTR_ERR (res); + pcic =ioremap (res->start, res->end - res->start +1 );
Can you consider using devm_platform_ioremap_resource() API ?
drivers/pci/controller/pci-sh7751.c line 242
Quoted 4 lines
drivers/pci/controller/pci-sh7751.c new file +4
-0+ bscres =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); + bsc =devm_ioremap_resource (&pdev->dev, bscres); +if (IS_ERR (bsc)) +return PTR_ERR (bsc);
Same as above.
drivers/pci/controller/pci-sh7751.c line 251
Quoted 8 lines
drivers/pci/controller/pci-sh7751.c new file +8
-0+/* check for SH7751/SH7751R hardware */ + word =pcic_readl (pcic,PCI_VENDOR_ID ); + vid = word &0xffff ; + did = word >>16 ; +if ((vid !=PCI_VENDOR_ID_HITACHI ) || + ((did !=PCI_DEVICE_ID_SH7751 ) && + (did !=PCI_DEVICE_ID_SH7751R ))) { +dev_err (&pdev->dev,"This is not an SH7751(R)\n" );
error handling missing iounmap(pcic)
Quoted 24 lines
drivers/pci/controller/pci-sh7751.c new file +24
-0+return -ENODEV ; + } +dev_info (&pdev->dev,"PCI core found at %pR\n" , res); + +/* Set the BCR's to enable PCI access */ + word =__raw_readl (bsc +BSC_BCR1 ); + word |=BSC_BCR1_BRQEN ; +__raw_writel (word, bsc +BSC_BCR1 ); + +/* Turn the clocks back on (not done in reset)*/ +pcic_writel (PCIC_WE_KEY |0 , pcic,PCIC_PCICLKR ); +/* Clear Powerdown IRQ's (not done in reset) */ + word =PCIC_PCIPINT_D3 |PCIC_PCIPINT_D0 ; +pcic_writel (word, pcic,PCIC_PCIPINT ); + +/* set the command/status */ + word =PCI_COMMAND_MEMORY |PCI_COMMAND_MASTER | +PCI_COMMAND_PARITY |PCI_COMMAND_WAIT ; +pcic_writel (word, pcic,PCI_COMMAND ); + +/* define this host as the host bridge */ + word =PCI_BASE_CLASS_BRIDGE <<24 ; +pcic_writel (word, pcic,PCI_CLASS_REVISION ); +
drivers/pci/controller/pci-sh7751.c line 285
Quoted 10 lines
drivers/pci/controller/pci-sh7751.c new file +10
-0+ ret =pci_host_common_probe (pdev); +if (ret) { +dev_err (&pdev->dev,"Initialize failed (%d)\n" , ret); +return ret; + } + +/* Set IO and Mem windows to local address */ +if (set_pci_ranges (&pdev->dev, pcic, bsc, + did ==PCI_DEVICE_ID_SH7751R )) +return -EINVAL ;
error handling to call pci_host_common_remove() ?
drivers/pci/controller/pci-sh7751.c line 295
Quoted 10 lines
drivers/pci/controller/pci-sh7751.c new file +10
-0+pcic_writel (0 , pcic,PCIC_PCIIOBR ); + +if (of_property_read_bool (pdev->dev.of_node,"renesas,bus-arbit-round-robin" )) + word |=BIT (0 ); +else + word =0 ; +pcic_writel (word, pcic,PCIC_PCIDMABT ); + +/* SH7751 init done, set central function init complete */ +/* use round robin mode to stop a device starving/overrunning */
multi-line comment ?
Quoted 47 lines
drivers/pci/controller/pci-sh7751.c new file +47
-0+ word =PCIC_PCICR_CFIN |PCIC_PCICR_ARBM ; +pcic_writel (PCIC_WE_KEY | word, pcic,PCIC_PCICR ); + +return 0 ; +} + +/* +* Direct access to PCI hardware... +*/ +#define CONFIG_CMD (bus, devfn, where) \ + (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3)) + +static void __iomem *sh4_pci_map_bus (struct pci_bus *bus, +unsigned int devfn,int where) +{ +struct pci_config_window *cfg = bus->sysdata; +void __iomem *pcic = (void __iomem *)cfg->res.start; + +pcic_writel (CONFIG_CMD (bus, devfn, where), pcic,PCIC_PCIPAR ); +return pcic +PCIC_PCIPDR ; +} + +static const struct pci_ecam_ops pci_sh7751_bus_ops = { + .pci_ops = { + .map_bus = sh4_pci_map_bus, + .read = pci_generic_config_read32, + .write = pci_generic_config_write32, + } +}; + +static const struct of_device_id sh7751_pci_of_match[] = { + { .compatible ="renesas,sh7751-pci" , + .data = &pci_sh7751_bus_ops }, + { } +}; +MODULE_DEVICE_TABLE (of, sh7751_pci_of_match); + +static struct platform_driver sh7751_pci_driver = { + .driver = { + .name ="sh7751-pci" , + .of_match_table = sh7751_pci_of_match, + }, + .probe = sh7751_pci_probe, +}; +module_platform_driver (sh7751_pci_driver); + +MODULE_DESCRIPTION ("SH7751 PCI driver" );
Yoshinori Sato
maintainerPATCH v7 12/37 dt-bindings: pci: pci-sh7751: Add SH7751 PCI
In reply to Yoshinori SatoRenesas SH7751 PCI Controller json-schema.
--- .../bindings/pci/renesas,sh7751-pci.yaml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/renesas,sh7751-pci.yaml
Documentation/devicetree/bindings/pci/renesas,sh7751-pci.yaml new file +89 -0
@@ -0,0 +1,89 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pci/renesas,sh7751-pci.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Renesas SH7751 PCI Host controller + +maintainers: + - Yoshinori Sato <[email protected]> + +allOf: + - $ref: /schemas/pci/pci-bus.yaml# + +properties: + compatible: + const: renesas,sh7751-pci + + reg: + minItems: 2 + maxItems: 2 + + reg-names: + items: + - const: PCI Controller + - const: Bus State Controller + + "#interrupt-cells": + const: 1 + + "#address-cells": + const: 3 + + "#size-cells": + const: 2 + + ranges: true + + dma-ranges: true + + interrupt-controller: true + + renesas,bus-arbit-round-robin: + $ref: /schemas/types.yaml#/definitions/flag + description: | + Set DMA bus arbitration to round robin. + +required: + - compatible + - reg + - "#interrupt-cells" + - "#address-cells" + - "#size-cells" + - ranges + - interrupt-map + - interrupt-map-mask + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + pci@fe200000 { + compatible = "renesas,sh7751-pci"; + #address-cells = <3>; + #size-cells = <2>; + #interrupt-cells = <1>; + interrupt-controller; + device_type = "pci"; + bus-range = <0 0>; + ranges = <0x02000000 0 0xfd000000 0xfd000000 0 0x01000000>, + <0x01000000 0 0x00000000 0xfe240000 0 0x00040000>; + dma-ranges = <0x02000000 0 0xc000000 0x0c000000 0 0x04000000>; + reg = <0xfe200000 0x0400>, + <0xff800000 0x0100>; + interrupt-map = <0x0000 0 0 1 &julianintc 5 IRQ_TYPE_LEVEL_LOW>, + <0x0000 0 0 2 &julianintc 6 IRQ_TYPE_LEVEL_LOW>, + <0x0000 0 0 3 &julianintc 7 IRQ_TYPE_LEVEL_LOW>, + <0x0000 0 0 4 &julianintc 8 IRQ_TYPE_LEVEL_LOW>, + <0x0800 0 0 1 &julianintc 6 IRQ_TYPE_LEVEL_LOW>, + <0x0800 0 0 2 &julianintc 7 IRQ_TYPE_LEVEL_LOW>, + <0x0800 0 0 3 &julianintc 8 IRQ_TYPE_LEVEL_LOW>, + <0x0800 0 0 4 &julianintc 5 IRQ_TYPE_LEVEL_LOW>, + <0x1000 0 0 1 &julianintc 7 IRQ_TYPE_LEVEL_LOW>, + <0x1000 0 0 2 &julianintc 8 IRQ_TYPE_LEVEL_LOW>, + <0x1000 0 0 3 &julianintc 5 IRQ_TYPE_LEVEL_LOW>, + <0x1000 0 0 4 &julianintc 6 IRQ_TYPE_LEVEL_LOW>; + interrupt-map-mask = <0x1800 0 0 7>; + };
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 13/37 dt-bindings: clock: sh7750-cpg: Add renesas,sh7750-cpg header.
In reply to Yoshinori SatoSH7750 CPG Clock output define.
--- .../bindings/clock/renesas,sh7750-cpg.yaml | 105 ++++++++++++++++++ include/dt-bindings/clock/sh7750-cpg.h | 26 +++++ 2 files changed, 131 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/renesas,sh7750-cpg.yaml create mode 100644 include/dt-bindings/clock/sh7750-cpg.h
Documentation/devicetree/bindings/clock/renesas,sh7750-cpg.yaml new file +105 -0
@@ -0,0 +1,105 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/renesas,sh7750-cpg.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Renesas SH7750/7751 Clock Pulse Generator (CPG) + +maintainers: + - Yoshinori Sato <[email protected]> + +description: + The Clock Pulse Generator (CPG) generates core clocks for the SoC. It + includes PLLs, and variable ratio dividers. + + The CPG may also provide a Clock Domain for SoC devices, in combination with + the CPG Module Stop (MSTP) Clocks. + +properties: + compatible: + enum: + - renesas,sh7750-cpg # SH7750 + - renesas,sh7750s-cpg # SH775S + - renesas,sh7750r-cpg # SH7750R + - renesas,sh7751-cpg # SH7751 + - renesas,sh7751r-cpg # SH7751R + + reg: true + + reg-names: true + + clocks: + maxItems: 1 + + clock-names: + const: extal + + '#clock-cells': + const: 1 + + renesas,mode: + description: Board-specific settings of the MD[0-2] pins on SoC + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 6 + + '#power-domain-cells': + const: 0 + +required: + - compatible + - reg + - reg-names + - clocks + - clock-names + - '#clock-cells' + +allOf: + - if: + properties: + compatible: + contains: + enum: + - renesas,sh7750-cpg + - renesas,sh7750s-cpg + then: + properties: + reg: + maxItems: 1 + reg-names: + items: + - const: FRQCR + + - if: + properties: + compatible: + contains: + enum: + - renesas,sh7750r-cpg + - renesas,sh7751-cpg + - renesas,sh7751r-cpg + then: + properties: + reg: + maxItems: 2 + reg-names: + items: + - const: FRQCR + - const: CLKSTP00 + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/sh7750-cpg.h> + cpg: clock-controller@ffc00000 { + #clock-cells = <1>; + #power-domain-cells = <0>; + compatible = "renesas,sh7751r-cpg"; + clocks = <&extal>; + clock-names = "extal"; + reg = <0xffc00000 20>, <0xfe0a0000 16>; + reg-names = "FRQCR", "CLKSTP00"; + renesas,mode = <0>; + };
include/dt-bindings/clock/sh7750-cpg.h new file +26 -0
@@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +* +* Copyright 2023 Yoshinori Sato +*/ + +#ifndef __DT_BINDINGS_CLOCK_SH7750_H__ +#define __DT_BINDINGS_CLOCK_SH7750_H__ + +#define SH7750_CPG_PLLOUT 0 + +#define SH7750_CPG_PCK 1 +#define SH7750_CPG_BCK 2 +#define SH7750_CPG_ICK 3 + +#define SH7750_MSTP_SCI 4 +#define SH7750_MSTP_RTC 5 +#define SH7750_MSTP_TMU012 6 +#define SH7750_MSTP_SCIF 7 +#define SH7750_MSTP_DMAC 8 +#define SH7750_MSTP_UBC 9 +#define SH7750_MSTP_SQ 10 +#define SH7750_CSTP_INTC 11 +#define SH7750_CSTP_TMU34 12 +#define SH7750_CSTP_PCIC 13 + +#endif
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 14/37 clk: Compatible with narrow registers
In reply to Yoshinori Satodivider and gate only support 32-bit registers.
Older hardware uses narrower registers, so I want to be able to handle 8-bit and 16-bit wide registers.
Seven clk_divider flags are used, and if I add flags for 8bit access and 16bit access, 8bit will not be enough, so I expanded it to u16.
--- drivers/clk/clk-divider.c | 56 +++++++++++++++++++++----------- drivers/clk/clk-gate.c | 62 ++++++++++++++++++++++++++++-------- include/linux/clk-provider.h | 22 ++++++++++--- 3 files changed, 103 insertions(+), 37 deletions(-)
drivers/clk/clk-divider.c +37 -19
@@ -26,20 +26,38 @@* parent - fixed parent. No clk_set_parent support */ -static inline u32 clk_div_readl (struct clk_divider *divider) -{ -if (divider->flags &CLK_DIVIDER_BIG_ENDIAN ) -return ioread32be (divider->reg); - -return readl (divider->reg); +static inline u32 clk_div_read (struct clk_divider *divider) +{ +if (divider->flags &CLK_DIVIDER_REG_8BIT ) +return readb (divider->reg); +else if (divider->flags &CLK_DIVIDER_REG_16BIT ) { +if (divider->flags &CLK_DIVIDER_BIG_ENDIAN ) +return ioread16be (divider->reg); +else +return readw (divider->reg); + }else { +if (divider->flags &CLK_DIVIDER_BIG_ENDIAN ) +return ioread32be (divider->reg); +else +return readl (divider->reg); + } } -static inline void clk_div_writel (struct clk_divider *divider,u32 val) +static inline void clk_div_write (struct clk_divider *divider,u32 val) { -if (divider->flags &CLK_DIVIDER_BIG_ENDIAN ) -iowrite32be (val, divider->reg); -else -writel (val, divider->reg); +if (divider->flags &CLK_DIVIDER_REG_8BIT ) +writeb (val, divider->reg); +else if (divider->flags &CLK_DIVIDER_REG_16BIT ) { +if (divider->flags &CLK_DIVIDER_BIG_ENDIAN ) +iowrite16be (val, divider->reg); +else +writew (val, divider->reg); + }else { +if (divider->flags &CLK_DIVIDER_BIG_ENDIAN ) +iowrite32be (val, divider->reg); +else +writel (val, divider->reg); + } } static unsigned int _get_table_maxdiv(const struct clk_div_table *table,
@@ -152,7 +170,7 @@ static unsigned long clk_divider_recalc_rate(struct clk_hw *hw,struct clk_divider *divider =to_clk_divider (hw);unsigned int val; - val =clk_div_readl (divider) >> divider->shift; + val =clk_div_read (divider) >> divider->shift; val &=clk_div_mask (divider->width); return divider_recalc_rate(hw, parent_rate, val, divider->table,
@@ -434,7 +452,7 @@ static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,if (divider->flags &CLK_DIVIDER_READ_ONLY ) {u32 val; - val =clk_div_readl (divider) >> divider->shift; + val =clk_div_read (divider) >> divider->shift; val &=clk_div_mask (divider->width); return divider_ro_round_rate(hw, rate, prate, divider->table,
@@ -455,7 +473,7 @@ static int clk_divider_determine_rate(struct clk_hw *hw,if (divider->flags &CLK_DIVIDER_READ_ONLY ) {u32 val; - val =clk_div_readl (divider) >> divider->shift; + val =clk_div_read (divider) >> divider->shift; val &=clk_div_mask (divider->width); return divider_ro_determine_rate(hw, req, divider->table,
@@ -505,11 +523,11 @@ static int clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,if (divider->flags &CLK_DIVIDER_HIWORD_MASK ) { val =clk_div_mask (divider->width) << (divider->shift +16 ); }else { - val =clk_div_readl (divider); + val =clk_div_read (divider); val &= ~(clk_div_mask (divider->width) << divider->shift); } val |= (u32 )value << divider->shift; -clk_div_writel (divider, val); +clk_div_write (divider, val);if (divider->lock)spin_unlock_irqrestore (divider->lock, flags);
@@ -538,7 +556,7 @@ struct clk_hw *__clk_hw_register_divider(struct device *dev, struct device_node *np, const char *name, const char *parent_name, const struct clk_hw *parent_hw, const struct clk_parent_data *parent_data, unsigned long flags, - void __iomem *reg, u8 shift, u8 width, u8 clk_divider_flags, + void __iomem *reg, u8 shift, u8 width, u32 clk_divider_flags, const struct clk_div_table *table, spinlock_t *lock) { struct clk_divider *div;
@@ -610,7 +628,7 @@ EXPORT_SYMBOL_GPL(__clk_hw_register_divider);struct clk *clk_register_divider_table (struct device *dev,const char *name,const char *parent_name,unsigned long flags,void __iomem *reg,u8 shift,u8 width, -u8 clk_divider_flags,const struct clk_div_table *table, +u32 clk_divider_flags,const struct clk_div_table *table,spinlock_t *lock) {struct clk_hw *hw;
@@ -664,7 +682,7 @@ struct clk_hw *__devm_clk_hw_register_divider(struct device *dev, struct device_node *np, const char *name, const char *parent_name, const struct clk_hw *parent_hw, const struct clk_parent_data *parent_data, unsigned long flags, - void __iomem *reg, u8 shift, u8 width, u8 clk_divider_flags, + void __iomem *reg, u8 shift, u8 width, u32 clk_divider_flags, const struct clk_div_table *table, spinlock_t *lock) { struct clk_hw **ptr, *hw;
drivers/clk/clk-gate.c +49 -13
102 lines not on this page · raw message
include/linux/clk-provider.h +17 -5
@@ -508,12 +508,16 @@ void of_fixed_clk_setup(struct device_node *np);* CLK_GATE_BIG_ENDIAN - by default little endian register accesses are used for * the gate register. Setting this flag makes the register accesses big * endian. +* CLK_GATE_REG_8BIT - by default 32bit register accesses are used for +* the gate register. Setting this flag makes the register accesses 8bit. +* CLK_GATE_REG_16BIT - by default 32bit register accesses are used for +* the gate register. Setting this flag makes the register accesses 16bit. */ struct clk_gate {struct clk_hw hw;void __iomem *reg;u8 bit_idx; -u8 flags; +u32 flags;spinlock_t *lock; };
@@ -522,6 +526,8 @@ struct clk_gate {#define CLK_GATE_SET_TO_DISABLE BIT(0)#define CLK_GATE_HIWORD_MASK BIT(1)#define CLK_GATE_BIG_ENDIAN BIT(2) +#define CLK_GATE_REG_8BIT BIT(3) +#define CLK_GATE_REG_16BIT BIT(4)extern const struct clk_ops clk_gate_ops; struct clk_hw *__clk_hw_register_gate(struct device *dev,
@@ -675,13 +681,17 @@ struct clk_div_table {* CLK_DIVIDER_BIG_ENDIAN - By default little endian register accesses are used * for the divider register. Setting this flag makes the register accesses * big endian. +* CLK_DIVIDER_REG_8BIT - by default 32bit register accesses are used for +* the gate register. Setting this flag makes the register accesses 8bit. +* CLK_DIVIDER_REG_16BIT - by default 32bit register accesses are used for +* the gate register. Setting this flag makes the register accesses 16bit. */ struct clk_divider {struct clk_hw hw;void __iomem *reg;u8 shift;u8 width; -u8 flags; +u16 flags;const struct clk_div_table *table;spinlock_t *lock; };
@@ -697,6 +707,8 @@ struct clk_divider {#define CLK_DIVIDER_READ_ONLY BIT(5)#define CLK_DIVIDER_MAX_AT_ZERO BIT(6)#define CLK_DIVIDER_BIG_ENDIAN BIT(7) +#define CLK_DIVIDER_REG_8BIT BIT(8) +#define CLK_DIVIDER_REG_16BIT BIT(9)extern const struct clk_ops clk_divider_ops;extern const struct clk_ops clk_divider_ro_ops;
@@ -726,18 +738,18 @@ struct clk_hw *__clk_hw_register_divider(struct device *dev, struct device_node *np, const char *name, const char *parent_name, const struct clk_hw *parent_hw, const struct clk_parent_data *parent_data, unsigned long flags, - void __iomem *reg, u8 shift, u8 width, u8 clk_divider_flags, + void __iomem *reg, u8 shift, u8 width, u32 clk_divider_flags, const struct clk_div_table *table, spinlock_t *lock);struct clk_hw *__devm_clk_hw_register_divider (struct device *dev,struct device_node *np,const char *name,const char *parent_name,const struct clk_hw *parent_hw,const struct clk_parent_data *parent_data,unsigned long flags, -void __iomem *reg,u8 shift,u8 width,u8 clk_divider_flags, +void __iomem *reg,u8 shift,u8 width,u32 clk_divider_flags,const struct clk_div_table *table,spinlock_t *lock);struct clk *clk_register_divider_table (struct device *dev,const char *name,const char *parent_name,unsigned long flags,void __iomem *reg,u8 shift,u8 width, -u8 clk_divider_flags,const struct clk_div_table *table, +u32 clk_divider_flags,const struct clk_div_table *table,spinlock_t *lock);/** * clk_register_divider - register a divider clock with the clock framework
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 15/37 clk: renesas: Add SH7750/7751 CPG Driver
In reply to Yoshinori SatoRenesas SH7750 and SH7751 series CPG driver. This driver supported frequency control and clock gating.
--- drivers/clk/renesas/Kconfig | 13 +- drivers/clk/renesas/Makefile | 1 + drivers/clk/renesas/clk-sh7750.c | 480 +++++++++++++++++++++++++++++++ 3 files changed, 491 insertions(+), 3 deletions(-) create mode 100644 drivers/clk/renesas/clk-sh7750.c
drivers/clk/renesas/Kconfig +10 -3
@@ -1,8 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 config CLK_RENESAS - bool "Renesas SoC clock support" if COMPILE_TEST && !ARCH_RENESAS - default y if ARCH_RENESAS + bool "Renesas SoC clock support" if COMPILE_TEST && !ARCH_RENESAS && !SUPERH + default y if ARCH_RENESAS || SUPERH select CLK_EMEV2 if ARCH_EMEV2 select CLK_RZA1 if ARCH_R7S72100 select CLK_R7S9210 if ARCH_R7S9210
@@ -41,6 +41,9 @@ config CLK_RENESAS select CLK_R9A08G045 if ARCH_R9A08G045 select CLK_R9A09G011 if ARCH_R9A09G011 select CLK_SH73A0 if ARCH_SH73A0 + select CLK_SH7750 if CPU_SUBTYPE_SH7750 || CPU_SUBTYPE_SH7750S || \ + CPU_SUBTYPE_SH7750R || CPU_SUBTYPE_SH7751 || \ + CPU_SUBTYPE_SH7751R if CLK_RENESAS
@@ -198,7 +201,6 @@ config CLK_SH73A0 select CLK_RENESAS_CPG_MSTP select CLK_RENESAS_DIV6 - # Family config CLK_RCAR_CPG_LIB bool "CPG/MSSR library functions" if COMPILE_TEST
@@ -228,6 +230,11 @@ config CLK_RZG2L bool "Renesas RZ/{G2L,G2UL,G3S,V2L} family clock support" if COMPILE_TEST select RESET_CONTROLLER +config CLK_SH7750 + bool "Renesas SH7750/7751 family clock support" if COMPILE_TEST + help + This is a driver for SH7750 / SH7751 CPG. + # Generic config CLK_RENESAS_CPG_MSSR bool "CPG/MSSR clock support" if COMPILE_TEST
drivers/clk/renesas/Makefile +1 -0
@@ -38,6 +38,7 @@ obj-$(CONFIG_CLK_R9A07G054) += r9a07g044-cpg.o obj-$(CONFIG_CLK_R9A08G045) += r9a08g045-cpg.o obj-$(CONFIG_CLK_R9A09G011) += r9a09g011-cpg.o obj-$(CONFIG_CLK_SH73A0) += clk-sh73a0.o +obj-$(CONFIG_CLK_SH7750) += clk-sh7750.o # Family obj-$(CONFIG_CLK_RCAR_CPG_LIB) += rcar-cpg-lib.o
drivers/clk/renesas/clk-sh7750.c new file +480 -0
480 lines not on this page · raw message
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 16/37 irqchip: Add SH7751 INTC driver
In reply to Yoshinori SatoRenesas SH7751 Internal interrupt controller driver.
--- drivers/irqchip/Kconfig | 8 + drivers/irqchip/Makefile | 1 + drivers/irqchip/irq-renesas-sh7751.c | 282 +++++++++++++++++++++++++++ 3 files changed, 291 insertions(+) create mode 100644 drivers/irqchip/irq-renesas-sh7751.c
drivers/irqchip/Kconfig +8 -0
@@ -690,4 +690,12 @@ config SUNPLUS_SP7021_INTC chained controller, routing all interrupt source in P-Chip to the primary controller on C-Chip. +config RENESAS_SH7751_INTC + bool "Renesas SH7751 Interrupt Controller" + depends on SH_DEVICE_TREE || COMPILE_TEST + select IRQ_DOMAIN_HIERARCHY + help + Support for the Renesas SH7751 On-chip interrupt controller. + And external interrupt encoder for some targets. + endmenu
drivers/irqchip/Makefile +1 -0
@@ -121,3 +121,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_SH7751_INTC) += irq-renesas-sh7751.o
drivers/irqchip/irq-renesas-sh7751.c new file +282 -0
282 lines not on this page · raw message
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 17/37 dt-bindings: interrupt-controller: renesas,sh7751-intc: Add json-schema
In reply to Yoshinori SatoRenesas SH7751 INTC json-schema.
--- .../renesas,sh7751-intc.yaml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,sh7751-intc.yaml
Documentation/devicetree/bindings/interrupt-controller/renesas,sh7751-intc.yaml new file +53 -0
@@ -0,0 +1,53 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/interrupt-controller/renesas,sh7751-intc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Renesas SH7751 Interrupt Controller + +maintainers: + - Yoshinori Sato <[email protected]> + +properties: + compatible: + items: + - const: renesas,sh7751-intc + + '#interrupt-cells': + const: 1 + + interrupt-controller: true + + reg: + maxItems: 2 + + reg-names: + items: + - const: ICR + - const: INTPRI00 + + renesas,icr-irlm: + $ref: /schemas/types.yaml#/definitions/flag + description: If true four independent interrupt requests mode (ICR.IRLM is 1). + +required: + - compatible + - reg + - reg-names + - '#interrupt-cells' + - interrupt-controller + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/renesas,sh7751-intc.h> + shintc: interrupt-controller@ffd00000 { + compatible = "renesas,sh7751-intc"; + reg = <0xffd00000 14>, <0xfe080000 128>; + reg-names = "ICR", "INTPRI00"; + #interrupt-cells = <1>; + interrupt-controller; + }; +...
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 18/37 irqchip: SH7751 external interrupt encoder with enable gate.
In reply to Yoshinori SatoSH7751 have 15 level external interrupt.
It is typically connected to the CPU through a priority encoder that can suppress requests.
This driver provides a way to control those hardware with irqchip.
--- drivers/irqchip/Kconfig | 7 + drivers/irqchip/Makefile | 2 + drivers/irqchip/irq-renesas-sh7751irl.c | 221 ++++++++++++++++++++++++ 3 files changed, 230 insertions(+) create mode 100644 drivers/irqchip/irq-renesas-sh7751irl.c
drivers/irqchip/Kconfig +7 -0
@@ -698,4 +698,11 @@ config RENESAS_SH7751_INTC Support for the Renesas SH7751 On-chip interrupt controller. And external interrupt encoder for some targets. +config RENESAS_SH7751IRL_INTC + bool "Renesas SH7751 based target IRL encoder support." + depends on RENESAS_SH7751_INTC + help + Support for External Interrupt encoder + on the some Renesas SH7751 based target. + endmenu
drivers/irqchip/Makefile +2 -0
@@ -122,3 +122,5 @@ 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_SH7751_INTC) += irq-renesas-sh7751.o +obj-$(CONFIG_RENESAS_SH7751IRL_INTC) += irq-renesas-sh7751irl.o +
drivers/irqchip/irq-renesas-sh7751irl.c new file +221 -0
221 lines not on this page · raw message
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 19/37 dt-bindings: interrupt-controller: renesas,sh7751-irl-ext: Add json-schema
In reply to Yoshinori SatoRenesas SH7751 external interrupt encoder json-schema.
--- .../renesas,sh7751-irl-ext.yaml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,sh7751-irl-ext.yaml
Documentation/devicetree/bindings/interrupt-controller/renesas,sh7751-irl-ext.yaml new file +57 -0
@@ -0,0 +1,57 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/interrupt-controller/renesas,sh7751-irl-ext.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Renesas SH7751 external interrupt encoder with enable regs. + +maintainers: + - Yoshinori Sato <[email protected]> + +description: + This is the generally used external interrupt encoder on SH7751 based boards. + +properties: + compatible: + items: + - const: renesas,sh7751-irl-ext + + reg: true + + interrupt-controller: true + + '#interrupt-cells': + const: 2 + + '#address-cells': + const: 0 + + renesas,set-to-disable: + $ref: /schemas/types.yaml#/definitions/flag + description: Invert enable registers. Setting the bit to 0 enables interrupts. + + renesas,enable-reg: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: | + IRQ enable register bit mapping + +required: + - compatible + - reg + - interrupt-controller + - '#interrupt-cells' + - renesas,enable-reg + +additionalProperties: false + +examples: + - | + r2dintc: interrupt-controller@a4000000 { + compatible = "renesas,sh7751-irl-ext"; + reg = <0xa4000000 0x02>; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + renesas,enable-reg = <12 9 10 3 0 4 1 2 8 5 6 7 15 15 15 11>; + };
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 20/37 serial: sh-sci: fix SH4 OF support.
In reply to Yoshinori Sato- fix earlycon name.
- fix earlyprintk hung (NULL pointer reference).
- fix SERIAL_SH_SCI_EARLYCON enablement
--- drivers/tty/serial/Kconfig | 2 +- drivers/tty/serial/sh-sci.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/tty/serial/Kconfig +1 -1
@@ -661,7 +661,7 @@ config SERIAL_SH_SCI_EARLYCON depends on SERIAL_SH_SCI=y select SERIAL_CORE_CONSOLE select SERIAL_EARLYCON - default ARCH_RENESAS + default ARCH_RENESAS || SUPERH config SERIAL_SH_SCI_DMA bool "DMA support" if EXPERT
drivers/tty/serial/sh-sci.c +3 -3
@@ -2717,7 +2717,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);
@@ -3545,8 +3545,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 (rzscifa,"renesas,scif-r7s9210" , rzscifa_early_console_setup); +OF_EARLYCON_DECLARE (rzscifa,"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
maintainerPATCH v7 21/37 dt-bindings: serial: renesas,scif: Add scif-sh7751.
In reply to Yoshinori SatoAdd Renesas SH7751 SCIF.
--- Documentation/devicetree/bindings/serial/renesas,scif.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/serial/renesas,scif.yaml +1 -0
@@ -18,6 +18,7 @@ properties: - items: - enum: - renesas,scif-r7s72100 # RZ/A1H + - renesas,scif-sh7751 # SH7751 - const: renesas,scif # generic SCIF compatible UART - items:
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 22/37 dt-bindings: display: smi,sm501: SMI SM501 binding json-schema
In reply to Yoshinori Sato--- .../bindings/display/smi,sm501.yaml | 398 ++++++++++++++++++ 1 file changed, 398 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/smi,sm501.yaml
Documentation/devicetree/bindings/display/smi,sm501.yaml new file +398 -0
@@ -0,0 +1,398 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/smi,sm501.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Silicon Motion SM501 Mobile Multimedia Companion Chip + +maintainers: + - Yoshinori Sato <[email protected]> + +description: | + These DT bindings describe the SM501. + +properties: + compatible: + const: + smi,sm501 + + reg: + maxItems: 2 + description: | + First entry: System Configuration register + Second entry: IO space (Display Controller register) + + interrupts: + description: SM501 interrupt to the cpu should be described here. + + mode: + $ref: /schemas/types.yaml#/definitions/string + description: select a video mode + + edid: + description: | + verbatim EDID data block describing attached display. + Data from the detailed timing descriptor will be used to + program the display controller. + + little-endian: + $ref: /schemas/types.yaml#/definitions/flag + description: available on big endian systems, to set different foreign endian. + big-endian: + $ref: /schemas/types.yaml#/definitions/flag + description: available on little endian systems, to set different foreign endian. + + swap-fb-endian: + $ref: /schemas/types.yaml#/definitions/flag + description: swap framebuffer byteorder. + + route-crt-panel: + $ref: /schemas/types.yaml#/definitions/flag + description: Panel output merge to CRT. + + crt: + type: object + description: CRT output control + properties: + edid: + $ref: /schemas/types.yaml#/definitions/uint8-array + description: | + verbatim EDID data block describing attached display. + Data from the detailed timing descriptor will be used to + program the display controller. + + smi,flags: + $ref: /schemas/types.yaml#/definitions/string-array + description: Display control flags. + items: + anyOf: + - const: use-init-done + - const: disable-at-exit + - const: use-hwcursor + - const: use-hwaccel + - const: panel-no-fpen + - const: panel-no-vbiasen + - const: panel-inv-fpen + - const: panel-inv-vbiasen + maxItems: 8 + + bpp: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Color depth + + panel: + type: object + description: Panel output control + properties: + edid: + $ref: /schemas/types.yaml#/definitions/uint8-array + description: | + verbatim EDID data block describing attached display. + Data from the detailed timing descriptor will be used to + program the display controller. + + smi,flags: + $ref: /schemas/types.yaml#/definitions/string-array + description: Display control flags. + items: + anyOf: + - const: use-init-done + - const: disable-at-exit + - const: use-hwcursor + - const: use-hwaccel + - const: panel-no-fpen + - const: panel-no-vbiasen + - const: panel-inv-fpen + - const: panel-inv-vbiasen + maxItems: 8 + + bpp: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Color depth + + smi,devices: + $ref: /schemas/types.yaml#/definitions/string-array + description: Select SM501 device functions. + items: + anyOf: + - const: usb-host + - const: usb-slave + - const: ssp0 + - const: ssp1 + - const: uart0 + - const: uart1 + - const: fbaccel + - const: ac97 + - const: i2s + - const: gpio + minItems: 1 + maxItems: 10 + + smi,mclk: + $ref: /schemas/types.yaml#/definitions/uint32 + description: mclk frequency. + + smi,m1xclk: + $ref: /schemas/types.yaml#/definitions/uint32 + description: m1xclk frequency. + + misc-timing: + type: object + description: Miscellaneous Timing register values. + properties: + ex: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Extend bus holding time. + + xc: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Xscale clock input select. + + usb-over-current-detect-disable: + $ref: /schemas/types.yaml#/definitions/flag + description: USB host current detection disable (Us=0). + + usb-over-current-detect-enable: + $ref: /schemas/types.yaml#/definitions/flag + description: USB host current detection disable (Us=1). + + sdram-clock-mode1-288mhz: + $ref: /schemas/types.yaml#/definitions/flag + description: SSM1 bit is clear. + + sdram-clock-mode1-div: + $ref: /schemas/types.yaml#/definitions/flag + description: SSM1 bit is set. + + sm1: + $ref: /schemas/types.yaml#/definitions/flag + description: SDRAM clock divider for PW mode 1. + + sdram-clock-mode0-288mhz: + $ref: /schemas/types.yaml#/definitions/flag + description: SSM0 bit is clear. + + sdram-clock-mode0-div: + $ref: /schemas/types.yaml#/definitions/flag + description: SSM0 bit is set. + + sm0: + $ref: /schemas/types.yaml#/definitions/uint32 + description: SDRAM clock divider for PW mode 0. + + pll-debug-input: + $ref: /schemas/types.yaml#/definitions/flag + description: 96MHz PLL debug input reference frequency (Deb=0). + + pll-debug-output: + $ref: /schemas/types.yaml#/definitions/flag + description: 96MHz PLL debug output frequency (Deb=1). + + no-acpi-control: + $ref: /schemas/types.yaml#/definitions/flag + description: No ACPI control (A=0). + + acpi-control: + $ref: /schemas/types.yaml#/definitions/flag + description: No ACPI control (A=1). + + divider: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Second PLL output frequency. + + usb-host-normal: + $ref: /schemas/types.yaml#/definitions/flag + description: USB Host normal mode. + + usb-host-simulation: + $ref: /schemas/types.yaml#/definitions/flag + description: USB Host simulation mode. + + delay: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Delay time to latch read data. Set the value to 10x. + + misc-control: + type: object + description: Miscellaneous Control register values. + properties: + pad: + $ref: /schemas/types.yaml#/definitions/uint32 + description: PCI Pad drive strength. + + usbclk: + $ref: /schemas/types.yaml#/definitions/uint32 + description: USB Clcok Select. + + uart1: + $ref: /schemas/types.yaml#/definitions/flag + description: UART1 (SSP=0) + + ssp1: + $ref: /schemas/types.yaml#/definitions/flag + description: SSP1 (SSP=1) + + latch-address-disable: + $ref: /schemas/types.yaml#/definitions/flag + description: 8051 Latch disable (Lat=0). + + latch-address-enable: + $ref: /schemas/types.yaml#/definitions/flag + description: 8051 Latch enable (Lat=1). + + panel-data-18bit: + $ref: /schemas/types.yaml#/definitions/flag + description: Flat Panel data 18bit (FP=0). + + panel-data-24bit: + $ref: /schemas/types.yaml#/definitions/flag + description: Flat Panel data 24bit (FP=1). + + xtal-freq-24mhz: + $ref: /schemas/types.yaml#/definitions/flag + description: Crystal frequency 24MHz (Freq=0). + + xtal-freq-12mhz: + $ref: /schemas/types.yaml#/definitions/flag + description: Crystal frequency 12MHz (Freq=1). + + refresh: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Internal memory refresh timing. + + hold: + $ref: /schemas/types.yaml#/definitions/uint32 + description: BUS Hold time. + + sh-ready-low: + $ref: /schemas/types.yaml#/definitions/flag + description: SuperH ready polarity active low (SH=0). + + sh-ready-high: + $ref: /schemas/types.yaml#/definitions/flag + description: SuperH ready polarity active high (SH=1). + + interrupt-normal: + $ref: /schemas/types.yaml#/definitions/flag + description: Interrupt normal (II=0). + + interrupt-inverted: + $ref: /schemas/types.yaml#/definitions/flag + description: Interrupt Inverting (II=1). + + pll-clock-count-disable: + $ref: /schemas/types.yaml#/definitions/flag + description: PLL clock count disable. + + pll-clock-count-enaable: + $ref: /schemas/types.yaml#/definitions/flag + description: PLL clock count enable. + + dac-power-enable: + $ref: /schemas/types.yaml#/definitions/flag + description: DAC Power enable (DAC=0). + + dac-power-disable: + $ref: /schemas/types.yaml#/definitions/flag + description: DAC Power disable (DAC=1). + + usb-slave-cpu: + $ref: /schemas/types.yaml#/definitions/flag + description: USB slave controller cpu (MC=0). + + usb-slave-8051: + $ref: /schemas/types.yaml#/definitions/flag + description: USB slave controller 8051MCU (MC=1). + + burst-length-8: + $ref: /schemas/types.yaml#/definitions/flag + description: CPU Master burst length 8 (BL=0). + + burst-length-1: + $ref: /schemas/types.yaml#/definitions/flag + description: CPU Master burst length 1 (BL=1). + + usb-port-master: + $ref: /schemas/types.yaml#/definitions/flag + description: USB port master. + + usb-port-slave: + $ref: /schemas/types.yaml#/definitions/flag + description: USB port slave. + + vr-mmio-30mb: + $ref: /schemas/types.yaml#/definitions/flag + description: NEC VR Memory map MMIO locatedat 30MB (VR=0) + + vr-mmio-62mb: + $ref: /schemas/types.yaml#/definitions/flag + description: NEC VR Memory map MMIO locatedat 62MB (VR=1) + + gpio-pin-control: + type: object + description: GPIO control configuration. + properties: + pin: + type: object + properties: + gpio: + $ref: /schemas/types.yaml#/definitions/flag + description: pin in/out use GPIO. + function: + $ref: /schemas/types.yaml#/definitions/flag + description: pin in/out use function. + + gpio-i2c: + type: object + description: GPIO I2C definition. + properties: + i2c: + type: object + properties: + bus: + $ref: /schemas/types.yaml#/definitions/uint32 + description: I2C bus number. + + sda: + $ref: /schemas/types.yaml#/definitions/uint32 + description: I2C SDA pin port number. + + scl: + $ref: /schemas/types.yaml#/definitions/uint32 + description: I2C SCL pin port number. + + delay: + $ref: /schemas/types.yaml#/definitions/uint32 + description: bit transmission delay. + + timeout: + $ref: /schemas/types.yaml#/definitions/uint32 + description: transmission timeout. + +additionalProperties: false + +required: + - compatible + - reg + - interrupts + + +examples: + # MPC5200 + - | + display@1,0 { + compatible = "smi,sm501"; + reg = <0x00000000 0x00800000 + 0x03e00000 0x00200000>; + interrupts = <1 1 3>; + mode = "640x480-32@60"; + edid = [00 ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 + 00 00 01 04 00 00 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 f0 0a 80 fb 20 e0 25 10 32 60 + 02 00 00 00 00 00 00 06 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 bd]; + };
Signature · 1 line
2.39.2
Yoshinori Sato
maintainerPATCH v7 23/37 dt-bindings: display: sm501 register definition helper
In reply to Yoshinori SatoMiscellaneous Timing and Miscellaneous Control registers definition.
--- include/dt-bindings/display/sm501.h | 76 +++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 include/dt-bindings/display/sm501.h
include/dt-bindings/display/sm501.h new file +76 -0
@@ -0,0 +1,76 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */ +#ifndef __DT_BINDING_DISPALY_SM501__ +#define __DT_BINDING_DISPALY_SM501__ + +/* Miscellaneous Conntrol */ +#define SM501_MISC_CONTROL_PAD_24 0 +#define SM501_MISC_CONTROL_PAD_12 1 +#define SM501_MISC_CONTROL_PAD_8 2 + +#define SM501_MISC_CONTROL_USBCLK_XTAL 0 +#define SM501_MISC_CONTROL_USBCLK_96MHZ 1 +#define SM501_MISC_CONTROL_USBCLK_48MHZ 2 + +#define SM501_MISC_CONTROL_RFSH_8US 0 +#define SM501_MISC_CONTROL_RFSH_16US 1 +#define SM501_MISC_CONTROL_RFSH_32US 2 +#define SM501_MISC_CONTROL_RFSH_64US 3 + +#define SM501_MISC_CONTROL_HOLD_EMPTY 0 +#define SM501_MISC_CONTROL_HOLD_8TR 1 +#define SM501_MISC_CONTROL_HOLD_16TR 2 +#define SM501_MISC_CONTROL_HOLD_24TR 3 +#define SM501_MISC_CONTROL_HOLD_32TR 4 + +/* Miscellaneous timing */ +#define SM501_MISC_TIMING_EX_HOLD_0 0 +#define SM501_MISC_TIMING_EX_HOLD_16 1 +#define SM501_MISC_TIMING_EX_HOLD_32 2 +#define SM501_MISC_TIMING_EX_HOLD_48 3 +#define SM501_MISC_TIMING_EX_HOLD_64 4 +#define SM501_MISC_TIMING_EX_HOLD_80 5 +#define SM501_MISC_TIMING_EX_HOLD_96 6 +#define SM501_MISC_TIMING_EX_HOLD_112 7 +#define SM501_MISC_TIMING_EX_HOLD_128 8 +#define SM501_MISC_TIMING_EX_HOLD_144 9 +#define SM501_MISC_TIMING_EX_HOLD_160 10 +#define SM501_MISC_TIMING_EX_HOLD_176 11 +#define SM501_MISC_TIMING_EX_HOLD_192 12 +#define SM501_MISC_TIMING_EX_HOLD_208 13 +#define SM501_MISC_TIMING_EX_HOLD_224 14 +#define SM501_MISC_TIMING_EX_HOLD_240 15 + +#define SM501_MISC_TIMING_XC_INTERNAL 0 +#define SM501_MISC_TIMING_XC_HCLK 1 +#define SM501_MISC_TIMING_XC_GPIO 2 + +#define SM501_MISC_TIMING_SM_DIV1 0 +#define SM501_MISC_TIMING_SM_DIV2 1 +#define SM501_MISC_TIMING_SM_DIV4 2 +#define SM501_MISC_TIMING_SM_DIV8 3 +#define SM501_MISC_TIMING_SM_DIV16 4 +#define SM501_MISC_TIMING_SM_DIV32 5 +#define SM501_MISC_TIMING_SM_DIV64 6 +#define SM501_MISC_TIMING_SM_DIV128 7 +#define SM501_MISC_TIMING_SM_DIV3 8 +#define SM501_MISC_TIMING_SM_DIV6 9 +#define SM501_MISC_TIMING_SM_DIV12 10 +#define SM501_MISC_TIMING_SM_DIV24 11 +#define SM501_MISC_TIMING_SM_DIV48 12 +#define SM501_MISC_TIMING_SM_DIV96 13 +#define SM501_MISC_TIMING_SM_DIV192 14 +#define SM501_MISC_TIMING_SM_DIV384 15 + +#define SM501_MISC_TIMING_DIV336MHZ 0 +#define SM501_MISC_TIMING_DIV288MHZ 1 +#define SM501_MISC_TIMING_DIV240MHZ 2 +#define SM501_MISC_TIMING_DIV192MHZ 3 + +#define SM501_MISC_TIMING_DELAY_NONE 0 +#define SM501_MISC_TIMING_DELAY_0_5 1 +#define SM501_MISC_TIMING_DELAY_1_0 2 +#define SM501_MISC_TIMING_DELAY_1_5 3 +#define SM501_MISC_TIMING_DELAY_2_0 4 +#define SM501_MISC_TIMING_DELAY_2_5 5 + +#endif
Signature · 1 line
2.39.2
Niklas Cassel
maintainerQuoted 7 lines · Yoshinori Sato
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.You can get it working with qemu found here.
https://gitlab.com/yoshinori.sato/qemu/-/tree/landisk
Why send this as one huge series?
These are the mailing lists that you have on CC:
linux-ide, devicetree, linux-kernel,
linux-renesas-soc, linux-clk, dri-devel,
linux-pci, linux-serial, linux-fbdev
I really think that you will be able to get all these changes accepted much faster if you split this series in to one series per subsystem/mailing list.
Kind regards,
Niklas
Quoted 4 lines · Yoshinori Sato
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.
My comments/questions from
https://lore.kernel.org/r/20231120181600.GA205977@bhelgaas
https://lore.kernel.org/r/20231016172742.GA1215127@bhelgaas
still apply.
Quoted 9 lines · Yoshinori Sato
Sorry. previus mail is thread broken.
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.You can get it working with qemu found here.
https://gitlab.com/yoshinori.sato/qemu/-/tree/landisk
I was hoping to get a device tree kernel to boot with static device tree on the existing linux-sh qemu. (The main new features I want from an updated sh4 qemu are a working battery backed up clock and more physical memory...)
Is there somewhere I can get the kernel patch list in git or something? I haven't got tooling set up to conveniently fish 37 patches out of an mbox file, and would like to test this. (I moved last month and my physical sh7751 hardware is in a storage container.)
Thanks,
Rob
Hi Rob,
Quoted 9 lines · Rob Landley
Quoted 7 lines · Yoshinori Sato
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.You can get it working with qemu found here.
https://gitlab.com/yoshinori.sato/qemu/-/tree/landisk
Quoted 8 lines
I was hoping to get a device tree kernel to boot with static device tree on the existing linux-sh qemu. (The main new features I want from an updated sh4 qemu are a working battery backed up clock and more physical memory...)
Is there somewhere I can get the kernel patch list in git or something? I haven't got tooling set up to conveniently fish 37 patches out of an mbox file, and would like to test this. (I moved last month and my physical sh7751 hardware is in a storage container.)
b4 am fe69e328ec617f91a09fa2d00506ba1a664085d8.1712207606.git.ysato@users.sourceforge.jp git am ./v7_20240404_ysato_sh_passing_fdt_address_to_kernel_startup.mbx
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
Quoted 16 lines · Geert Uytterhoeven
Hi Rob,
Quoted 13 lines · Rob Landley
Quoted 7 lines · Yoshinori Sato
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.You can get it working with qemu found here.
https://gitlab.com/yoshinori.sato/qemu/-/tree/landiskI was hoping to get a device tree kernel to boot with static device tree on the existing linux-sh qemu. (The main new features I want from an updated sh4 qemu are a working battery backed up clock and more physical memory...)
Quoted 7 lines
Quoted 4 lines
Is there somewhere I can get the kernel patch list in git or something? I haven't got tooling set up to conveniently fish 37 patches out of an mbox file, and would like to test this. (I moved last month and my physical sh7751 hardware is in a storage container.)
b4 am fe69e328ec617f91a09fa2d00506ba1a664085d8.1712207606.git.ysato@users.sourceforge.jp git am ./v7_20240404_ysato_sh_passing_fdt_address_to_kernel_startup.mbx
$ b4 bash: b4: command not found $ aptitude show b4 E: Unable to locate package b4 $ aptitude search b4 p b43-fwcutter - utility for extracting Broadcom 43xx firmw ...
Let's see, google says it's a random python3 tool, probably wants a newer python3 version than I've got because everything that uses python3 does, it says "you can run it directly from the git repository"...
$ ./b4.sh
Traceback (most recent call last):
File "/home/landley/b4/src/b4/command.py", line 10, in <module>
import b4
File "/home/landley/b4/src/b4/__init__.py", line 37, in <module>
from typing import Optional, Tuple, Set, List, BinaryIO, Union, Sequence,
Literal, Iterator, Dict
ImportError: cannot import name 'Literal' from 'typing'
(/usr/lib/python3.7/typing.py)Oh well. Good luck with your patches, hope it works out.
Rob
John Paul Adrian Glaubitz
maintainerQuoted 7 lines · Rob Landley
$ b4 bash: b4: command not found $ aptitude show b4 E: Unable to locate package b4 $ aptitude search b4 p b43-fwcutter - utility for extracting Broadcom 43xx firmw ...
glaubitz@z6:~> dpkg -S which b4
b4: /usr/bin/b4
glaubitz@z6:~> apt show b4
Package: b4
Version: 0.12.0-2
Priority: optional
Section: python
Maintainer: Héctor Orón Martínez <[email protected]>
Installed-Size: 373 kB
Depends: python3-dkim (>= 1.0.5), python3-dnspython (>= 2.1.0), python3-requests (>= 2.24.0), python3-patatt (>= 0.6.3), git-filter-repo (>= 2.30), python3:any
Homepage: https://git.kernel.org/pub/scm/utils/b4/b4.git
Download-Size: 76.6 kB
APT-Manual-Installed: yes
APT-Sources: http://ftp.debian.org/debian bookworm/main amd64 Packages
Description: helper utility to work with patches made available via a public-inbox archive
This is a helper utility to work with patches made available via a
public-inbox archive like lore.kernel.org. It is written to make it
easier to participate in a patch-based workflows, like those used in
the Linux kernel development.
.
This package installs the application and library for Python 3.
glaubitz@z6:~>
Alternatively, install it via pip:
glaubitz@z6:~> pip install --user --break-system-packages b4
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Hi Rob,
Quoted 25 lines · Rob Landley
Quoted 14 lines · Geert Uytterhoeven
Quoted 13 lines · Rob Landley
Quoted 7 lines · Yoshinori Sato
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.You can get it working with qemu found here.
https://gitlab.com/yoshinori.sato/qemu/-/tree/landiskI was hoping to get a device tree kernel to boot with static device tree on the existing linux-sh qemu. (The main new features I want from an updated sh4 qemu are a working battery backed up clock and more physical memory...)
Quoted 7 lines
Quoted 4 lines
Is there somewhere I can get the kernel patch list in git or something? I haven't got tooling set up to conveniently fish 37 patches out of an mbox file, and would like to test this. (I moved last month and my physical sh7751 hardware is in a storage container.)
b4 am fe69e328ec617f91a09fa2d00506ba1a664085d8.1712207606.git.ysato@users.sourceforge.jp git am ./v7_20240404_ysato_sh_passing_fdt_address_to_kernel_startup.mbx
$ b4 bash: b4: command not found
[...]
Quoted 1 line
Oh well. Good luck with your patches, hope it works out.
If you cannot/do not want to install b4, you can stick the Message-Id into lore, and download the mbox from
https://lore.kernel.org/all/fe69e328ec617f91a09fa2d00506ba1a664085d8.1712207606.git.ysato@users.sourceforge.jp
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
Quoted 4 lines · Rob Landley
Let's see, google says it's a random python3 tool, probably wants a newer python3 version than I've got because everything that uses python3 does, it says "you can run it directly from the git repository"...
Quoted 9 lines
$ ./b4.sh
Traceback (most recent call last):
File "/home/landley/b4/src/b4/command.py", line 10, in <module>
import b4
File "/home/landley/b4/src/b4/__init__.py", line 37, in <module>
from typing import Optional, Tuple, Set, List, BinaryIO, Union, Sequence,
Literal, Iterator, Dict
ImportError: cannot import name 'Literal' from 'typing'
(/usr/lib/python3.7/typing.py)Python 3.7 is EOL as of last June, which is why you're seeing this error trying to run the latest master branch.
To be able to use a EOL version of Python, you will need to run a contemporary release of b4, which is 0.11. To do so, you may check out the stable-0.11.y branch and repeat this operation.
-K
John Paul Adrian Glaubitz
maintainerQuoted 4 lines · Rob Landley
Is there somewhere I can get the kernel patch list in git or something? I haven't got tooling set up to conveniently fish 37 patches out of an mbox file, and would like to test this. (I moved last month and my physical sh7751 hardware is in a storage container.)
Try the tool "b4" which allows you to download the patch set as an mbox file.
The mbox file can be applied with "git am <mbox file>".
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
John Paul Adrian Glaubitz
maintainerHi Yoshinori,
Quoted 10 lines · Yoshinori Sato
Sorry. previus mail is thread broken.
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.You can get it working with qemu found here.
https://gitlab.com/yoshinori.sato/qemu/-/tree/landisk
Quoted 8 lines
v7 changes.
-sh/kernel/setup.c: fix kernel parameter handling.
-clk-sh7750.c: cleanup.
-sh_tmu.c: cleanup.
-irq-renesas-sh7751.c: IPR definition move to code.
-irq-renesas-sh7751irl.c: update register definition.
-pci-sh7751.c: Register initialization fix.
- sm501 and sm501fb: Re-design Device Tree properties.
Could you push your v7 version to your Gitlab [1] repository so I can fetch it from there?
Thanks,
Adrian
Quoted 1 line
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Yoshinori Sato
maintainerQuoted 23 lines · John Paul Adrian Glaubitz
Hi Yoshinori,
Quoted 10 lines · Yoshinori Sato
Sorry. previus mail is thread broken.
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.You can get it working with qemu found here.
https://gitlab.com/yoshinori.sato/qemu/-/tree/landiskQuoted 8 lines
v7 changes.
-sh/kernel/setup.c: fix kernel parameter handling.
-clk-sh7750.c: cleanup.
-sh_tmu.c: cleanup.
-irq-renesas-sh7751.c: IPR definition move to code.
-irq-renesas-sh7751irl.c: update register definition.
-pci-sh7751.c: Register initialization fix.
- sm501 and sm501fb: Re-design Device Tree properties.
Quoted 2 lines
Could you push your v7 version to your Gitlab [1] repository so I can fetch it from there?
updated it.
I'll be posting v8 soon.
Quoted 11 lines
Thanks,
AdrianQuoted 1 line
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Signature · 1 line
Yosinori Sato
John Paul Adrian Glaubitz
maintainerHi Yoshinori,
Quoted 25 lines · Yoshinori Sato
Quoted 23 lines · John Paul Adrian Glaubitz
Hi Yoshinori,
Quoted 18 lines · Yoshinori Sato
Sorry. previus mail is thread broken.
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.You can get it working with qemu found here.
https://gitlab.com/yoshinori.sato/qemu/-/tree/landiskv7 changes.
-sh/kernel/setup.c: fix kernel parameter handling.
-clk-sh7750.c: cleanup.
-sh_tmu.c: cleanup.
-irq-renesas-sh7751.c: IPR definition move to code.
-irq-renesas-sh7751irl.c: update register definition.
-pci-sh7751.c: Register initialization fix.
- sm501 and sm501fb: Re-design Device Tree properties.
Quoted 4 lines
Quoted 2 lines
Could you push your v7 version to your Gitlab [1] repository so I can fetch it from there?
updated it.
Thanks!
Quoted 1 line
I'll be posting v8 soon.
Sounds good! Maybe we can start merging the patches that contain fixes only and that have already been reviewed. This way, we can reduce the overall size of the series a bit.
Adrian
Signature · 4 lines
.''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Quoted 6 lines · John Paul Adrian Glaubitz
Quoted 1 line · Yoshinori Sato
I'll be posting v8 soon.
Sounds good! Maybe we can start merging the patches that contain fixes only and that have already been reviewed. This way, we can reduce the overall size of the series a bit.
+1
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