Skip to contentSkip to conversation

sh: LANDISK and R2Dplus convert to device tree

PATCH Superseded Yoshinori Sato 4 participants 27 messages Jun 28, 2016

Subsystems (7)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
author maintainer
#10 lore raw

PATCH v3 10/19 sh: SH7750/51 CPG Driver

In reply to Yoshinori Sato

Convert SH specific clock framework to CCF.

---
 .../bindings/clock/renesas,sh7750-cpg.txt          |  25 ++
 arch/sh/boards/Kconfig                             |   1 +
 arch/sh/kernel/cpu/Makefile                        |   8 +-
 arch/sh/kernel/cpu/clock.c                         |   6 +-
 drivers/clk/Kconfig                                |   1 +
 drivers/clk/Makefile                               |   3 +-
 drivers/clk/sh/Kconfig                             |   2 +
 drivers/clk/sh/Makefile                            |   1 +
 drivers/clk/sh/clk-sh7750cpg.c                     | 344 +++++++++++++++++++++
 9 files changed, 387 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/renesas,sh7750-cpg.txt
 create mode 100644 drivers/clk/sh/Kconfig
 create mode 100644 drivers/clk/sh/Makefile
 create mode 100644 drivers/clk/sh/clk-sh7750cpg.c
Documentation/devicetree/bindings/clock/renesas,sh7750-cpg.txt new file +25 -0
new file mode 100644
index 0000000..e763e2c
@@ -0,0 +1,25 @@
+* Renesas SH7750/51 CPG
+
+Required Properties:
+
+  - compatible: Must be "renesas,sh7750-cpg"
+
+  - clocks: Reference to the parent clocks (xtal or external)
+
+  - #clock-cells: Must be 1
+
+  - reg: Base address and length of the FREQCR
+         and Base address and length of the CLKSTP00 (optional)
+
+  - renesas,mult: PLL1 multiply rate
+
+Example
+-------
+
+        cpg: cpg@ffc00000 {
+                compatible = "renesas,sh7750-cpg";
+                clocks = <&oclk>;
+                #clock-cells = <1>;
+                renesas,mult = <12>;
+                reg = <0xffc00000 32>, <0xfe0a0000 16>;
+        };
arch/sh/boards/Kconfig +1 -0
index 9e4ccd0..b6ff9df 100644
@@ -13,6 +13,7 @@ config SH_DEVICE_TREE
 	select CLKSRC_OF
 	select GENERIC_CALIBRATE_DELAY
 	select GENERIC_IOMAP
+	select COMMON_CLK
 	help
 	  Select Board Described by Device Tree to build a kernel that
 	  does not hard-code any board-specific knowledge but instead uses
arch/sh/kernel/cpu/Makefile +6 -2
index accc7ca..22ad0ee 100644
@@ -16,6 +16,10 @@ obj-$(CONFIG_ARCH_SHMOBILE)	+= shmobile/
 # Common interfaces.
 
 obj-$(CONFIG_SH_ADC)		+= adc.o
+ifndef CONFIG_COMMON_CLK
 obj-$(CONFIG_SH_CLK_CPG_LEGACY)	+= clock-cpg.o
-
-obj-y	+= irq/ init.o clock.o fpu.o pfc.o proc.o
+endif
+ifndef CONFIG_GENERIC_IRQ_CHIP
+obj-y	+= irq/
+endif
+obj-y	+= init.o clock.o fpu.o pfc.o proc.o
arch/sh/kernel/cpu/clock.c +5 -1
index 4187cf4..8e66e23 100644
@@ -22,13 +22,15 @@
 
 int __init clk_init(void)
 {
-	int ret;
+	int ret = 0;
 
+#ifndef CONFIG_COMMON_CLK
 	ret = arch_clk_init();
 	if (unlikely(ret)) {
 		pr_err("%s: CPU clock registration failed.\n", __func__);
 		return ret;
 	}
+#endif
 
 	if (sh_mv.mv_clk_init) {
 		ret = sh_mv.mv_clk_init();
@@ -39,11 +41,13 @@ int __init clk_init(void)
 		}
 	}
 
+#ifndef CONFIG_COMMON_CLK
 	/* Kick the child clocks.. */
 	recalculate_root_clocks();
 
 	/* Enable the necessary init clocks */
 	clk_enable_init_clocks();
+#endif
 
 	return ret;
 }
drivers/clk/Kconfig +1 -0
index 98efbfc..60d19d0 100644
@@ -213,6 +213,7 @@ source "drivers/clk/mvebu/Kconfig"
 source "drivers/clk/qcom/Kconfig"
 source "drivers/clk/renesas/Kconfig"
 source "drivers/clk/samsung/Kconfig"
+source "drivers/clk/sh/Kconfig"
 source "drivers/clk/tegra/Kconfig"
 source "drivers/clk/ti/Kconfig"
 
drivers/clk/Makefile +2 -1
index dcc5e69..c4bfbb9 100644
@@ -86,5 +86,6 @@ obj-$(CONFIG_COMMON_CLK_VERSATILE)	+= versatile/
 obj-$(CONFIG_X86)			+= x86/
 obj-$(CONFIG_ARCH_ZX)			+= zte/
 obj-$(CONFIG_ARCH_ZYNQ)			+= zynq/
-obj-$(CONFIG_H8300)		+= h8300/
+obj-$(CONFIG_H8300)			+= h8300/
 obj-$(CONFIG_ARC_PLAT_AXS10X)		+= axs10x/
+obj-$(CONFIG_SUPERH)			+= sh/
drivers/clk/sh/Kconfig new file +2 -0
new file mode 100644
index 0000000..2090415
@@ -0,0 +1,2 @@
+config COMMON_CLK_SH7750
+	bool "CPG driver for SH7750/SH7751"
drivers/clk/sh/Makefile new file +1 -0
new file mode 100644
index 0000000..7ce4da3
@@ -0,0 +1 @@
+obj-$(CONFIG_COMMON_CLK_SH7750) += clk-sh7750cpg.o
drivers/clk/sh/clk-sh7750cpg.c new file +344 -0

344 lines not on this page · raw message

Signature · 1 line
2.7.0
author maintainer
#12 lore raw

PATCH v3 11/19 sh: Add PCI host bridge driver for SH7751

In reply to Yoshinori Sato

This is an alternative SH7751 PCI driver.
Existing driver (arch/sh/drivers/pci/pci-sh7751) uses SH specific interface. But this driver uses common PCI interface. It is more modern and generic.

---
 .../devicetree/bindings/pci/sh7751-pci.txt         |  51 ++++
 arch/sh/boards/Kconfig                             |   1 +
 arch/sh/drivers/Makefile                           |   2 +
 arch/sh/include/asm/io.h                           |   6 +
 drivers/pci/host/Kconfig                           |   7 +
 drivers/pci/host/Makefile                          |   1 +
 drivers/pci/host/pci-sh7751.c                      | 326 +++++++++++++++++++++
 7 files changed, 394 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pci/sh7751-pci.txt
 create mode 100644 drivers/pci/host/pci-sh7751.c
Documentation/devicetree/bindings/pci/sh7751-pci.txt new file +51 -0
new file mode 100644
index 0000000..c3ec71a
@@ -0,0 +1,51 @@
+* Renesas SH7751 PCI host interfaces
+
+Required properties:
+  - compatible: "renesas,sh7751-pci" is required.
+    And board specific compatible if fixup required.
+
+  - reg: base address and length of the PCI controller registers.
+  - #address-cells: set to <2>
+  - #size-cells: set to <1>
+  - bus-range: PCI bus numbers covered
+  - device_type: set to "pci"
+  - ranges: ranges for the PCI memory and I/O regions.
+  - interrupt-map-mask and interrupt-map: standard PCI properties
+	to define the mapping of the PCI interface to interrupt
+	numbers.
+
+Example:
+	pci: pci-controller@fe200000 {
+		compatible = "renesas,sh7751-pci", "iodata,landisk";
+		device_type = "pci";
+		bus-range = <0 0>;
+		#address-cells = <2>;
+		#size-cells = <1>;
+		ranges = <0x02000000 0x00000000 0xfd000000 0xfd000000 0x00000000 0x01000000>,
+		         <0x01000000 0x00000000 0xfe240000 0x00000000 0x00000000 0x00040000>;
+		reg = <0xfe200000 0x0400>,
+		      <0x0c000000 0x04000000>,
+		      <0xff800000 0x0030>;
+		#interrupt-cells = <1>;
+		interrupt-map-mask = <0x1800 0 7>;
+		interrupt-map = <0x0000 0 1 &cpldintc evt2irq(0x2a0) 0
+		                 0x0000 0 2 &cpldintc evt2irq(0x2c0) 0
+		                 0x0000 0 3 &cpldintc evt2irq(0x2e0) 0
+		                 0x0000 0 4 &cpldintc evt2irq(0x300) 0
+
+		                 0x0800 0 1 &cpldintc evt2irq(0x2c0) 0
+		                 0x0800 0 2 &cpldintc evt2irq(0x2e0) 0
+		                 0x0800 0 3 &cpldintc evt2irq(0x300) 0
+		                 0x0800 0 4 &cpldintc evt2irq(0x2a0) 0
+
+		                 0x1000 0 1 &cpldintc evt2irq(0x2e0) 0
+		                 0x1000 0 2 &cpldintc evt2irq(0x300) 0
+		                 0x1000 0 3 &cpldintc evt2irq(0x2a0) 0
+		                 0x1000 0 4 &cpldintc evt2irq(0x2c0) 0
+
+		                 0x1800 0 1 &cpldintc evt2irq(0x300) 0
+		                 0x1800 0 2 &cpldintc evt2irq(0x2a0) 0
+		                 0x1800 0 3 &cpldintc evt2irq(0x2c0) 0
+		                 0x1800 0 4 &cpldintc evt2irq(0x2e0) 0>;
+	};
+};
arch/sh/boards/Kconfig +1 -0
index b6ff9df..cfde921 100644
@@ -14,6 +14,7 @@ config SH_DEVICE_TREE
 	select GENERIC_CALIBRATE_DELAY
 	select GENERIC_IOMAP
 	select COMMON_CLK
+	select SYS_SUPPORTS_PCI
 	help
 	  Select Board Described by Device Tree to build a kernel that
 	  does not hard-code any board-specific knowledge but instead uses
arch/sh/drivers/Makefile +2 -0
index e13f06b..382e86f 100644
@@ -4,7 +4,9 @@
 
 obj-y		+= dma/
 
+ifndef CONFIG_SH_DEVICE_TREE
 obj-$(CONFIG_PCI)		+= pci/
+endif
 obj-$(CONFIG_SUPERHYWAY)	+= superhyway/
 obj-$(CONFIG_PUSH_SWITCH)	+= push-switch.o
 obj-$(CONFIG_HEARTBEAT)		+= heartbeat.o
arch/sh/include/asm/io.h +6 -0
index 3280a6b..df62a9f 100644
@@ -387,6 +387,12 @@ static inline int iounmap_fixed(void __iomem *addr) { return -EINVAL; }
 int valid_phys_addr_range(phys_addr_t addr, size_t size);
 int valid_mmap_phys_addr_range(unsigned long pfn, size_t size);
 
+#define PCI_IOBASE	0xfe240000UL
+
+#define HAVE_ARCH_PIO_SIZE
+#define PIO_OFFSET	PCI_IOBASE
+#define PIO_MASK	0x3ffffUL
+#define PIO_RESERVED	0x40000UL
 #endif /* __KERNEL__ */
 
 #endif /* __ASM_SH_IO_H */
drivers/pci/host/Kconfig +7 -0
index 5d2374e..df60505 100644
@@ -245,4 +245,11 @@ config PCIE_ARMADA_8K
 	  Designware hardware and therefore the driver re-uses the
 	  Designware core functions to implement the driver.
 
+config PCI_SH7751
+	bool "Renesas SH7751 On-Chip PCI controller"
+	depends on OF && SUPERH
+	select PCI_HOST_COMMON
+	help
+	  Say Y here if you want PCI support on SH7751.
+
 endmenu
drivers/pci/host/Makefile +1 -0
index 9c8698e..4681e49 100644
@@ -29,3 +29,4 @@ obj-$(CONFIG_PCIE_QCOM) += pcie-qcom.o
 obj-$(CONFIG_PCI_HOST_THUNDER_ECAM) += pci-thunder-ecam.o
 obj-$(CONFIG_PCI_HOST_THUNDER_PEM) += pci-thunder-pem.o
 obj-$(CONFIG_PCIE_ARMADA_8K) += pcie-armada8k.o
+obj-$(CONFIG_PCI_SH7751) += pci-sh7751.o
drivers/pci/host/pci-sh7751.c new file +326 -0

326 lines not on this page · raw message

Signature · 1 line
2.7.0
author maintainer
#14 lore raw

PATCH v3 12/19 sh: irqchip: SH7751 IRQCHIP Driver

In reply to Yoshinori Sato
---
 .../interrupt-controller/renesas,sh7751-intc.txt   |  25 ++++
 arch/sh/Kconfig                                    |   6 +-
 arch/sh/boards/Kconfig                             |   1 +
 drivers/irqchip/Kconfig                            |   5 +
 drivers/irqchip/Makefile                           |   1 +
 drivers/irqchip/irq-renesas-sh7751.c               | 141 +++++++++++++++++++++
 6 files changed, 176 insertions(+), 3 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,sh7751-intc.txt
 create mode 100644 drivers/irqchip/irq-renesas-sh7751.c
Documentation/devicetree/bindings/interrupt-controller/renesas,sh7751-intc.txt new file +25 -0
new file mode 100644
index 0000000..2bc6f22f
@@ -0,0 +1,25 @@
+DT bindings for the SH7751 interrupt controller
+
+Required properties:
+
+  - compatible: has to be "renesas,sh7751-intc".
+
+  - reg: Base address and length of interrupt controller register
+         and extend register.
+
+  - interrupt-controller: Identifies the node as an interrupt controller.
+
+  - #interrupt-cells: has to be <2>: an interrupt index and flags, as defined
+    in interrupts.txt in this directory.
+
+Example
+-------
+
+	shintc: interrupt-controller@ffd00000 {
+		compatible = "renesas,sh7751-intc";
+		#interrupt-cells = <2>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		interrupt-controller;
+		reg = <0xffd00000 14>, <0xfe080000 128>;
+	};
arch/sh/Kconfig +3 -3
index d06cac1..fee4333 100644
@@ -29,7 +29,7 @@ config SUPERH
 	select ARCH_WANT_IPC_PARSE_VERSION
 	select HAVE_SYSCALL_TRACEPOINTS
 	select HAVE_REGS_AND_STACK_ACCESS_API
-	select MAY_HAVE_SPARSE_IRQ
+	select MAY_HAVE_SPARSE_IRQ if !SH_DEVICE_TREE
 	select IRQ_FORCED_THREADING
 	select RTC_LIB
 	select GENERIC_ATOMIC64
@@ -69,7 +69,7 @@ config SUPERH32
 	select HAVE_MIXED_BREAKPOINTS_REGS
 	select PERF_EVENTS
 	select ARCH_HIBERNATION_POSSIBLE if MMU
-	select SPARSE_IRQ
+	select SPARSE_IRQ if !SH_DEVICE_TREE
 	select HAVE_CC_STACKPROTECTOR
 
 config SUPERH64
@@ -863,7 +863,7 @@ config PCI
 	depends on SYS_SUPPORTS_PCI
 	select PCI_DOMAINS
 	select GENERIC_PCI_IOMAP
-	select NO_GENERIC_PCI_IOPORT_MAP
+	select NO_GENERIC_PCI_IOPORT_MAP if !SH_DEVICE_TREE
 	help
 	  Find out whether you have a PCI motherboard. PCI is the name of a
 	  bus system, i.e. the way the CPU talks to the other stuff inside
arch/sh/boards/Kconfig +1 -0
index cfde921..d33ae46 100644
@@ -15,6 +15,7 @@ config SH_DEVICE_TREE
 	select GENERIC_IOMAP
 	select COMMON_CLK
 	select SYS_SUPPORTS_PCI
+	select GENERIC_IRQ_CHIP
 	help
 	  Select Board Described by Device Tree to build a kernel that
 	  does not hard-code any board-specific knowledge but instead uses
drivers/irqchip/Kconfig +5 -0
index fa33c50..fd7f842 100644
@@ -251,6 +251,11 @@ config LS_SCFG_MSI
 	depends on PCI && PCI_MSI
 	select PCI_MSI_IRQ_DOMAIN
 
+config RENESAS_SH_INTC
+	def_bool y if SH_DEVICE_TREE
+	select IRQ_DOMAIN
+	select IRQ_DOMAIN_HIERARCHY
+
 config PARTITION_PERCPU
 	bool
 
drivers/irqchip/Makefile +1 -0
index 38853a1..2ab5735 100644
@@ -69,3 +69,4 @@ obj-$(CONFIG_PIC32_EVIC)		+= irq-pic32-evic.o
 obj-$(CONFIG_MVEBU_ODMI)		+= irq-mvebu-odmi.o
 obj-$(CONFIG_LS_SCFG_MSI)		+= irq-ls-scfg-msi.o
 obj-$(CONFIG_EZNPS_GIC)			+= irq-eznps.o
+obj-$(CONFIG_RENESAS_SH_INTC)		+= irq-renesas-sh7751.o
drivers/irqchip/irq-renesas-sh7751.c new file +141 -0

141 lines not on this page · raw message

Signature · 1 line
2.7.0
author maintainer
#16 lore raw

PATCH v3 13/19 sh: SH7751 core dtsi

In reply to Yoshinori Sato
---
 arch/sh/boot/dts/sh7751.dtsi                       | 85 ++++++++++++++++++++++
 include/dt-bindings/clock/renesas-sh7750.h         | 26 +++++++
 include/dt-bindings/interrupt-controller/sh_intc.h |  2 +
 3 files changed, 113 insertions(+)
 create mode 100644 arch/sh/boot/dts/sh7751.dtsi
 create mode 100644 include/dt-bindings/clock/renesas-sh7750.h
 create mode 100644 include/dt-bindings/interrupt-controller/sh_intc.h
arch/sh/boot/dts/sh7751.dtsi new file +85 -0
new file mode 100644
index 0000000..07179b2
@@ -0,0 +1,85 @@
+/*
+ * Device Tree Source for the SH7751
+ *
+ * Copyright (C) 2016 Yoshinori Sato
+ */
+
+#include <dt-bindings/interrupt-controller/sh_intc.h>
+#include <dt-bindings/clock/renesas-sh7750.h>
+
+/ {
+	oclk: oscillator {
+                #clock-cells = <0>;
+                compatible = "fixed-clock";
+                clock-frequency = <0>;
+        };
+	cpg: cpg@ffc00000 {
+                compatible = "renesas,sh7750-cpg";
+                clocks = <&oclk>;
+                #clock-cells = <1>;
+		renesas,mult = <12>;
+                reg = <0xffc00000 32>, <0xfe0a0000 16>;
+        };
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		cpu@0 {
+		      compatible = "renesas,sh4", "renesas,sh";
+		      clock-frequency = <266666666>;
+		};
+	};
+	shintc: interrupt-controller@ffd00000 {
+		compatible = "renesas,sh7751-intc";
+		#interrupt-cells = <2>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		interrupt-controller;
+		reg = <0xffd00000 14>, <0xfe080000 128>;
+
+	};
+	sci0: serial@ffe00000 {
+		compatible = "renesas,sci";
+		reg = <0xffe00000 0x20>;
+		interrupts = <evt2irq(0x4e0) 0
+		              evt2irq(0x500) 0
+		              evt2irq(0x540) 0
+		              evt2irq(0x520) 0>;
+		clocks = <&cpg SH7750_CLK_SCI>;
+		clock-names = "fck";
+		status = "disabled";
+	};
+	sci1: serial@ffe80000 {
+		compatible = "renesas,scif";
+		reg = <0xffe80000 0x100>;
+		interrupts = <evt2irq(0x700) 0
+			      evt2irq(0x720) 0
+			      evt2irq(0x760) 0
+			      evt2irq(0x740) 0>;
+		clocks = <&cpg SH7750_CLK_SCIF>;
+		clock-names = "fck";
+		status = "disabled";
+	};
+	tmu: timer@ffd80000 {
+		compatible = "renesas,tmu";
+		reg = <0xffd80000 12>;
+		interrupts = <evt2irq(0x400) 0
+			      evt2irq(0x420) 0
+			      evt2irq(0x440) 0>;
+		clocks = <&cpg SH7750_CLK_TMU0>;
+		clock-names = "fck";
+		renesas,channels-mask = <0x03>;
+	};
+	pci: pci-controller@fe200000 {
+		compatible = "renesas,sh7751-pci";
+		device_type = "pci";
+		bus-range = <0 0>;
+		#address-cells = <2>;
+		#size-cells = <1>;
+		ranges = <0x02000000 0x00000000 0xfd000000 0xfd000000 0x00000000 0x01000000>,
+		         <0x01000000 0x00000000 0xfe240000 0x00000000 0x00000000 0x00040000>;
+		reg = <0xfe200000 0x0400>, <0xff800000 0x0030>;
+		#interrupt-cells = <1>;
+		interrupt-map-mask = <0x1800 0 7>;
+		status = "disabled";
+	};
+}; 
\ No newline at end of file
include/dt-bindings/clock/renesas-sh7750.h new file +26 -0
new file mode 100644
index 0000000..546c0b1
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2016 Yoshinori Sato
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+#ifndef __DT_BINDINGS_CLOCK_RENESAS_SH7750_H__
+#define __DT_BINDINGS_CLOCK_RENESAS_SH7750_H__
+
+#define SH7750_CLK_SCI	0
+#define SH7750_CLK_RTC	1
+#define SH7750_CLK_TMU0	2
+#define SH7750_CLK_TMU1	3
+#define SH7750_CLK_TMU2	4
+#define SH7750_CLK_SCIF	5
+#define SH7750_CLK_DMAC	6
+#define SH7750_CLK_UBC	7
+#define SH7750_CLK_SQ	8
+#define SH7750_CLK_INTC 9
+#define SH7750_CLK_TMU3	10
+#define SH7750_CLK_TMU4	11
+#define SH7750_CLK_PCIC	12
+
+#endif /* __DT_BINDINGS_CLOCK_RENESAS_CPG_MSSR_H__ */
include/dt-bindings/interrupt-controller/sh_intc.h new file +2 -0
new file mode 100644
index 0000000..8c9dcdc
@@ -0,0 +1,2 @@
+#define evt2irq(evt)		(((evt) >> 5) - 16)
+#define irq2evt(irq)		(((irq) + 16) << 5)
Signature · 1 line
2.7.0
author maintainer
#17 lore raw

PATCH v3 14/19 sh: Move common PCI stuff to arch/sh/kernel

In reply to Yoshinori Sato
---
 arch/sh/drivers/pci/Makefile |   2 -
 arch/sh/drivers/pci/common.c | 162 --------------------
 arch/sh/drivers/pci/pci.c    | 320 ----------------------------------------
 arch/sh/kernel/Makefile      |   2 +
 arch/sh/kernel/pci-common.c  | 162 ++++++++++++++++++++
 arch/sh/kernel/pci.c         | 342 +++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 506 insertions(+), 484 deletions(-)
 delete mode 100644 arch/sh/drivers/pci/common.c
 delete mode 100644 arch/sh/drivers/pci/pci.c
 create mode 100644 arch/sh/kernel/pci-common.c
 create mode 100644 arch/sh/kernel/pci.c
arch/sh/drivers/pci/Makefile +0 -2
index 82f0a33..fffbede 100644
@@ -1,8 +1,6 @@
 #
 # Makefile for the PCI specific kernel interface routines under Linux.
 #
-obj-y					+= common.o pci.o
-
 obj-$(CONFIG_CPU_SUBTYPE_SH7751)	+= pci-sh7751.o ops-sh4.o
 obj-$(CONFIG_CPU_SUBTYPE_SH7751R)	+= pci-sh7751.o ops-sh4.o
 obj-$(CONFIG_CPU_SUBTYPE_SH7763)	+= pci-sh7780.o ops-sh4.o
arch/sh/drivers/pci/common.c deleted +0 -161

161 lines not on this page · raw message

arch/sh/drivers/pci/pci.c deleted +0 -320

320 lines not on this page · raw message

arch/sh/kernel/Makefile +2 -0
index 09040fd..a9a54c2 100644
@@ -46,5 +46,7 @@ obj-$(CONFIG_DWARF_UNWINDER)	+= dwarf.o
 obj-$(CONFIG_PERF_EVENTS)	+= perf_event.o perf_callchain.o
 
 obj-$(CONFIG_HAVE_HW_BREAKPOINT)		+= hw_breakpoint.o
+obj-$(CONFIG_PCI)		+= pci.o pci-common.o
 
 ccflags-y := -Werror
+CFLAGS_pci.o := -O0
arch/sh/kernel/pci-common.c new file +161 -0

161 lines not on this page · raw message

arch/sh/kernel/pci.c new file +342 -0

342 lines not on this page · raw message

Signature · 1 line
2.7.0
author maintainer
#18 lore raw

PATCH v3 15/19 pci: pci_config_window move to linux/pci.h

In reply to Yoshinori Sato
---
 drivers/pci/ecam.h  | 17 +----------------
 include/linux/pci.h | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 16 deletions(-)
drivers/pci/ecam.h +1 -16
index 9878beb..f110091 100644
@@ -18,6 +18,7 @@
 
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
+#include <linux/pci.h>
 
 /*
  * struct to hold pci ops and bus shift of the config window
@@ -31,22 +32,6 @@ struct pci_ecam_ops {
 						struct pci_config_window *);
 };
 
-/*
- * struct to hold the mappings of a config space window. This
- * is expected to be used as sysdata for PCI controllers that
- * use ECAM.
- */
-struct pci_config_window {
-	struct resource			res;
-	struct resource			busr;
-	void				*priv;
-	struct pci_ecam_ops		*ops;
-	union {
-		void __iomem		*win;	/* 64-bit single mapping */
-		void __iomem		**winp; /* 32-bit per-bus mapping */
-	};
-};
-
 /* create and free pci_config_window */
 struct pci_config_window *pci_ecam_create(struct device *dev,
 		struct resource *cfgres, struct resource *busr,
include/linux/pci.h +18 -0
index b67e4df..398896f 100644
@@ -2026,6 +2026,24 @@ static inline bool pci_ari_enabled(struct pci_bus *bus)
 	return bus->self && bus->self->ari_enabled;
 }
 
+/*
+ * struct to hold the mappings of a config space window. This
+ * is expected to be used as sysdata for PCI controllers that
+ * use ECAM.
+ */
+struct pci_ecam_ops;
+
+struct pci_config_window {
+	struct resource			res;
+	struct resource			busr;
+	void				*priv;
+	struct pci_ecam_ops		*ops;
+	union {
+		void __iomem		*win;	/* 64-bit single mapping */
+		void __iomem		**winp; /* 32-bit per-bus mapping */
+	};
+};
+
 /* provide the legacy pci_dma_* API */
 #include <linux/pci-dma-compat.h>
 
Signature · 1 line
2.7.0
author maintainer
#20 lore raw

PATCH v3 17/19 sh: Add separate DTB build rule

In reply to Yoshinori Sato
---
 arch/sh/Makefile          | 7 +++++++
 arch/sh/boot/dts/Makefile | 2 ++
 2 files changed, 9 insertions(+)
arch/sh/Makefile +7 -0
index 8adffa8..a44e630 100644
@@ -189,6 +189,13 @@ drivers-$(CONFIG_OPROFILE)	+= arch/sh/oprofile/
 
 boot := arch/sh/boot
 
+%.dtb %.dtb.S %.dtb.o: | scripts
+	$(Q)$(MAKE) $(build)=arch/sh/boot/dts arch/sh/boot/dts/$@
+
+PHONY += dtbs
+dtbs: scripts
+	$(Q)$(MAKE) $(build)=arch/sh/boot/dts
+
 cflags-y	+= $(foreach d, $(cpuincdir-y), -Iarch/sh/include/$(d)) \
 		   $(foreach d, $(machdir-y), -Iarch/sh/include/$(d))
 
arch/sh/boot/dts/Makefile +2 -0
index e5ce3a0..38fdc38 100644
@@ -1,3 +1,5 @@
 obj-$(CONFIG_USE_BUILTIN_DTB) += $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_SOURCE)).dtb.o
 
+dtstree		:= $(srctree)/$(src)
 clean-files := *.dtb.S
+always	    := $(dtb-y)
Signature · 1 line
2.7.0
author maintainer
#21 lore raw

PATCH v3 18/19 sh: IO-DATA HDL-U (a,k.a landisk) support

In reply to Yoshinori Sato
---
 .../interrupt-controller/iodata-landisk.txt        | 34 ++++++++++
 arch/sh/boot/dts/Makefile                          |  2 +
 arch/sh/boot/dts/landisk.dts                       | 62 ++++++++++++++++++
 drivers/irqchip/Makefile                           |  2 +-
 drivers/irqchip/irq-io-landisk.c                   | 73 ++++++++++++++++++++++
 5 files changed, 172 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/iodata-landisk.txt
 create mode 100644 arch/sh/boot/dts/landisk.dts
 create mode 100644 drivers/irqchip/irq-io-landisk.c
Documentation/devicetree/bindings/interrupt-controller/iodata-landisk.txt new file +34 -0
new file mode 100644
index 0000000..9f87f2c
@@ -0,0 +1,34 @@
+DT bindings for the I/O DATA HDL-U interrupt controller
+
+Required properties:
+
+  - compatible: has to be "iodata,landisk-intc".
+
+  - reg: Base address and length of interrupt controller register.
+
+  - interrupt-controller: Identifies the node as an interrupt controller.
+
+  - #address-cells: has to be <0>.
+
+  - #interrupt-cells: has to be <1>: an interrupt index.
+
+  - interrupt-map: Interrupt mapping on parent controller.
+
+Example
+-------
+
+	cpldintc: cpld@b0000000 {
+		compatible = "iodata,landisk-intc";
+		#address-cells = <0>;
+		#interrupt-cells = <1>;
+		interrupt-controller;
+		reg = <0xb0000000 8>;
+		interrupt-map=<0 &shintc evt2irq(0x2a0)>,
+		              <1 &shintc evt2irq(0x2c0)>,
+		              <2 &shintc evt2irq(0x2e0)>,
+			      <3 &shintc evt2irq(0x300)>,
+		              <4 &shintc evt2irq(0x320)>,
+			      <5 &shintc evt2irq(0x340)>,
+		              <6 &shintc evt2irq(0x360)>,
+			      <7 &shintc evt2irq(0x380)>;
+	};
arch/sh/boot/dts/Makefile +2 -0
index 38fdc38..cf5aec4 100644
@@ -1,5 +1,7 @@
 obj-$(CONFIG_USE_BUILTIN_DTB) += $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_SOURCE)).dtb.o
 
+dtb-y += landisk.dtb
+
 dtstree		:= $(srctree)/$(src)
 clean-files := *.dtb.S
 always	    := $(dtb-y)
arch/sh/boot/dts/landisk.dts new file +62 -0

62 lines not on this page · raw message

drivers/irqchip/Makefile +1 -1
index 2ab5735..5e225cf 100644
@@ -69,4 +69,4 @@ obj-$(CONFIG_PIC32_EVIC)		+= irq-pic32-evic.o
 obj-$(CONFIG_MVEBU_ODMI)		+= irq-mvebu-odmi.o
 obj-$(CONFIG_LS_SCFG_MSI)		+= irq-ls-scfg-msi.o
 obj-$(CONFIG_EZNPS_GIC)			+= irq-eznps.o
-obj-$(CONFIG_RENESAS_SH_INTC)		+= irq-renesas-sh7751.o
+obj-$(CONFIG_RENESAS_SH_INTC)		+= irq-renesas-sh7751.o irq-io-landisk.o
drivers/irqchip/irq-io-landisk.c new file +73 -0

73 lines not on this page · raw message

Signature · 1 line
2.7.0
author maintainer
#25 lore raw

PATCH v3 19/19 sh: Renesas R0P751RLC0011RL (a.k.a R2Dplus) support

In reply to Yoshinori Sato
---
 .../interrupt-controller/renesas-r2dplus.txt       | 41 ++++++++++
 arch/sh/boot/dts/Makefile                          |  1 +
 arch/sh/boot/dts/r2dplus.dts                       | 84 +++++++++++++++++++++
 drivers/irqchip/Makefile                           |  2 +-
 drivers/irqchip/irq-renesas-r2dplus.c              | 88 ++++++++++++++++++++++
 5 files changed, 215 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas-r2dplus.txt
 create mode 100644 arch/sh/boot/dts/r2dplus.dts
 create mode 100644 drivers/irqchip/irq-renesas-r2dplus.c
Documentation/devicetree/bindings/interrupt-controller/renesas-r2dplus.txt new file +41 -0
new file mode 100644
index 0000000..ca2727e
@@ -0,0 +1,41 @@
+DT bindings for the Renesas R0P751RLC0011RL (R2Dplus) interrupt controller
+
+Required properties:
+
+  - compatible: has to be "renesas,r2dplus-intc".
+
+  - reg: Base address and length of interrupt controller register.
+
+  - interrupt-controller: Identifies the node as an interrupt controller.
+
+  - #address-cells: has to be <0>.
+
+  - #interrupt-cells: has to be <1>: an interrupt index.
+
+  - interrupt-map: Interrupt mapping on parent controller.
+
+Example
+-------
+
+	fpgaintc: fpga@a4000000 {
+		compatible = "renesas,r2dplus-intc";
+		#address-cells = <0>;
+		#interrupt-cells = <1>;
+		interrupt-controller;
+		reg = <0xa4000000 0x40>;
+		interrupt-map=<0 &shintc evt2irq(0x200)>,
+		              <1 &shintc evt2irq(0x220)>,
+		              <2 &shintc evt2irq(0x240)>,
+			      <3 &shintc evt2irq(0x260)>,
+		              <4 &shintc evt2irq(0x280)>,
+			      <5 &shintc evt2irq(0x2a0)>,
+		              <6 &shintc evt2irq(0x2c0)>,
+			      <7 &shintc evt2irq(0x2e0)>,
+		              <8 &shintc evt2irq(0x300)>,
+		              <9 &shintc evt2irq(0x320)>,
+			      <10 &shintc evt2irq(0x340)>,
+		              <11 &shintc evt2irq(0x360)>,
+			      <12 &shintc evt2irq(0x380)>,
+		              <13 &shintc evt2irq(0x3a0)>,
+			      <14 &shintc evt2irq(0x3c0)>,
+	};
arch/sh/boot/dts/Makefile +1 -0
index cf5aec4..e059ce2b 100644
@@ -1,6 +1,7 @@
 obj-$(CONFIG_USE_BUILTIN_DTB) += $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_SOURCE)).dtb.o
 
 dtb-y += landisk.dtb
+otb-y += r2dplus.dtb
 
 dtstree		:= $(srctree)/$(src)
 clean-files := *.dtb.S
arch/sh/boot/dts/r2dplus.dts new file +84 -0

84 lines not on this page · raw message

drivers/irqchip/Makefile +1 -1
index 5e225cf..1e0f1c3 100644
@@ -69,4 +69,4 @@ obj-$(CONFIG_PIC32_EVIC)		+= irq-pic32-evic.o
 obj-$(CONFIG_MVEBU_ODMI)		+= irq-mvebu-odmi.o
 obj-$(CONFIG_LS_SCFG_MSI)		+= irq-ls-scfg-msi.o
 obj-$(CONFIG_EZNPS_GIC)			+= irq-eznps.o
-obj-$(CONFIG_RENESAS_SH_INTC)		+= irq-renesas-sh7751.o irq-io-landisk.o
+obj-$(CONFIG_RENESAS_SH_INTC)		+= irq-renesas-sh7751.o irq-io-landisk.o irq-renesas-r2dplus.o
drivers/irqchip/irq-renesas-r2dplus.c new file +88 -0

88 lines not on this page · raw message

Signature · 1 line
2.7.0
author maintainer
#4 lore raw

PATCH v3 4/19 sh: command line passing chosen/bootargs in devicetree

In reply to Yoshinori Sato
---
 arch/sh/kernel/setup.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/sh/kernel/setup.c +6 -0
index 8e3b099..bdf57e5 100644
@@ -280,6 +280,7 @@ void __init setup_arch(char **cmdline_p)
 #endif
 	enable_mmu();
 
+#ifndef CONFIG_OF
 	ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
 
 	printk(KERN_NOTICE "Boot params:\n"
@@ -301,6 +302,7 @@ void __init setup_arch(char **cmdline_p)
 
 	if (!MOUNT_ROOT_RDONLY)
 		root_mountflags &= ~MS_RDONLY;
+#endif
 	init_mm.start_code = (unsigned long) _text;
 	init_mm.end_code = (unsigned long) _etext;
 	init_mm.end_data = (unsigned long) _edata;
@@ -323,9 +325,13 @@ void __init setup_arch(char **cmdline_p)
 #endif
 #endif
 
+#if !defined(CONFIG_OF) || defined(CONFIG_USE_BUILTIN_DTB)
 	/* Save unparsed command line copy for /proc/cmdline */
 	memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
 	*cmdline_p = command_line;
+#else
+	*cmdline_p = boot_command_line;
+#endif
 
 	parse_early_param();
 
Signature · 1 line
2.7.0
author maintainer
#19 lore raw

PATCH v3 16/19 pci: PCI_HOST_GENERIC enable for SH

In reply to Yoshinori Sato
---
 drivers/pci/host/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/host/Kconfig +1 -1
index df60505..83184eb 100644
@@ -83,7 +83,7 @@ config PCI_HOST_COMMON
 
 config PCI_HOST_GENERIC
 	bool "Generic PCI host controller"
-	depends on (ARM || ARM64) && OF
+	depends on (ARM || ARM64 || SUPERH) && OF
 	select PCI_HOST_COMMON
 	help
 	  Say Y here if you want to support a simple generic PCI host
Signature · 1 line
2.7.0
author maintainer
#7 lore raw

PATCH v3 7/19 sh: Disable board specific code on device tree mode

In reply to Yoshinori Sato
---
 arch/sh/Makefile                | 2 ++
 arch/sh/kernel/cpu/sh4/Makefile | 2 ++
 2 files changed, 4 insertions(+)
arch/sh/Makefile +2 -0
index 3b2c8b4..8adffa8 100644
@@ -132,6 +132,7 @@ core-$(CONFIG_SH_FPU_EMU)	+= arch/sh/math-emu/
 
 core-$(CONFIG_USE_BUILTIN_DTB)	+= arch/sh/boot/dts/
 
+ifneq ($(CONFIG_SH_DEVICE_TREE),y)
 # Mach groups
 machdir-$(CONFIG_SOLUTION_ENGINE)		+= mach-se
 machdir-$(CONFIG_SH_HP6XX)			+= mach-hp6xx
@@ -152,6 +153,7 @@ machdir-$(CONFIG_SH_LANDISK)			+= mach-landisk
 machdir-$(CONFIG_SH_LBOX_RE2)			+= mach-lboxre2
 machdir-$(CONFIG_SH_CAYMAN)			+= mach-cayman
 machdir-$(CONFIG_SH_RSK)			+= mach-rsk
+endif
 
 ifneq ($(machdir-y),)
 core-y	+= $(addprefix arch/sh/boards/, \
arch/sh/kernel/cpu/sh4/Makefile +2 -0
index 3a1dbc7..b822c0c 100644
@@ -14,6 +14,7 @@ perf-$(CONFIG_CPU_SUBTYPE_SH7750)	:= perf_event.o
 perf-$(CONFIG_CPU_SUBTYPE_SH7750S)	:= perf_event.o
 perf-$(CONFIG_CPU_SUBTYPE_SH7091)	:= perf_event.o
 
+ifndef CONFIG_OF
 # CPU subtype setup
 obj-$(CONFIG_CPU_SUBTYPE_SH7750)	+= setup-sh7750.o
 obj-$(CONFIG_CPU_SUBTYPE_SH7750R)	+= setup-sh7750.o
@@ -31,6 +32,7 @@ endif
 
 # Additional clocks by subtype
 clock-$(CONFIG_CPU_SUBTYPE_SH4_202)	+= clock-sh4-202.o
+endif
 
 obj-y					+= $(clock-y)
 obj-$(CONFIG_PERF_EVENTS)		+= $(perf-y)
Signature · 1 line
2.7.0
author maintainer
#2 lore raw

PATCH v3 2/19 sh: set preset_lpj

In reply to Yoshinori Sato

Generic callibrate delay required this value.

---
 arch/sh/boards/of-generic.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/sh/boards/of-generic.c +6 -0
index 3db4294..2d3cda3 100644
@@ -128,6 +128,8 @@ static void __init sh_of_time_init(void)
 static void __init sh_of_setup(char **cmdline_p)
 {
 	struct device_node *root;
+	struct device_node *cpu;
+	u32 freq;
 
 	board_time_init = sh_of_time_init;
 
@@ -139,6 +141,10 @@ static void __init sh_of_setup(char **cmdline_p)
 	}
 
 	sh_of_smp_probe();
+
+	cpu = of_find_node_by_name(NULL, "cpu");
+	if (!of_property_read_u32(cpu, "clock-frequency", &freq))
+		preset_lpj = freq / CONFIG_HZ / 2;
 }
 
 static int sh_of_irq_demux(int irq)
Signature · 1 line
2.7.0
author maintainer
#9 lore raw

PATCH v3 9/19 sh: Add board specific initialize of of-generic

In reply to Yoshinori Sato
---
 arch/sh/boards/of-generic.c | 64 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
arch/sh/boards/of-generic.c +64 -0
index 2d3cda3..709006a 100644
@@ -16,9 +16,15 @@
 #include <linux/irqchip.h>
 #include <linux/clk-provider.h>
 #include <linux/memblock.h>
+#include <linux/sm501-regs.h>
 #include <asm/machvec.h>
 #include <asm/rtc.h>
 
+struct model_setup {
+	char *name;
+	void (*fn)(void);
+};
+
 #ifdef CONFIG_SMP
 
 static void dummy_smp_setup(void)
@@ -125,10 +131,61 @@ static void __init sh_of_time_init(void)
 	clocksource_probe();
 }
 
+#define PA_LED		0xb0000001	/* LED Control Register */
+#define PA_SHUTDOWN	0xb0000003	/* Shutdown Control Register */
+static void landisk_power_off(void)
+{
+	__raw_writeb(0x01, PA_SHUTDOWN);
+}
+
+static void __init landisk_setup(void)
+{
+	/* LED ON */
+	__raw_writeb(__raw_readb(PA_LED) | 0x03, PA_LED);
+	pm_power_off = landisk_power_off;
+}
+
+#define PA_POWOFF	0xa4000030	/* Board Power OFF control */
+#define PA_OUTPORT	0xa4000036	/* LED control */
+static void rts7751r2d_power_off(void)
+{
+	__raw_writew(0x0001, PA_POWOFF);
+}
+
+static void __init r2dplus_setup(void)
+{
+	void __iomem *sm501_reg;
+
+	__raw_writew(0x0000, PA_OUTPORT);
+	pm_power_off = rts7751r2d_power_off;
+
+	/* sm501 dram configuration:
+	 * ColSizeX = 11 - External Memory Column Size: 256 words.
+	 * APX = 1 - External Memory Active to Pre-Charge Delay: 7 clocks.
+	 * RstX = 1 - External Memory Reset: Normal.
+	 * Rfsh = 1 - Local Memory Refresh to Command Delay: 12 clocks.
+	 * BwC =  1 - Local Memory Block Write Cycle Time: 2 clocks.
+	 * BwP =  1 - Local Memory Block Write to Pre-Charge Delay: 1 clock.
+	 * AP = 1 - Internal Memory Active to Pre-Charge Delay: 7 clocks.
+	 * Rst = 1 - Internal Memory Reset: Normal.
+	 * RA = 1 - Internal Memory Remain in Active State: Do not remain.
+	 */
+
+	sm501_reg = (void __iomem *)0xb3e00000 + SM501_DRAM_CONTROL;
+	writel(readl(sm501_reg) | 0x00f107c0, sm501_reg);
+}
+
+static const struct model_setup model_setup_table[] __initconst = {
+	{ .name = "I/O DATA HDL-U", .fn = landisk_setup, },
+	{ .name = "Renesas RTS7751R2D+", .fn = r2dplus_setup, },
+	{},
+};
+
 static void __init sh_of_setup(char **cmdline_p)
 {
 	struct device_node *root;
 	struct device_node *cpu;
+	const struct model_setup *setup;
 	u32 freq;
 
 	board_time_init = sh_of_time_init;
@@ -145,6 +202,13 @@ static void __init sh_of_setup(char **cmdline_p)
 	cpu = of_find_node_by_name(NULL, "cpu");
 	if (!of_property_read_u32(cpu, "clock-frequency", &freq))
 		preset_lpj = freq / CONFIG_HZ / 2;
+
+	for (setup = model_setup_table; setup->name; setup++) {
+		if (strcmp(setup->name, sh_mv.mv_name) == 0) {
+			setup->fn();
+			break;
+		}
+	}
 }
 
 static int sh_of_irq_demux(int irq)
Signature · 1 line
2.7.0
author maintainer
#6 lore raw

PATCH v3 6/19 sh: Passing FDT address on zImage

In reply to Yoshinori Sato
---
 arch/sh/boot/compressed/head_32.S | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/sh/boot/compressed/head_32.S +3 -2
index 3e15032..a980c48 100644
@@ -11,10 +11,11 @@
 
 	.global	startup
 startup:
+	/* Save FDT address */
+	mov	r4, r13
 	/* Load initial status register */
 	mov.l   init_sr, r1
 	ldc     r1, sr
-
 	/* Move myself to proper location if necessary */
 	mova	1f, r0
 	mov.l	1f, r2
@@ -83,7 +84,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.7.0
author maintainer
#1 lore raw

PATCH v3 1/19 sh: More early unflatten device tree

In reply to Yoshinori Sato

unflatten required MMU disabled.

---
 arch/sh/boards/of-generic.c | 6 ------
 arch/sh/kernel/setup.c      | 7 +++++++
 2 files changed, 7 insertions(+), 6 deletions(-)
arch/sh/boards/of-generic.c +0 -6
index 8dbf978..3db4294 100644
@@ -129,12 +129,6 @@ static void __init sh_of_setup(char **cmdline_p)
 {
 	struct device_node *root;
 
-#ifdef CONFIG_USE_BUILTIN_DTB
-	unflatten_and_copy_device_tree();
-#else
-	unflatten_device_tree();
-#endif
-
 	board_time_init = sh_of_time_init;
 
 	sh_mv.mv_name = "Unknown SH model";
arch/sh/kernel/setup.c +7 -0
index 5b9eb70..86f2792 100644
@@ -271,6 +271,13 @@ void __ref sh_fdt_init(phys_addr_t dt_phys)
 
 void __init setup_arch(char **cmdline_p)
 {
+#ifdef CONFIG_OF
+#ifdef CONFIG_USE_BUILTIN_DTB
+	unflatten_and_copy_device_tree();
+#else
+	unflatten_device_tree();
+#endif
+#endif
 	enable_mmu();
 
 	ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
Signature · 1 line
2.7.0
author maintainer
#8 lore raw

PATCH v3 8/19 sh: Use GENERIC_IOMAP on device tree mode

In reply to Yoshinori Sato
---
 arch/sh/boards/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/sh/boards/Kconfig +1 -0
index 5e52d53..9e4ccd0 100644
@@ -12,6 +12,7 @@ config SH_DEVICE_TREE
 	select OF_EARLY_FLATTREE
 	select CLKSRC_OF
 	select GENERIC_CALIBRATE_DELAY
+	select GENERIC_IOMAP
 	help
 	  Select Board Described by Device Tree to build a kernel that
 	  does not hard-code any board-specific knowledge but instead uses
Signature · 1 line
2.7.0
author maintainer
#3 lore raw

PATCH v3 3/19 sh: Use P1SEGADDR

In reply to Yoshinori Sato

FDT address is P1SEG. So not virtual address.

---
 arch/sh/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sh/kernel/setup.c +1 -1
index 86f2792..8e3b099 100644
@@ -254,7 +254,7 @@ void __ref sh_fdt_init(phys_addr_t dt_phys)
 #ifdef CONFIG_USE_BUILTIN_DTB
 	dt_virt = __dtb_start;
 #else
-	dt_virt = phys_to_virt(dt_phys);
+	dt_virt = (void *)P1SEGADDR(dt_phys);
 #endif
 
 	if (!dt_virt || !early_init_dt_scan(dt_virt)) {
Signature · 1 line
2.7.0

Yoshinori Sato

author maintainer
#0 lore raw

v3 cover sh: LANDISK and R2Dplus convert to device tree

SH get devicetree support. But it not working on existing H/W.

IO-DATA HDL-U (aka landisk) currentry supported.
This H/W like SH7751 evalution board. It's a best to use this as a change base H/W.
RTS7751R2Dplus is QEMU-SH4 target. So easy trying.

Changes V3
- PCI driver update for v4.7.
- New Clock driver. Unified PLL/Divider.
- R2Dplus support.
- Split DTS.
- Some cleanup.

Changes V2
- split DeviceTree suppoty update.
- PCI driver update.
- Some cleanup.

Yoshinori Sato (19):
sh: More early unflatten device tree
sh: set preset_lpj
sh: Use P1SEGADDR
sh: command line passing chosen/bootargs in devicetree
sh: FDT address save before bank change
sh: Passing FDT address on zImage
sh: Disable board specific code on device tree mode
sh: Use GENERIC_IOMAP on device tree mode
sh: Add board specific initialize of of-generic
sh: SH7750/51 CPG Driver
sh: Add PCI host bridge driver for SH7751
sh: irqchip: SH7751 IRQCHIP Driver
sh: SH7751 core dtsi
sh: Move common PCI stuff to arch/sh/kernel
pci: pci_config_window move to linux/pci.h
pci: PCI_HOST_GENERIC enable for SH
sh: Add separate DTB build rule
sh: IO-DATA HDL-U (a,k.a landisk) support
sh: Renesas R0P751RLC0011RL (a.k.a R2Dplus) support

 .../bindings/clock/renesas,sh7750-cpg.txt          |  25 ++
 .../interrupt-controller/iodata-landisk.txt        |  34 ++
 .../interrupt-controller/renesas,sh7751-intc.txt   |  25 ++
 .../interrupt-controller/renesas-r2dplus.txt       |  41 +++
 .../devicetree/bindings/pci/sh7751-pci.txt         |  51 +++
 arch/sh/Kconfig                                    |   6 +-
 arch/sh/Makefile                                   |   9 +
 arch/sh/boards/Kconfig                             |   4 +
 arch/sh/boards/of-generic.c                        |  76 ++++-
 arch/sh/boot/compressed/head_32.S                  |   5 +-
 arch/sh/boot/dts/Makefile                          |   5 +
 arch/sh/boot/dts/landisk.dts                       |  62 ++++
 arch/sh/boot/dts/r2dplus.dts                       |  84 +++++
 arch/sh/boot/dts/sh7751.dtsi                       |  85 +++++
 arch/sh/drivers/Makefile                           |   2 +
 arch/sh/drivers/pci/Makefile                       |   2 -
 arch/sh/drivers/pci/common.c                       | 162 ----------
 arch/sh/drivers/pci/pci.c                          | 320 -------------------
 arch/sh/include/asm/io.h                           |   6 +
 arch/sh/kernel/Makefile                            |   2 +
 arch/sh/kernel/cpu/Makefile                        |   8 +-
 arch/sh/kernel/cpu/clock.c                         |   6 +-
 arch/sh/kernel/cpu/sh4/Makefile                    |   2 +
 arch/sh/kernel/head_32.S                           |   7 +-
 arch/sh/kernel/pci-common.c                        | 162 ++++++++++
 arch/sh/kernel/pci.c                               | 342 ++++++++++++++++++++
 arch/sh/kernel/setup.c                             |  15 +-
 drivers/clk/Kconfig                                |   1 +
 drivers/clk/Makefile                               |   3 +-
 drivers/clk/sh/Kconfig                             |   2 +
 drivers/clk/sh/Makefile                            |   1 +
 drivers/clk/sh/clk-sh7750cpg.c                     | 344 +++++++++++++++++++++
 drivers/irqchip/Kconfig                            |   5 +
 drivers/irqchip/Makefile                           |   1 +
 drivers/irqchip/irq-io-landisk.c                   |  73 +++++
 drivers/irqchip/irq-renesas-r2dplus.c              |  88 ++++++
 drivers/irqchip/irq-renesas-sh7751.c               | 141 +++++++++
 drivers/pci/ecam.h                                 |  17 +-
 drivers/pci/host/Kconfig                           |   9 +-
 drivers/pci/host/Makefile                          |   1 +
 drivers/pci/host/pci-sh7751.c                      | 326 +++++++++++++++++++
 include/dt-bindings/clock/renesas-sh7750.h         |  26 ++
 include/dt-bindings/interrupt-controller/sh_intc.h |   2 +
 include/linux/pci.h                                |  18 ++
 44 files changed, 2085 insertions(+), 521 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/renesas,sh7750-cpg.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/iodata-landisk.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,sh7751-intc.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas-r2dplus.txt
 create mode 100644 Documentation/devicetree/bindings/pci/sh7751-pci.txt
 create mode 100644 arch/sh/boot/dts/landisk.dts
 create mode 100644 arch/sh/boot/dts/r2dplus.dts
 create mode 100644 arch/sh/boot/dts/sh7751.dtsi
 delete mode 100644 arch/sh/drivers/pci/common.c
 delete mode 100644 arch/sh/drivers/pci/pci.c
 create mode 100644 arch/sh/kernel/pci-common.c
 create mode 100644 arch/sh/kernel/pci.c
 create mode 100644 drivers/clk/sh/Kconfig
 create mode 100644 drivers/clk/sh/Makefile
 create mode 100644 drivers/clk/sh/clk-sh7750cpg.c
 create mode 100644 drivers/irqchip/irq-io-landisk.c
 create mode 100644 drivers/irqchip/irq-renesas-r2dplus.c
 create mode 100644 drivers/irqchip/irq-renesas-sh7751.c
 create mode 100644 drivers/pci/host/pci-sh7751.c
 create mode 100644 include/dt-bindings/clock/renesas-sh7750.h
 create mode 100644 include/dt-bindings/interrupt-controller/sh_intc.h
Signature · 1 line
2.7.0
author maintainer
#5 lore raw

PATCH v3 5/19 sh: FDT address save before bank change

SH3/4 have register bank of R0-R7.
Preset FDT address assigned bank depend on boot loader.
Before setting a bank because we don't depend on a boot loader, it's evacuated.

---
 arch/sh/kernel/head_32.S | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
arch/sh/kernel/head_32.S +3 -4
index 974bc15..ef44fe8 100644
@@ -58,6 +58,9 @@ ENTRY(empty_zero_page)
  *
  */
 ENTRY(_stext)
+#ifdef CONFIG_OF
+	mov	r4, r12		! Store device tree blob pointer
+#endif
 	!			Initialize Status Register
 	mov.l	1f, r0		! MD=1, RB=0, BL=0, IMASK=0xF
 	ldc	r0, sr
@@ -67,10 +70,6 @@ ENTRY(_stext)
 	ldc	r0, r6_bank
 #endif
 
-#ifdef CONFIG_OF
-	mov	r4, r12		! Store device tree blob pointer in r12
-#endif
-	
 	/*
 	 * Prefetch if possible to reduce cache miss penalty.
 	 *
Signature · 1 line
2.7.0
#22 lore raw

Re: [PATCH v3 18/19] sh: IO-DATA HDL-U (a,k.a landisk) support

In reply to Yoshinori Sato

Hi Sato-san,

Quoted 8 lines · Yoshinori Sato
---
 .../interrupt-controller/iodata-landisk.txt        | 34 ++++++++++
 arch/sh/boot/dts/Makefile                          |  2 +
 arch/sh/boot/dts/landisk.dts                       | 62 ++++++++++++++++++
 drivers/irqchip/Makefile                           |  2 +-
 drivers/irqchip/irq-io-landisk.c                   | 73 ++++++++++++++++++++++
 5 files changed, 172 insertions(+), 1 deletion(-)

This needs to be split in two (or three) patches:
- irqchip driver and DT
- arch/sh

Quoted 11 lines
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/iodata-landisk.txt
 create mode 100644 arch/sh/boot/dts/landisk.dts
 create mode 100644 drivers/irqchip/irq-io-landisk.c
Documentation/devicetree/bindings/interrupt-controller/iodata-landisk.txt new file +1 -0
new file mode 100644
index 0000000..9f87f2c
@@ -0,0 +1,34 @@
+DT bindings for the I/O DATA HDL-U interrupt controller

Documentation/devicetree/bindings/interrupt-controller/iodata-landisk.txt line 11

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/iodata-landisk.txt new file +10 -0
+
+Required properties:
+
+  - compatible: has to be "iodata,landisk-intc".
+
+  - reg: Base address and length of interrupt controller register.
+
+  - interrupt-controller: Identifies the node as an interrupt controller.
+
+  - #address-cells: has to be <0>.

Why do you need #address-cells? There are no subnodes.

Quoted 11 lines
Documentation/devicetree/bindings/interrupt-controller/iodata-landisk.txt new file +4 -0
+
+  - #interrupt-cells: has to be <1>: an interrupt index.
+
+  - interrupt-map: Interrupt mapping on parent controller.
arch/sh/boot/dts/landisk.dts new file +3 -0
@@ -0,0 +1,62 @@
+/dts-v1/;
+
+#include "sh7751.dtsi"

arch/sh/boot/dts/landisk.dts line 13

Quoted 10 lines
arch/sh/boot/dts/landisk.dts new file +10 -0
+
+/ {
+       model = "I/O DATA HDL-U";
+       compatible = "iodata,hdl-u";
+       #address-cells = <1>;
+       #size-cells = <1>;
+       interrupt-parent = <&shintc>;
+       chosen {
+               stdout-path = &sci1;
+               bootargs = "console=ttySC1,115200";

The console= parameter can be removed from bootargs. You can specify the console speed using

        stdout-path = "&sci1:115200";

arch/sh/boot/dts/landisk.dts line 14

Quoted 1 line
arch/sh/boot/dts/landisk.dts new file +1 -0
+       };

Gr{oetje,eeting}s,

Geert

--
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

#26 lore raw

Re: [PATCH v3 19/19] sh: Renesas R0P751RLC0011RL (a.k.a R2Dplus) support

In reply to Yoshinori Sato
Quoted 11 lines · Yoshinori Sato
---
 .../interrupt-controller/renesas-r2dplus.txt       | 41 ++++++++++
 arch/sh/boot/dts/Makefile                          |  1 +
 arch/sh/boot/dts/r2dplus.dts                       | 84 +++++++++++++++++++++
 drivers/irqchip/Makefile                           |  2 +-
 drivers/irqchip/irq-renesas-r2dplus.c              | 88 ++++++++++++++++++++++
 5 files changed, 215 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas-r2dplus.txt
 create mode 100644 arch/sh/boot/dts/r2dplus.dts
 create mode 100644 drivers/irqchip/irq-renesas-r2dplus.c

Same comments as for landisk.

Gr{oetje,eeting}s,

Geert

--
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

#15 lore raw

Re: [PATCH v3 12/19] sh: irqchip: SH7751 IRQCHIP Driver

In reply to Yoshinori Sato

Hi Sato-san,

Quoted 16 lines · Yoshinori Sato

index 0000000..2bc6f22f

Documentation/devicetree/bindings/interrupt-controller/renesas,sh7751-intc.txt new file +12 -0
@@ -0,0 +1,25 @@
+DT bindings for the SH7751 interrupt controller
+
+Required properties:
+
+  - compatible: has to be "renesas,sh7751-intc".
+
+  - reg: Base address and length of interrupt controller register
+         and extend register.
+
+  - interrupt-controller: Identifies the node as an interrupt controller.
+
+  - #interrupt-cells: has to be <2>: an interrupt index and flags, as defined

Documentation/devicetree/bindings/interrupt-controller/renesas,sh7751-intc.txt line 22

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,sh7751-intc.txt new file +10 -0
+    in interrupts.txt in this directory.
+
+Example
+-------
+
+       shintc: interrupt-controller@ffd00000 {
+               compatible = "renesas,sh7751-intc";
+               #interrupt-cells = <2>;
+               #address-cells = <1>;
+               #size-cells = <1>;

Why do you need #address-cells and #size-cells?

Documentation/devicetree/bindings/interrupt-controller/renesas,sh7751-intc.txt line 25

Quoted 3 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,sh7751-intc.txt new file +3 -0
+               interrupt-controller;
+               reg = <0xffd00000 14>, <0xfe080000 128>;
+       };

Gr{oetje,eeting}s,

Geert

--
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

#24 lore raw

Re: [PATCH v3 18/19] sh: IO-DATA HDL-U (a,k.a landisk) support

In reply to Yoshinori Sato
Quoted 1 line · Yoshinori Sato

In case you want to use the subject of this mail for the commit message, there is a typo: It should be "a.k.a.", not "a,k.a".

Adrian

Signature · 4 lines
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
author maintainer
#23 lore raw

Re: [PATCH v3 18/19] sh: IO-DATA HDL-U (a,k.a landisk) support

In reply to Geert Uytterhoeven
Quoted 14 lines · Geert Uytterhoeven

Hi Sato-san,

Quoted 8 lines · Yoshinori Sato
---
 .../interrupt-controller/iodata-landisk.txt        | 34 ++++++++++
 arch/sh/boot/dts/Makefile                          |  2 +
 arch/sh/boot/dts/landisk.dts                       | 62 ++++++++++++++++++
 drivers/irqchip/Makefile                           |  2 +-
 drivers/irqchip/irq-io-landisk.c                   | 73 ++++++++++++++++++++++
 5 files changed, 172 insertions(+), 1 deletion(-)
Quoted 3 lines

This needs to be split in two (or three) patches:
- irqchip driver and DT
- arch/sh

OK.

Quoted 15 lines
Quoted 15 lines
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/iodata-landisk.txt
 create mode 100644 arch/sh/boot/dts/landisk.dts
 create mode 100644 drivers/irqchip/irq-io-landisk.c
Documentation/devicetree/bindings/interrupt-controller/iodata-landisk.txt new file +5 -0
new file mode 100644
index 0000000..9f87f2c
@@ -0,0 +1,34 @@
+DT bindings for the I/O DATA HDL-U interrupt controller
+
+Required properties:
+
+  - compatible: has to be "iodata,landisk-intc".
Quoted 8 lines

Documentation/devicetree/bindings/interrupt-controller/iodata-landisk.txt line 11

Quoted 6 lines
Documentation/devicetree/bindings/interrupt-controller/iodata-landisk.txt new file +6 -0
+
+  - reg: Base address and length of interrupt controller register.
+
+  - interrupt-controller: Identifies the node as an interrupt controller.
+
+  - #address-cells: has to be <0>.

Why do you need #address-cells? There are no subnodes.

Ouch.
I forgot remove line.
Thanks.

Quoted 43 lines
Quoted 11 lines
Documentation/devicetree/bindings/interrupt-controller/iodata-landisk.txt new file +4 -0
+
+  - #interrupt-cells: has to be <1>: an interrupt index.
+
+  - interrupt-map: Interrupt mapping on parent controller.
arch/sh/boot/dts/landisk.dts new file +3 -0
@@ -0,0 +1,62 @@
+/dts-v1/;
+
+#include "sh7751.dtsi"

arch/sh/boot/dts/landisk.dts line 13

Quoted 10 lines
arch/sh/boot/dts/landisk.dts new file +10 -0
+
+/ {
+       model = "I/O DATA HDL-U";
+       compatible = "iodata,hdl-u";
+       #address-cells = <1>;
+       #size-cells = <1>;
+       interrupt-parent = <&shintc>;
+       chosen {
+               stdout-path = &sci1;
+               bootargs = "console=ttySC1,115200";

The console= parameter can be removed from bootargs. You can specify the console speed using

        stdout-path = "&sci1:115200";

arch/sh/boot/dts/landisk.dts line 14

Quoted 1 line
arch/sh/boot/dts/landisk.dts new file +1 -0
+       };

Gr{oetje,eeting}s,

Geert

--
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
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Yoshinori Sato
<[email protected]>
maintainer Acked-by on v3 10/19
#11 lore raw

Re: [PATCH v3 10/19] sh: SH7750/51 CPG Driver

In reply to Yoshinori Sato
Quoted 5 lines · Yoshinori Sato

Convert SH specific clock framework to CCF.

---
 .../bindings/clock/renesas,sh7750-cpg.txt          |  25 ++
Quoted 13 lines
 arch/sh/boards/Kconfig                             |   1 +
 arch/sh/kernel/cpu/Makefile                        |   8 +-
 arch/sh/kernel/cpu/clock.c                         |   6 +-
 drivers/clk/Kconfig                                |   1 +
 drivers/clk/Makefile                               |   3 +-
 drivers/clk/sh/Kconfig                             |   2 +
 drivers/clk/sh/Makefile                            |   1 +
 drivers/clk/sh/clk-sh7750cpg.c                     | 344 +++++++++++++++++++++
 9 files changed, 387 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/renesas,sh7750-cpg.txt
 create mode 100644 drivers/clk/sh/Kconfig
 create mode 100644 drivers/clk/sh/Makefile
 create mode 100644 drivers/clk/sh/clk-sh7750cpg.c
maintainer
#13 lore raw

Re: [PATCH v3 11/19] sh: Add PCI host bridge driver for SH7751

In reply to Yoshinori Sato
Quoted 23 lines · Yoshinori Sato

This is an alternative SH7751 PCI driver.
Existing driver (arch/sh/drivers/pci/pci-sh7751) uses SH specific interface. But this driver uses common PCI interface. It is more modern and generic.

---
 .../devicetree/bindings/pci/sh7751-pci.txt         |  51 ++++
 arch/sh/boards/Kconfig                             |   1 +
 arch/sh/drivers/Makefile                           |   2 +
 arch/sh/include/asm/io.h                           |   6 +
 drivers/pci/host/Kconfig                           |   7 +
 drivers/pci/host/Makefile                          |   1 +
 drivers/pci/host/pci-sh7751.c                      | 326 +++++++++++++++++++++
 7 files changed, 394 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pci/sh7751-pci.txt
 create mode 100644 drivers/pci/host/pci-sh7751.c
Documentation/devicetree/bindings/pci/sh7751-pci.txt new file +0 -0
new file mode 100644
index 0000000..c3ec71a

Documentation/devicetree/bindings/pci/sh7751-pci.txt line 7

Quoted 7 lines
Documentation/devicetree/bindings/pci/sh7751-pci.txt new file +7 -0
@@ -0,0 +1,51 @@
+* Renesas SH7751 PCI host interfaces
+
+Required properties:
+  - compatible: "renesas,sh7751-pci" is required.
+    And board specific compatible if fixup required.
+
+  - reg: base address and length of the PCI controller registers.

Need to define how many reg entries and the order.

Quoted 44 lines
Documentation/devicetree/bindings/pci/sh7751-pci.txt new file +44 -0
+  - #address-cells: set to <2>
+  - #size-cells: set to <1>
+  - bus-range: PCI bus numbers covered
+  - device_type: set to "pci"
+  - ranges: ranges for the PCI memory and I/O regions.
+  - interrupt-map-mask and interrupt-map: standard PCI properties
+	to define the mapping of the PCI interface to interrupt
+	numbers.
+
+Example:
+	pci: pci-controller@fe200000 {
+		compatible = "renesas,sh7751-pci", "iodata,landisk";
+		device_type = "pci";
+		bus-range = <0 0>;
+		#address-cells = <2>;
+		#size-cells = <1>;
+		ranges = <0x02000000 0x00000000 0xfd000000 0xfd000000 0x00000000 0x01000000>,
+		         <0x01000000 0x00000000 0xfe240000 0x00000000 0x00000000 0x00040000>;
+		reg = <0xfe200000 0x0400>,
+		      <0x0c000000 0x04000000>,
+		      <0xff800000 0x0030>;
+		#interrupt-cells = <1>;
+		interrupt-map-mask = <0x1800 0 7>;
+		interrupt-map = <0x0000 0 1 &cpldintc evt2irq(0x2a0) 0
+		                 0x0000 0 2 &cpldintc evt2irq(0x2c0) 0
+		                 0x0000 0 3 &cpldintc evt2irq(0x2e0) 0
+		                 0x0000 0 4 &cpldintc evt2irq(0x300) 0
+
+		                 0x0800 0 1 &cpldintc evt2irq(0x2c0) 0
+		                 0x0800 0 2 &cpldintc evt2irq(0x2e0) 0
+		                 0x0800 0 3 &cpldintc evt2irq(0x300) 0
+		                 0x0800 0 4 &cpldintc evt2irq(0x2a0) 0
+
+		                 0x1000 0 1 &cpldintc evt2irq(0x2e0) 0
+		                 0x1000 0 2 &cpldintc evt2irq(0x300) 0
+		                 0x1000 0 3 &cpldintc evt2irq(0x2a0) 0
+		                 0x1000 0 4 &cpldintc evt2irq(0x2c0) 0
+
+		                 0x1800 0 1 &cpldintc evt2irq(0x300) 0
+		                 0x1800 0 2 &cpldintc evt2irq(0x2a0) 0
+		                 0x1800 0 3 &cpldintc evt2irq(0x2c0) 0
+		                 0x1800 0 4 &cpldintc evt2irq(0x2e0) 0>;
+	};
+};