All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] MIPS: Add Xilfpga platform
@ 2015-10-14 12:51 ` Zubair Lutfullah Kakakhel
  0 siblings, 0 replies; 38+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-14 12:51 UTC (permalink / raw)
  To: ralf, robh+dt, linus.walleij
  Cc: linux-mips, linux-gpio, devicetree, linux-kernel, Zubair.Kakakhel

Hi,

This series is based on v4.3-rc5.

Adds support for the Imagination University Program MIPSfpga platform.

See the first dt-bindings patch for details about the platform.

These patches allow the kernel to boot with UART and gpio support.

Acks from DT (patch 1/5) and GPIO (patch 2/5) welcome.

Regards,
ZubairLK

Zubair Lutfullah Kakakhel (5):
  dt-bindings: MIPS: Document xilfpga bindings and boot style
  gpio/xilinx: enable for MIPS
  MIPS: dt: xilfpga: Add xilfpga device tree files.
  MIPS: xilfpga: Add mipsfpga platform code
  MIPS: Add xilfpga defconfig

 .../devicetree/bindings/mips/img/xilfpga.txt       | 76 ++++++++++++++++++++++
 arch/mips/Kbuild.platforms                         |  1 +
 arch/mips/Kconfig                                  | 25 +++++++
 arch/mips/boot/dts/Makefile                        |  1 +
 arch/mips/boot/dts/xilfpga/Makefile                |  9 +++
 arch/mips/boot/dts/xilfpga/microAptiv.dtsi         | 21 ++++++
 arch/mips/boot/dts/xilfpga/nexys4ddr.dts           | 47 +++++++++++++
 arch/mips/configs/xilfpga_defconfig                | 59 +++++++++++++++++
 arch/mips/include/asm/mach-xilfpga/gpio.h          | 19 ++++++
 arch/mips/include/asm/mach-xilfpga/irq.h           | 18 +++++
 arch/mips/xilfpga/Kconfig                          |  9 +++
 arch/mips/xilfpga/Makefile                         |  7 ++
 arch/mips/xilfpga/Platform                         |  3 +
 arch/mips/xilfpga/init.c                           | 57 ++++++++++++++++
 arch/mips/xilfpga/intc.c                           | 26 ++++++++
 arch/mips/xilfpga/time.c                           | 41 ++++++++++++
 drivers/gpio/Kconfig                               |  2 +-
 17 files changed, 420 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/mips/img/xilfpga.txt
 create mode 100644 arch/mips/boot/dts/xilfpga/Makefile
 create mode 100644 arch/mips/boot/dts/xilfpga/microAptiv.dtsi
 create mode 100644 arch/mips/boot/dts/xilfpga/nexys4ddr.dts
 create mode 100644 arch/mips/configs/xilfpga_defconfig
 create mode 100644 arch/mips/include/asm/mach-xilfpga/gpio.h
 create mode 100644 arch/mips/include/asm/mach-xilfpga/irq.h
 create mode 100644 arch/mips/xilfpga/Kconfig
 create mode 100644 arch/mips/xilfpga/Makefile
 create mode 100644 arch/mips/xilfpga/Platform
 create mode 100644 arch/mips/xilfpga/init.c
 create mode 100644 arch/mips/xilfpga/intc.c
 create mode 100644 arch/mips/xilfpga/time.c

-- 
1.9.1

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

* [PATCH 0/5] MIPS: Add Xilfpga platform
@ 2015-10-14 12:51 ` Zubair Lutfullah Kakakhel
  0 siblings, 0 replies; 38+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-14 12:51 UTC (permalink / raw)
  To: ralf, robh+dt, linus.walleij
  Cc: linux-mips, linux-gpio, devicetree, linux-kernel, Zubair.Kakakhel

Hi,

This series is based on v4.3-rc5.

Adds support for the Imagination University Program MIPSfpga platform.

See the first dt-bindings patch for details about the platform.

These patches allow the kernel to boot with UART and gpio support.

Acks from DT (patch 1/5) and GPIO (patch 2/5) welcome.

Regards,
ZubairLK

Zubair Lutfullah Kakakhel (5):
  dt-bindings: MIPS: Document xilfpga bindings and boot style
  gpio/xilinx: enable for MIPS
  MIPS: dt: xilfpga: Add xilfpga device tree files.
  MIPS: xilfpga: Add mipsfpga platform code
  MIPS: Add xilfpga defconfig

 .../devicetree/bindings/mips/img/xilfpga.txt       | 76 ++++++++++++++++++++++
 arch/mips/Kbuild.platforms                         |  1 +
 arch/mips/Kconfig                                  | 25 +++++++
 arch/mips/boot/dts/Makefile                        |  1 +
 arch/mips/boot/dts/xilfpga/Makefile                |  9 +++
 arch/mips/boot/dts/xilfpga/microAptiv.dtsi         | 21 ++++++
 arch/mips/boot/dts/xilfpga/nexys4ddr.dts           | 47 +++++++++++++
 arch/mips/configs/xilfpga_defconfig                | 59 +++++++++++++++++
 arch/mips/include/asm/mach-xilfpga/gpio.h          | 19 ++++++
 arch/mips/include/asm/mach-xilfpga/irq.h           | 18 +++++
 arch/mips/xilfpga/Kconfig                          |  9 +++
 arch/mips/xilfpga/Makefile                         |  7 ++
 arch/mips/xilfpga/Platform                         |  3 +
 arch/mips/xilfpga/init.c                           | 57 ++++++++++++++++
 arch/mips/xilfpga/intc.c                           | 26 ++++++++
 arch/mips/xilfpga/time.c                           | 41 ++++++++++++
 drivers/gpio/Kconfig                               |  2 +-
 17 files changed, 420 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/mips/img/xilfpga.txt
 create mode 100644 arch/mips/boot/dts/xilfpga/Makefile
 create mode 100644 arch/mips/boot/dts/xilfpga/microAptiv.dtsi
 create mode 100644 arch/mips/boot/dts/xilfpga/nexys4ddr.dts
 create mode 100644 arch/mips/configs/xilfpga_defconfig
 create mode 100644 arch/mips/include/asm/mach-xilfpga/gpio.h
 create mode 100644 arch/mips/include/asm/mach-xilfpga/irq.h
 create mode 100644 arch/mips/xilfpga/Kconfig
 create mode 100644 arch/mips/xilfpga/Makefile
 create mode 100644 arch/mips/xilfpga/Platform
 create mode 100644 arch/mips/xilfpga/init.c
 create mode 100644 arch/mips/xilfpga/intc.c
 create mode 100644 arch/mips/xilfpga/time.c

-- 
1.9.1


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

* [PATCH 1/5] dt-bindings: MIPS: Document xilfpga bindings and boot style
  2015-10-14 12:51 ` Zubair Lutfullah Kakakhel
  (?)
@ 2015-10-14 12:51     ` Zubair Lutfullah Kakakhel
  -1 siblings, 0 replies; 38+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-14 12:51 UTC (permalink / raw)
  To: ralf-6z/3iImG2C8G8FEW9MqTrA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A
  Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA

Xilfpga boots only with device-tree. Document the required properties
and the unique boot style

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
---
 .../devicetree/bindings/mips/img/xilfpga.txt       | 76 ++++++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mips/img/xilfpga.txt

diff --git a/Documentation/devicetree/bindings/mips/img/xilfpga.txt b/Documentation/devicetree/bindings/mips/img/xilfpga.txt
new file mode 100644
index 0000000..1e7084c
--- /dev/null
+++ b/Documentation/devicetree/bindings/mips/img/xilfpga.txt
@@ -0,0 +1,76 @@
+Imagination University Program MIPSFpga
+=======================================
+
+Under the Imagination University Program, a microAptiv UP core has been released for academic usage.
+
+As we are dealing with a mips core instantiated on an FPGA, specifications are fluid and can be varied in RTL.
+
+This binding document is provided as baseline guidance for the example project provided by IMG.
+
+The example project runs on the Nexys4DDR board by Digilent powered by the ARTIX-7 FPGA by Xilinx.
+
+Relevant details about the example project and the Nexys4DDR board:
+
+- microAptiv UP core m14Kc
+- 50MHz clock speed
+- 128Mbyte DDR RAM	at 0x0000_0000
+- 8Kbyte RAM		at 0x1000_0000
+- axi_intc		at 0x1020_0000
+- axi_uart16550		at 0x1040_0000
+- axi_gpio		at 0x1060_0000
+- axi_i2c		at 0x10A0_0000
+- custom_gpio		at 0x10C0_0000
+- axi_ethernetlite	at 0x10E0_0000
+- 8Kbyte BootRAM	at 0x1FC0_0000
+
+Required properties:
+--------------------
+ - compatible: Must include "img,xilfpga".
+
+CPU nodes:
+----------
+A "cpus" node is required.  Required properties:
+ - #address-cells: Must be 1.
+ - #size-cells: Must be 0.
+A CPU sub-node is also required for at least CPU 0. Required properties:
+ - device_type: Must be "cpu".
+ - compatible: Must be "mips,m14Kc".
+ - reg: Must be <0>.
+ - clocks: Must include the CPU clock.  See ../../clock/clock-bindings.txt for
+   details on clock bindings.
+ - ext clock handle for fixed-clock received by MIPS core.
+Example:
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu0: cpu@0 {
+			device_type = "cpu";
+			compatible = "mips,m14Kc";
+			reg = <0>;
+			clocks	= <&ext>;
+		};
+	};
+
+	ext: ext {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <50000000>;
+	};
+
+Boot protocol:
+--------------
+
+The BootRAM is a writeable "RAM" in FPGA at 0x1FC0_0000. This is for easy reprogrammibility via JTAG.
+
+The BootRAM inializes the cache and the axi_uart peripheral.
+
+DDR initialiation is already handled by a HW IP block.
+
+When the example project bitstream is loaded, the cpu_reset button needs to be pressed.
+
+The bootram initializes the cache and axi_uart. Then outputs MIPSFPGA\n\r on the serial port
+on the Nexys4DDR board.
+
+At this point, the board is ready to load the Linux kernel vmlinux file via JTAG.
+
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 1/5] dt-bindings: MIPS: Document xilfpga bindings and boot style
@ 2015-10-14 12:51     ` Zubair Lutfullah Kakakhel
  0 siblings, 0 replies; 38+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-14 12:51 UTC (permalink / raw)
  To: ralf, robh+dt, linus.walleij
  Cc: linux-mips, linux-gpio, devicetree, linux-kernel, Zubair.Kakakhel

Xilfpga boots only with device-tree. Document the required properties
and the unique boot style

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
 .../devicetree/bindings/mips/img/xilfpga.txt       | 76 ++++++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mips/img/xilfpga.txt

diff --git a/Documentation/devicetree/bindings/mips/img/xilfpga.txt b/Documentation/devicetree/bindings/mips/img/xilfpga.txt
new file mode 100644
index 0000000..1e7084c
--- /dev/null
+++ b/Documentation/devicetree/bindings/mips/img/xilfpga.txt
@@ -0,0 +1,76 @@
+Imagination University Program MIPSFpga
+=======================================
+
+Under the Imagination University Program, a microAptiv UP core has been released for academic usage.
+
+As we are dealing with a mips core instantiated on an FPGA, specifications are fluid and can be varied in RTL.
+
+This binding document is provided as baseline guidance for the example project provided by IMG.
+
+The example project runs on the Nexys4DDR board by Digilent powered by the ARTIX-7 FPGA by Xilinx.
+
+Relevant details about the example project and the Nexys4DDR board:
+
+- microAptiv UP core m14Kc
+- 50MHz clock speed
+- 128Mbyte DDR RAM	at 0x0000_0000
+- 8Kbyte RAM		at 0x1000_0000
+- axi_intc		at 0x1020_0000
+- axi_uart16550		at 0x1040_0000
+- axi_gpio		at 0x1060_0000
+- axi_i2c		at 0x10A0_0000
+- custom_gpio		at 0x10C0_0000
+- axi_ethernetlite	at 0x10E0_0000
+- 8Kbyte BootRAM	at 0x1FC0_0000
+
+Required properties:
+--------------------
+ - compatible: Must include "img,xilfpga".
+
+CPU nodes:
+----------
+A "cpus" node is required.  Required properties:
+ - #address-cells: Must be 1.
+ - #size-cells: Must be 0.
+A CPU sub-node is also required for at least CPU 0. Required properties:
+ - device_type: Must be "cpu".
+ - compatible: Must be "mips,m14Kc".
+ - reg: Must be <0>.
+ - clocks: Must include the CPU clock.  See ../../clock/clock-bindings.txt for
+   details on clock bindings.
+ - ext clock handle for fixed-clock received by MIPS core.
+Example:
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu0: cpu@0 {
+			device_type = "cpu";
+			compatible = "mips,m14Kc";
+			reg = <0>;
+			clocks	= <&ext>;
+		};
+	};
+
+	ext: ext {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <50000000>;
+	};
+
+Boot protocol:
+--------------
+
+The BootRAM is a writeable "RAM" in FPGA at 0x1FC0_0000. This is for easy reprogrammibility via JTAG.
+
+The BootRAM inializes the cache and the axi_uart peripheral.
+
+DDR initialiation is already handled by a HW IP block.
+
+When the example project bitstream is loaded, the cpu_reset button needs to be pressed.
+
+The bootram initializes the cache and axi_uart. Then outputs MIPSFPGA\n\r on the serial port
+on the Nexys4DDR board.
+
+At this point, the board is ready to load the Linux kernel vmlinux file via JTAG.
+
-- 
1.9.1


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

* [PATCH 1/5] dt-bindings: MIPS: Document xilfpga bindings and boot style
@ 2015-10-14 12:51     ` Zubair Lutfullah Kakakhel
  0 siblings, 0 replies; 38+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-14 12:51 UTC (permalink / raw)
  To: ralf, robh+dt, linus.walleij
  Cc: linux-mips, linux-gpio, devicetree, linux-kernel, Zubair.Kakakhel

Xilfpga boots only with device-tree. Document the required properties
and the unique boot style

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
 .../devicetree/bindings/mips/img/xilfpga.txt       | 76 ++++++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mips/img/xilfpga.txt

diff --git a/Documentation/devicetree/bindings/mips/img/xilfpga.txt b/Documentation/devicetree/bindings/mips/img/xilfpga.txt
new file mode 100644
index 0000000..1e7084c
--- /dev/null
+++ b/Documentation/devicetree/bindings/mips/img/xilfpga.txt
@@ -0,0 +1,76 @@
+Imagination University Program MIPSFpga
+=======================================
+
+Under the Imagination University Program, a microAptiv UP core has been released for academic usage.
+
+As we are dealing with a mips core instantiated on an FPGA, specifications are fluid and can be varied in RTL.
+
+This binding document is provided as baseline guidance for the example project provided by IMG.
+
+The example project runs on the Nexys4DDR board by Digilent powered by the ARTIX-7 FPGA by Xilinx.
+
+Relevant details about the example project and the Nexys4DDR board:
+
+- microAptiv UP core m14Kc
+- 50MHz clock speed
+- 128Mbyte DDR RAM	at 0x0000_0000
+- 8Kbyte RAM		at 0x1000_0000
+- axi_intc		at 0x1020_0000
+- axi_uart16550		at 0x1040_0000
+- axi_gpio		at 0x1060_0000
+- axi_i2c		at 0x10A0_0000
+- custom_gpio		at 0x10C0_0000
+- axi_ethernetlite	at 0x10E0_0000
+- 8Kbyte BootRAM	at 0x1FC0_0000
+
+Required properties:
+--------------------
+ - compatible: Must include "img,xilfpga".
+
+CPU nodes:
+----------
+A "cpus" node is required.  Required properties:
+ - #address-cells: Must be 1.
+ - #size-cells: Must be 0.
+A CPU sub-node is also required for at least CPU 0. Required properties:
+ - device_type: Must be "cpu".
+ - compatible: Must be "mips,m14Kc".
+ - reg: Must be <0>.
+ - clocks: Must include the CPU clock.  See ../../clock/clock-bindings.txt for
+   details on clock bindings.
+ - ext clock handle for fixed-clock received by MIPS core.
+Example:
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu0: cpu@0 {
+			device_type = "cpu";
+			compatible = "mips,m14Kc";
+			reg = <0>;
+			clocks	= <&ext>;
+		};
+	};
+
+	ext: ext {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <50000000>;
+	};
+
+Boot protocol:
+--------------
+
+The BootRAM is a writeable "RAM" in FPGA at 0x1FC0_0000. This is for easy reprogrammibility via JTAG.
+
+The BootRAM inializes the cache and the axi_uart peripheral.
+
+DDR initialiation is already handled by a HW IP block.
+
+When the example project bitstream is loaded, the cpu_reset button needs to be pressed.
+
+The bootram initializes the cache and axi_uart. Then outputs MIPSFPGA\n\r on the serial port
+on the Nexys4DDR board.
+
+At this point, the board is ready to load the Linux kernel vmlinux file via JTAG.
+
-- 
1.9.1

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

* [PATCH 2/5] gpio/xilinx: enable for MIPS
  2015-10-14 12:51 ` Zubair Lutfullah Kakakhel
@ 2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
  -1 siblings, 0 replies; 38+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-14 12:51 UTC (permalink / raw)
  To: ralf, robh+dt, linus.walleij
  Cc: linux-mips, linux-gpio, devicetree, linux-kernel, Zubair.Kakakhel

MIPSfpga uses the axi gpio controller. Enable the driver for MIPS.

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
 drivers/gpio/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 8949b3f..58e9afd 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -508,7 +508,7 @@ config GPIO_XGENE_SB
 
 config GPIO_XILINX
 	tristate "Xilinx GPIO support"
-	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86)
+	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86 || MIPS)
 	help
 	  Say yes here to support the Xilinx FPGA GPIO device
 
-- 
1.9.1

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

* [PATCH 2/5] gpio/xilinx: enable for MIPS
@ 2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
  0 siblings, 0 replies; 38+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-14 12:51 UTC (permalink / raw)
  To: ralf, robh+dt, linus.walleij
  Cc: linux-mips, linux-gpio, devicetree, linux-kernel, Zubair.Kakakhel

MIPSfpga uses the axi gpio controller. Enable the driver for MIPS.

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
 drivers/gpio/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 8949b3f..58e9afd 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -508,7 +508,7 @@ config GPIO_XGENE_SB
 
 config GPIO_XILINX
 	tristate "Xilinx GPIO support"
-	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86)
+	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86 || MIPS)
 	help
 	  Say yes here to support the Xilinx FPGA GPIO device
 
-- 
1.9.1


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

* [PATCH 3/5] MIPS: dt: xilfpga: Add xilfpga device tree files.
  2015-10-14 12:51 ` Zubair Lutfullah Kakakhel
@ 2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
  -1 siblings, 0 replies; 38+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-14 12:51 UTC (permalink / raw)
  To: ralf, robh+dt, linus.walleij
  Cc: linux-mips, linux-gpio, devicetree, linux-kernel, Zubair.Kakakhel

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
 arch/mips/boot/dts/Makefile                |  1 +
 arch/mips/boot/dts/xilfpga/Makefile        |  9 ++++++
 arch/mips/boot/dts/xilfpga/microAptiv.dtsi | 21 +++++++++++++
 arch/mips/boot/dts/xilfpga/nexys4ddr.dts   | 47 ++++++++++++++++++++++++++++++
 4 files changed, 78 insertions(+)
 create mode 100644 arch/mips/boot/dts/xilfpga/Makefile
 create mode 100644 arch/mips/boot/dts/xilfpga/microAptiv.dtsi
 create mode 100644 arch/mips/boot/dts/xilfpga/nexys4ddr.dts

diff --git a/arch/mips/boot/dts/Makefile b/arch/mips/boot/dts/Makefile
index 778a340..0571ef7 100644
--- a/arch/mips/boot/dts/Makefile
+++ b/arch/mips/boot/dts/Makefile
@@ -6,6 +6,7 @@ dts-dirs	+= mti
 dts-dirs	+= netlogic
 dts-dirs	+= qca
 dts-dirs	+= ralink
+dts-dirs	+= xilfpga
 
 obj-y		:= $(addsuffix /, $(dts-dirs))
 
diff --git a/arch/mips/boot/dts/xilfpga/Makefile b/arch/mips/boot/dts/xilfpga/Makefile
new file mode 100644
index 0000000..913a752
--- /dev/null
+++ b/arch/mips/boot/dts/xilfpga/Makefile
@@ -0,0 +1,9 @@
+dtb-$(CONFIG_XILFPGA_NEXYS4DDR)	+= nexys4ddr.dtb
+
+obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+
+# Force kbuild to make empty built-in.o if necessary
+obj-				+= dummy.o
+
+always				:= $(dtb-y)
+clean-files	:= *.dtb *.dtb.S
diff --git a/arch/mips/boot/dts/xilfpga/microAptiv.dtsi b/arch/mips/boot/dts/xilfpga/microAptiv.dtsi
new file mode 100644
index 0000000..81d518e
--- /dev/null
+++ b/arch/mips/boot/dts/xilfpga/microAptiv.dtsi
@@ -0,0 +1,21 @@
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	compatible = "img,xilfpga";
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		cpu@0 {
+			device_type = "cpu";
+			compatible = "mips,m14Kc";
+			clocks	= <&ext>;
+			reg = <0>;
+		};
+	};
+
+	ext: ext {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+	};
+};
diff --git a/arch/mips/boot/dts/xilfpga/nexys4ddr.dts b/arch/mips/boot/dts/xilfpga/nexys4ddr.dts
new file mode 100644
index 0000000..e225ae7
--- /dev/null
+++ b/arch/mips/boot/dts/xilfpga/nexys4ddr.dts
@@ -0,0 +1,47 @@
+/dts-v1/;
+
+#include "microAptiv.dtsi"
+
+/ {
+	compatible = "img,xilfpga";
+
+	memory {
+		device_type = "memory";
+		reg = <0x0 0x07ffffff>;
+	};
+
+	cpuintc: interrupt-controller@0 {
+		#address-cells = <0>;
+		#interrupt-cells = <1>;
+		interrupt-controller;
+		compatible = "mti,cpu-interrupt-controller";
+	};
+
+	axi_gpio: gpio@10600000 {
+		#gpio-cells = <1>;
+		compatible = "xlnx,xps-gpio-1.00.a";
+		gpio-controller;
+		reg = < 0x10600000 0x10000 >;
+		xlnx,all-inputs = <0x0>;
+		xlnx,dout-default = <0x0>;
+		xlnx,gpio-width = <0x16>;
+		xlnx,interrupt-present = <0x0>;
+		xlnx,is-dual = <0x0>;
+		xlnx,tri-default = <0xffffffff>;
+	} ;
+
+	axi_uart16550: serial@10400000 {
+		compatible = "ns16550a";
+		reg = <0x10400000 0x10000>;
+
+		reg-shift = <2>;
+		reg-offset = <0x1000>;
+
+		clock-frequency = <50000000>;
+		status = "okay";
+	};
+};
+
+&ext {
+	clock-frequency = <50000000>;
+};
-- 
1.9.1

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

* [PATCH 3/5] MIPS: dt: xilfpga: Add xilfpga device tree files.
@ 2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
  0 siblings, 0 replies; 38+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-14 12:51 UTC (permalink / raw)
  To: ralf, robh+dt, linus.walleij
  Cc: linux-mips, linux-gpio, devicetree, linux-kernel, Zubair.Kakakhel

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
 arch/mips/boot/dts/Makefile                |  1 +
 arch/mips/boot/dts/xilfpga/Makefile        |  9 ++++++
 arch/mips/boot/dts/xilfpga/microAptiv.dtsi | 21 +++++++++++++
 arch/mips/boot/dts/xilfpga/nexys4ddr.dts   | 47 ++++++++++++++++++++++++++++++
 4 files changed, 78 insertions(+)
 create mode 100644 arch/mips/boot/dts/xilfpga/Makefile
 create mode 100644 arch/mips/boot/dts/xilfpga/microAptiv.dtsi
 create mode 100644 arch/mips/boot/dts/xilfpga/nexys4ddr.dts

diff --git a/arch/mips/boot/dts/Makefile b/arch/mips/boot/dts/Makefile
index 778a340..0571ef7 100644
--- a/arch/mips/boot/dts/Makefile
+++ b/arch/mips/boot/dts/Makefile
@@ -6,6 +6,7 @@ dts-dirs	+= mti
 dts-dirs	+= netlogic
 dts-dirs	+= qca
 dts-dirs	+= ralink
+dts-dirs	+= xilfpga
 
 obj-y		:= $(addsuffix /, $(dts-dirs))
 
diff --git a/arch/mips/boot/dts/xilfpga/Makefile b/arch/mips/boot/dts/xilfpga/Makefile
new file mode 100644
index 0000000..913a752
--- /dev/null
+++ b/arch/mips/boot/dts/xilfpga/Makefile
@@ -0,0 +1,9 @@
+dtb-$(CONFIG_XILFPGA_NEXYS4DDR)	+= nexys4ddr.dtb
+
+obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+
+# Force kbuild to make empty built-in.o if necessary
+obj-				+= dummy.o
+
+always				:= $(dtb-y)
+clean-files	:= *.dtb *.dtb.S
diff --git a/arch/mips/boot/dts/xilfpga/microAptiv.dtsi b/arch/mips/boot/dts/xilfpga/microAptiv.dtsi
new file mode 100644
index 0000000..81d518e
--- /dev/null
+++ b/arch/mips/boot/dts/xilfpga/microAptiv.dtsi
@@ -0,0 +1,21 @@
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	compatible = "img,xilfpga";
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+		cpu@0 {
+			device_type = "cpu";
+			compatible = "mips,m14Kc";
+			clocks	= <&ext>;
+			reg = <0>;
+		};
+	};
+
+	ext: ext {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+	};
+};
diff --git a/arch/mips/boot/dts/xilfpga/nexys4ddr.dts b/arch/mips/boot/dts/xilfpga/nexys4ddr.dts
new file mode 100644
index 0000000..e225ae7
--- /dev/null
+++ b/arch/mips/boot/dts/xilfpga/nexys4ddr.dts
@@ -0,0 +1,47 @@
+/dts-v1/;
+
+#include "microAptiv.dtsi"
+
+/ {
+	compatible = "img,xilfpga";
+
+	memory {
+		device_type = "memory";
+		reg = <0x0 0x07ffffff>;
+	};
+
+	cpuintc: interrupt-controller@0 {
+		#address-cells = <0>;
+		#interrupt-cells = <1>;
+		interrupt-controller;
+		compatible = "mti,cpu-interrupt-controller";
+	};
+
+	axi_gpio: gpio@10600000 {
+		#gpio-cells = <1>;
+		compatible = "xlnx,xps-gpio-1.00.a";
+		gpio-controller;
+		reg = < 0x10600000 0x10000 >;
+		xlnx,all-inputs = <0x0>;
+		xlnx,dout-default = <0x0>;
+		xlnx,gpio-width = <0x16>;
+		xlnx,interrupt-present = <0x0>;
+		xlnx,is-dual = <0x0>;
+		xlnx,tri-default = <0xffffffff>;
+	} ;
+
+	axi_uart16550: serial@10400000 {
+		compatible = "ns16550a";
+		reg = <0x10400000 0x10000>;
+
+		reg-shift = <2>;
+		reg-offset = <0x1000>;
+
+		clock-frequency = <50000000>;
+		status = "okay";
+	};
+};
+
+&ext {
+	clock-frequency = <50000000>;
+};
-- 
1.9.1


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

* [PATCH 4/5] MIPS: xilfpga: Add mipsfpga platform code
  2015-10-14 12:51 ` Zubair Lutfullah Kakakhel
@ 2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
  -1 siblings, 0 replies; 38+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-14 12:51 UTC (permalink / raw)
  To: ralf, robh+dt, linus.walleij
  Cc: linux-mips, linux-gpio, devicetree, linux-kernel, Zubair.Kakakhel

The xilfpga platform will be DT only.

Add required platform code. DT files have already been added separately

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
 arch/mips/Kbuild.platforms                |  1 +
 arch/mips/Kconfig                         | 25 ++++++++++++++
 arch/mips/include/asm/mach-xilfpga/gpio.h | 19 +++++++++++
 arch/mips/include/asm/mach-xilfpga/irq.h  | 18 ++++++++++
 arch/mips/xilfpga/Kconfig                 |  9 +++++
 arch/mips/xilfpga/Makefile                |  7 ++++
 arch/mips/xilfpga/Platform                |  3 ++
 arch/mips/xilfpga/init.c                  | 57 +++++++++++++++++++++++++++++++
 arch/mips/xilfpga/intc.c                  | 26 ++++++++++++++
 arch/mips/xilfpga/time.c                  | 41 ++++++++++++++++++++++
 10 files changed, 206 insertions(+)
 create mode 100644 arch/mips/include/asm/mach-xilfpga/gpio.h
 create mode 100644 arch/mips/include/asm/mach-xilfpga/irq.h
 create mode 100644 arch/mips/xilfpga/Kconfig
 create mode 100644 arch/mips/xilfpga/Makefile
 create mode 100644 arch/mips/xilfpga/Platform
 create mode 100644 arch/mips/xilfpga/init.c
 create mode 100644 arch/mips/xilfpga/intc.c
 create mode 100644 arch/mips/xilfpga/time.c

diff --git a/arch/mips/Kbuild.platforms b/arch/mips/Kbuild.platforms
index a424e46..a96c81d 100644
--- a/arch/mips/Kbuild.platforms
+++ b/arch/mips/Kbuild.platforms
@@ -33,6 +33,7 @@ platforms += sibyte
 platforms += sni
 platforms += txx9
 platforms += vr41xx
+platforms += xilfpga
 
 # include the platform specific files
 include $(patsubst %, $(srctree)/arch/mips/%/Platform, $(platforms))
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index e3aa5b0..66c1a7e 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -401,6 +401,30 @@ config MACH_PISTACHIO
 	help
 	  This enables support for the IMG Pistachio SoC platform.
 
+config MACH_XILFPGA
+	bool "MIPSFPGA Xilinx based boards"
+	select ARCH_REQUIRE_GPIOLIB
+	select BOOT_ELF32
+	select BOOT_RAW
+	select BUILTIN_DTB
+	select CEVT_R4K
+	select COMMON_CLK
+	select CSRC_R4K
+	select IRQ_MIPS_CPU
+	select LIBFDT
+	select MIPS_CPU_SCACHE
+	select SERIAL_8250
+	select SERIAL_8250_CONSOLE
+	select SYS_HAS_EARLY_PRINTK
+	select SYS_HAS_CPU_MIPS32_R2
+	select SYS_SUPPORTS_32BIT_KERNEL
+	select SYS_SUPPORTS_LITTLE_ENDIAN
+	select SYS_SUPPORTS_ZBOOT_UART16550
+	select USE_OF
+	select USE_GENERIC_EARLY_PRINTK_8250
+	help
+	  This enables support for the Xilinx
+
 config MIPS_MALTA
 	bool "MIPS Malta board"
 	select ARCH_MAY_HAVE_PC_FDC
@@ -964,6 +988,7 @@ source "arch/mips/loongson32/Kconfig"
 source "arch/mips/loongson64/Kconfig"
 source "arch/mips/netlogic/Kconfig"
 source "arch/mips/paravirt/Kconfig"
+source "arch/mips/xilfpga/Kconfig"
 
 endmenu
 
diff --git a/arch/mips/include/asm/mach-xilfpga/gpio.h b/arch/mips/include/asm/mach-xilfpga/gpio.h
new file mode 100644
index 0000000..26778fc
--- /dev/null
+++ b/arch/mips/include/asm/mach-xilfpga/gpio.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2015 Imagination Technologies
+ * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
+ *
+ * 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 __ASM_MACH_XILFPGA_GPIO_H
+#define __ASM_MACH_XILFPGA_GPIO_H
+
+#include <asm-generic/gpio.h>
+
+#define gpio_get_value __gpio_get_value
+#define gpio_set_value __gpio_set_value
+
+#endif /* __ASM_MACH_XILFPGA_GPIO_H */
diff --git a/arch/mips/include/asm/mach-xilfpga/irq.h b/arch/mips/include/asm/mach-xilfpga/irq.h
new file mode 100644
index 0000000..0132a5b9
--- /dev/null
+++ b/arch/mips/include/asm/mach-xilfpga/irq.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2015 Imagination Technologies
+ * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
+ *
+ * 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 __MIPS_ASM_MACH_XILFPGA_IRQ_H__
+#define __MIPS_ASM_MACH_XILFPGA_IRQ_H__
+
+#define NR_IRQS 32
+
+#include_next <irq.h>
+
+#endif /* __MIPS_ASM_MACH_XILFPGA_IRQ_H__ */
diff --git a/arch/mips/xilfpga/Kconfig b/arch/mips/xilfpga/Kconfig
new file mode 100644
index 0000000..42a030a
--- /dev/null
+++ b/arch/mips/xilfpga/Kconfig
@@ -0,0 +1,9 @@
+choice
+	prompt "Machine type"
+	depends on MACH_XILFPGA
+	default XILFPGA_NEXYS4DDR
+
+config XILFPGA_NEXYS4DDR
+	bool "Nexys4DDR by Digilent"
+
+endchoice
diff --git a/arch/mips/xilfpga/Makefile b/arch/mips/xilfpga/Makefile
new file mode 100644
index 0000000..2385aa7
--- /dev/null
+++ b/arch/mips/xilfpga/Makefile
@@ -0,0 +1,7 @@
+#
+# Makefile for the Xilfpga
+#
+
+obj-y +=	init.o \
+		intc.o \
+		time.o
diff --git a/arch/mips/xilfpga/Platform b/arch/mips/xilfpga/Platform
new file mode 100644
index 0000000..ed375af
--- /dev/null
+++ b/arch/mips/xilfpga/Platform
@@ -0,0 +1,3 @@
+platform-$(CONFIG_MACH_XILFPGA) += xilfpga/
+cflags-$(CONFIG_MACH_XILFPGA) += -I$(srctree)/arch/mips/include/asm/mach-xilfpga
+load-$(CONFIG_MACH_XILFPGA) += 0xffffffff80100000
diff --git a/arch/mips/xilfpga/init.c b/arch/mips/xilfpga/init.c
new file mode 100644
index 0000000..5348af8
--- /dev/null
+++ b/arch/mips/xilfpga/init.c
@@ -0,0 +1,57 @@
+/*
+ * Xilfpga platform setup
+ *
+ * Copyright (C) 2015 Imagination Technologies
+ * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ */
+
+#include <linux/of_fdt.h>
+#include <linux/of_platform.h>
+
+#include <asm/prom.h>
+
+#define XILFPGA_UART_BASE	0xb0401000
+
+const char *get_system_type(void)
+{
+	return "MIPSFpga";
+}
+
+void __init plat_mem_setup(void)
+{
+	__dt_setup_arch(__dtb_start);
+	strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
+}
+
+void __init prom_init(void)
+{
+	setup_8250_early_printk_port(XILFPGA_UART_BASE, 2, 50000);
+}
+
+void __init prom_free_prom_memory(void)
+{
+}
+
+void __init device_tree_init(void)
+{
+	if (!initial_boot_params)
+		return;
+
+	unflatten_and_copy_device_tree();
+}
+
+static int __init plat_of_setup(void)
+{
+	if (!of_have_populated_dt())
+		panic("Device tree not present");
+
+	if (of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL))
+		panic("Failed to populate DT");
+
+	return 0;
+}
+arch_initcall(plat_of_setup);
diff --git a/arch/mips/xilfpga/intc.c b/arch/mips/xilfpga/intc.c
new file mode 100644
index 0000000..919eb97
--- /dev/null
+++ b/arch/mips/xilfpga/intc.c
@@ -0,0 +1,26 @@
+/*
+ * Xilfpga interrupt controller setup
+ *
+ * Copyright (C) 2015 Imagination Technologies
+ * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ */
+
+#include <linux/of.h>
+#include <linux/of_irq.h>
+
+#include <asm/irq_cpu.h>
+
+static struct of_device_id of_irq_ids[] __initdata = {
+	{ .compatible = "mti,cpu-interrupt-controller", .data = mips_cpu_irq_of_init },
+	{},
+};
+
+void __init arch_init_irq(void)
+{
+	of_irq_init(of_irq_ids);
+}
+
diff --git a/arch/mips/xilfpga/time.c b/arch/mips/xilfpga/time.c
new file mode 100644
index 0000000..3f2e39e
--- /dev/null
+++ b/arch/mips/xilfpga/time.c
@@ -0,0 +1,41 @@
+/*
+ * Xilfpga clocksource/timer setup
+ *
+ * Copyright (C) 2015 Imagination Technologies
+ * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ */
+
+#include <linux/clk.h>
+#include <linux/clk-provider.h>
+#include <linux/clocksource.h>
+#include <linux/of.h>
+
+#include <asm/time.h>
+
+void __init plat_time_init(void)
+{
+	struct device_node *np;
+	struct clk *clk = 0;
+
+	of_clk_init(NULL);
+	clocksource_of_init();
+
+	np = of_get_cpu_node(0, NULL);
+	if (!np) {
+		pr_err("Failed to get CPU node\n");
+		return;
+	}
+
+	clk = of_clk_get(np, 0);
+	if (IS_ERR(clk)) {
+		pr_err("Failed to get CPU clock: %ld\n", PTR_ERR(clk));
+		return;
+	}
+
+	mips_hpt_frequency = clk_get_rate(clk) / 2;
+	clk_put(clk);
+}
-- 
1.9.1

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

* [PATCH 4/5] MIPS: xilfpga: Add mipsfpga platform code
@ 2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
  0 siblings, 0 replies; 38+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-14 12:51 UTC (permalink / raw)
  To: ralf, robh+dt, linus.walleij
  Cc: linux-mips, linux-gpio, devicetree, linux-kernel, Zubair.Kakakhel

The xilfpga platform will be DT only.

Add required platform code. DT files have already been added separately

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
 arch/mips/Kbuild.platforms                |  1 +
 arch/mips/Kconfig                         | 25 ++++++++++++++
 arch/mips/include/asm/mach-xilfpga/gpio.h | 19 +++++++++++
 arch/mips/include/asm/mach-xilfpga/irq.h  | 18 ++++++++++
 arch/mips/xilfpga/Kconfig                 |  9 +++++
 arch/mips/xilfpga/Makefile                |  7 ++++
 arch/mips/xilfpga/Platform                |  3 ++
 arch/mips/xilfpga/init.c                  | 57 +++++++++++++++++++++++++++++++
 arch/mips/xilfpga/intc.c                  | 26 ++++++++++++++
 arch/mips/xilfpga/time.c                  | 41 ++++++++++++++++++++++
 10 files changed, 206 insertions(+)
 create mode 100644 arch/mips/include/asm/mach-xilfpga/gpio.h
 create mode 100644 arch/mips/include/asm/mach-xilfpga/irq.h
 create mode 100644 arch/mips/xilfpga/Kconfig
 create mode 100644 arch/mips/xilfpga/Makefile
 create mode 100644 arch/mips/xilfpga/Platform
 create mode 100644 arch/mips/xilfpga/init.c
 create mode 100644 arch/mips/xilfpga/intc.c
 create mode 100644 arch/mips/xilfpga/time.c

diff --git a/arch/mips/Kbuild.platforms b/arch/mips/Kbuild.platforms
index a424e46..a96c81d 100644
--- a/arch/mips/Kbuild.platforms
+++ b/arch/mips/Kbuild.platforms
@@ -33,6 +33,7 @@ platforms += sibyte
 platforms += sni
 platforms += txx9
 platforms += vr41xx
+platforms += xilfpga
 
 # include the platform specific files
 include $(patsubst %, $(srctree)/arch/mips/%/Platform, $(platforms))
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index e3aa5b0..66c1a7e 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -401,6 +401,30 @@ config MACH_PISTACHIO
 	help
 	  This enables support for the IMG Pistachio SoC platform.
 
+config MACH_XILFPGA
+	bool "MIPSFPGA Xilinx based boards"
+	select ARCH_REQUIRE_GPIOLIB
+	select BOOT_ELF32
+	select BOOT_RAW
+	select BUILTIN_DTB
+	select CEVT_R4K
+	select COMMON_CLK
+	select CSRC_R4K
+	select IRQ_MIPS_CPU
+	select LIBFDT
+	select MIPS_CPU_SCACHE
+	select SERIAL_8250
+	select SERIAL_8250_CONSOLE
+	select SYS_HAS_EARLY_PRINTK
+	select SYS_HAS_CPU_MIPS32_R2
+	select SYS_SUPPORTS_32BIT_KERNEL
+	select SYS_SUPPORTS_LITTLE_ENDIAN
+	select SYS_SUPPORTS_ZBOOT_UART16550
+	select USE_OF
+	select USE_GENERIC_EARLY_PRINTK_8250
+	help
+	  This enables support for the Xilinx
+
 config MIPS_MALTA
 	bool "MIPS Malta board"
 	select ARCH_MAY_HAVE_PC_FDC
@@ -964,6 +988,7 @@ source "arch/mips/loongson32/Kconfig"
 source "arch/mips/loongson64/Kconfig"
 source "arch/mips/netlogic/Kconfig"
 source "arch/mips/paravirt/Kconfig"
+source "arch/mips/xilfpga/Kconfig"
 
 endmenu
 
diff --git a/arch/mips/include/asm/mach-xilfpga/gpio.h b/arch/mips/include/asm/mach-xilfpga/gpio.h
new file mode 100644
index 0000000..26778fc
--- /dev/null
+++ b/arch/mips/include/asm/mach-xilfpga/gpio.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2015 Imagination Technologies
+ * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
+ *
+ * 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 __ASM_MACH_XILFPGA_GPIO_H
+#define __ASM_MACH_XILFPGA_GPIO_H
+
+#include <asm-generic/gpio.h>
+
+#define gpio_get_value __gpio_get_value
+#define gpio_set_value __gpio_set_value
+
+#endif /* __ASM_MACH_XILFPGA_GPIO_H */
diff --git a/arch/mips/include/asm/mach-xilfpga/irq.h b/arch/mips/include/asm/mach-xilfpga/irq.h
new file mode 100644
index 0000000..0132a5b9
--- /dev/null
+++ b/arch/mips/include/asm/mach-xilfpga/irq.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2015 Imagination Technologies
+ * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
+ *
+ * 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 __MIPS_ASM_MACH_XILFPGA_IRQ_H__
+#define __MIPS_ASM_MACH_XILFPGA_IRQ_H__
+
+#define NR_IRQS 32
+
+#include_next <irq.h>
+
+#endif /* __MIPS_ASM_MACH_XILFPGA_IRQ_H__ */
diff --git a/arch/mips/xilfpga/Kconfig b/arch/mips/xilfpga/Kconfig
new file mode 100644
index 0000000..42a030a
--- /dev/null
+++ b/arch/mips/xilfpga/Kconfig
@@ -0,0 +1,9 @@
+choice
+	prompt "Machine type"
+	depends on MACH_XILFPGA
+	default XILFPGA_NEXYS4DDR
+
+config XILFPGA_NEXYS4DDR
+	bool "Nexys4DDR by Digilent"
+
+endchoice
diff --git a/arch/mips/xilfpga/Makefile b/arch/mips/xilfpga/Makefile
new file mode 100644
index 0000000..2385aa7
--- /dev/null
+++ b/arch/mips/xilfpga/Makefile
@@ -0,0 +1,7 @@
+#
+# Makefile for the Xilfpga
+#
+
+obj-y +=	init.o \
+		intc.o \
+		time.o
diff --git a/arch/mips/xilfpga/Platform b/arch/mips/xilfpga/Platform
new file mode 100644
index 0000000..ed375af
--- /dev/null
+++ b/arch/mips/xilfpga/Platform
@@ -0,0 +1,3 @@
+platform-$(CONFIG_MACH_XILFPGA) += xilfpga/
+cflags-$(CONFIG_MACH_XILFPGA) += -I$(srctree)/arch/mips/include/asm/mach-xilfpga
+load-$(CONFIG_MACH_XILFPGA) += 0xffffffff80100000
diff --git a/arch/mips/xilfpga/init.c b/arch/mips/xilfpga/init.c
new file mode 100644
index 0000000..5348af8
--- /dev/null
+++ b/arch/mips/xilfpga/init.c
@@ -0,0 +1,57 @@
+/*
+ * Xilfpga platform setup
+ *
+ * Copyright (C) 2015 Imagination Technologies
+ * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ */
+
+#include <linux/of_fdt.h>
+#include <linux/of_platform.h>
+
+#include <asm/prom.h>
+
+#define XILFPGA_UART_BASE	0xb0401000
+
+const char *get_system_type(void)
+{
+	return "MIPSFpga";
+}
+
+void __init plat_mem_setup(void)
+{
+	__dt_setup_arch(__dtb_start);
+	strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
+}
+
+void __init prom_init(void)
+{
+	setup_8250_early_printk_port(XILFPGA_UART_BASE, 2, 50000);
+}
+
+void __init prom_free_prom_memory(void)
+{
+}
+
+void __init device_tree_init(void)
+{
+	if (!initial_boot_params)
+		return;
+
+	unflatten_and_copy_device_tree();
+}
+
+static int __init plat_of_setup(void)
+{
+	if (!of_have_populated_dt())
+		panic("Device tree not present");
+
+	if (of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL))
+		panic("Failed to populate DT");
+
+	return 0;
+}
+arch_initcall(plat_of_setup);
diff --git a/arch/mips/xilfpga/intc.c b/arch/mips/xilfpga/intc.c
new file mode 100644
index 0000000..919eb97
--- /dev/null
+++ b/arch/mips/xilfpga/intc.c
@@ -0,0 +1,26 @@
+/*
+ * Xilfpga interrupt controller setup
+ *
+ * Copyright (C) 2015 Imagination Technologies
+ * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ */
+
+#include <linux/of.h>
+#include <linux/of_irq.h>
+
+#include <asm/irq_cpu.h>
+
+static struct of_device_id of_irq_ids[] __initdata = {
+	{ .compatible = "mti,cpu-interrupt-controller", .data = mips_cpu_irq_of_init },
+	{},
+};
+
+void __init arch_init_irq(void)
+{
+	of_irq_init(of_irq_ids);
+}
+
diff --git a/arch/mips/xilfpga/time.c b/arch/mips/xilfpga/time.c
new file mode 100644
index 0000000..3f2e39e
--- /dev/null
+++ b/arch/mips/xilfpga/time.c
@@ -0,0 +1,41 @@
+/*
+ * Xilfpga clocksource/timer setup
+ *
+ * Copyright (C) 2015 Imagination Technologies
+ * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ */
+
+#include <linux/clk.h>
+#include <linux/clk-provider.h>
+#include <linux/clocksource.h>
+#include <linux/of.h>
+
+#include <asm/time.h>
+
+void __init plat_time_init(void)
+{
+	struct device_node *np;
+	struct clk *clk = 0;
+
+	of_clk_init(NULL);
+	clocksource_of_init();
+
+	np = of_get_cpu_node(0, NULL);
+	if (!np) {
+		pr_err("Failed to get CPU node\n");
+		return;
+	}
+
+	clk = of_clk_get(np, 0);
+	if (IS_ERR(clk)) {
+		pr_err("Failed to get CPU clock: %ld\n", PTR_ERR(clk));
+		return;
+	}
+
+	mips_hpt_frequency = clk_get_rate(clk) / 2;
+	clk_put(clk);
+}
-- 
1.9.1


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

* [PATCH 5/5] MIPS: Add xilfpga defconfig
  2015-10-14 12:51 ` Zubair Lutfullah Kakakhel
@ 2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
  -1 siblings, 0 replies; 38+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-14 12:51 UTC (permalink / raw)
  To: ralf, robh+dt, linus.walleij
  Cc: linux-mips, linux-gpio, devicetree, linux-kernel, Zubair.Kakakhel

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
 arch/mips/configs/xilfpga_defconfig | 59 +++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 arch/mips/configs/xilfpga_defconfig

diff --git a/arch/mips/configs/xilfpga_defconfig b/arch/mips/configs/xilfpga_defconfig
new file mode 100644
index 0000000..94bb9b8
--- /dev/null
+++ b/arch/mips/configs/xilfpga_defconfig
@@ -0,0 +1,59 @@
+CONFIG_MACH_XILFPGA=y
+# CONFIG_COMPACTION is not set
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_CROSS_MEMORY_ATTACH is not set
+# CONFIG_USELIB is not set
+# CONFIG_SHMEM is not set
+# CONFIG_AIO is not set
+# CONFIG_ADVISE_SYSCALLS is not set
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_BLOCK is not set
+# CONFIG_SUSPEND is not set
+# CONFIG_UEVENT_HELPER is not set
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+# CONFIG_ALLOW_DEV_COREDUMP is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_SERIO is not set
+CONFIG_VT_HW_CONSOLE_BINDING=y
+# CONFIG_UNIX98_PTYS is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
+CONFIG_SERIAL_8250_NR_UARTS=1
+CONFIG_SERIAL_8250_RUNTIME_UARTS=1
+CONFIG_SERIAL_OF_PLATFORM=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_XILINX=y
+# CONFIG_HWMON is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_MIPS_PLATFORM_DEVICES is not set
+# CONFIG_IOMMU_SUPPORT is not set
+# CONFIG_FILE_LOCKING is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_INOTIFY_USER is not set
+# CONFIG_PROC_SYSCTL is not set
+# CONFIG_PROC_PAGE_MONITOR is not set
+# CONFIG_MISC_FILESYSTEMS is not set
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_PANIC_ON_OOPS=y
+# CONFIG_SCHED_DEBUG is not set
+CONFIG_DEBUG_LOCK_ALLOC=y
+# CONFIG_FTRACE is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="console=ttyS0,115200 clk_ignore_unused earlyprintk=serial,ttyS0,115200"
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRC16=y
+CONFIG_LIBCRC32C=y
-- 
1.9.1

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

* [PATCH 5/5] MIPS: Add xilfpga defconfig
@ 2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
  0 siblings, 0 replies; 38+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-14 12:51 UTC (permalink / raw)
  To: ralf, robh+dt, linus.walleij
  Cc: linux-mips, linux-gpio, devicetree, linux-kernel, Zubair.Kakakhel

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
 arch/mips/configs/xilfpga_defconfig | 59 +++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 arch/mips/configs/xilfpga_defconfig

diff --git a/arch/mips/configs/xilfpga_defconfig b/arch/mips/configs/xilfpga_defconfig
new file mode 100644
index 0000000..94bb9b8
--- /dev/null
+++ b/arch/mips/configs/xilfpga_defconfig
@@ -0,0 +1,59 @@
+CONFIG_MACH_XILFPGA=y
+# CONFIG_COMPACTION is not set
+# CONFIG_LOCALVERSION_AUTO is not set
+# CONFIG_CROSS_MEMORY_ATTACH is not set
+# CONFIG_USELIB is not set
+# CONFIG_SHMEM is not set
+# CONFIG_AIO is not set
+# CONFIG_ADVISE_SYSCALLS is not set
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_BLOCK is not set
+# CONFIG_SUSPEND is not set
+# CONFIG_UEVENT_HELPER is not set
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+# CONFIG_STANDALONE is not set
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+# CONFIG_FW_LOADER is not set
+# CONFIG_ALLOW_DEV_COREDUMP is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_SERIO is not set
+CONFIG_VT_HW_CONSOLE_BINDING=y
+# CONFIG_UNIX98_PTYS is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
+CONFIG_SERIAL_8250_NR_UARTS=1
+CONFIG_SERIAL_8250_RUNTIME_UARTS=1
+CONFIG_SERIAL_OF_PLATFORM=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_XILINX=y
+# CONFIG_HWMON is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_MIPS_PLATFORM_DEVICES is not set
+# CONFIG_IOMMU_SUPPORT is not set
+# CONFIG_FILE_LOCKING is not set
+# CONFIG_DNOTIFY is not set
+# CONFIG_INOTIFY_USER is not set
+# CONFIG_PROC_SYSCTL is not set
+# CONFIG_PROC_PAGE_MONITOR is not set
+# CONFIG_MISC_FILESYSTEMS is not set
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_PANIC_ON_OOPS=y
+# CONFIG_SCHED_DEBUG is not set
+CONFIG_DEBUG_LOCK_ALLOC=y
+# CONFIG_FTRACE is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="console=ttyS0,115200 clk_ignore_unused earlyprintk=serial,ttyS0,115200"
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRC16=y
+CONFIG_LIBCRC32C=y
-- 
1.9.1


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

* Re: [PATCH 2/5] gpio/xilinx: enable for MIPS
  2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
@ 2015-10-14 15:18     ` Sören Brinkmann
  -1 siblings, 0 replies; 38+ messages in thread
From: Sören Brinkmann @ 2015-10-14 15:18 UTC (permalink / raw)
  To: Zubair Lutfullah Kakakhel
  Cc: ralf, robh+dt, linus.walleij, linux-mips, linux-gpio, devicetree,
	linux-kernel

On Wed, 2015-10-14 at 01:51PM +0100, Zubair Lutfullah Kakakhel wrote:
> MIPSfpga uses the axi gpio controller. Enable the driver for MIPS.
> 
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> ---
>  drivers/gpio/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> index 8949b3f..58e9afd 100644
> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -508,7 +508,7 @@ config GPIO_XGENE_SB
>  
>  config GPIO_XILINX
>  	tristate "Xilinx GPIO support"
> -	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86)
> +	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86 || MIPS)

Hmm, in general, this driver is hopefully generic enough that it doesn't
have any real architecture dependencies. And I suspect, we want to
enable this driver for ARM64 for ZynqMP soon too. Should we probably
drop these arch dependencies completely? It seems to become quite a long list.

	Sören

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

* Re: [PATCH 2/5] gpio/xilinx: enable for MIPS
@ 2015-10-14 15:18     ` Sören Brinkmann
  0 siblings, 0 replies; 38+ messages in thread
From: Sören Brinkmann @ 2015-10-14 15:18 UTC (permalink / raw)
  To: Zubair Lutfullah Kakakhel
  Cc: ralf, robh+dt, linus.walleij, linux-mips, linux-gpio, devicetree,
	linux-kernel

On Wed, 2015-10-14 at 01:51PM +0100, Zubair Lutfullah Kakakhel wrote:
> MIPSfpga uses the axi gpio controller. Enable the driver for MIPS.
> 
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> ---
>  drivers/gpio/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> index 8949b3f..58e9afd 100644
> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -508,7 +508,7 @@ config GPIO_XGENE_SB
>  
>  config GPIO_XILINX
>  	tristate "Xilinx GPIO support"
> -	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86)
> +	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86 || MIPS)

Hmm, in general, this driver is hopefully generic enough that it doesn't
have any real architecture dependencies. And I suspect, we want to
enable this driver for ARM64 for ZynqMP soon too. Should we probably
drop these arch dependencies completely? It seems to become quite a long list.

	Sören

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

* Re: [PATCH 2/5] gpio/xilinx: enable for MIPS
  2015-10-14 15:18     ` Sören Brinkmann
  (?)
@ 2015-10-14 15:57     ` Lars-Peter Clausen
  2015-10-14 16:54         ` Sören Brinkmann
  2015-10-19  6:55       ` Linus Walleij
  -1 siblings, 2 replies; 38+ messages in thread
From: Lars-Peter Clausen @ 2015-10-14 15:57 UTC (permalink / raw)
  To: Sören Brinkmann, Zubair Lutfullah Kakakhel
  Cc: ralf, robh+dt, linus.walleij, linux-mips, linux-gpio, devicetree,
	linux-kernel

On 10/14/2015 05:18 PM, Sören Brinkmann wrote:
> On Wed, 2015-10-14 at 01:51PM +0100, Zubair Lutfullah Kakakhel wrote:
>> MIPSfpga uses the axi gpio controller. Enable the driver for MIPS.
>>
>> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
>> ---
>>  drivers/gpio/Kconfig | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
>> index 8949b3f..58e9afd 100644
>> --- a/drivers/gpio/Kconfig
>> +++ b/drivers/gpio/Kconfig
>> @@ -508,7 +508,7 @@ config GPIO_XGENE_SB
>>  
>>  config GPIO_XILINX
>>  	tristate "Xilinx GPIO support"
>> -	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86)
>> +	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86 || MIPS)
> 
> Hmm, in general, this driver is hopefully generic enough that it doesn't
> have any real architecture dependencies. And I suspect, we want to
> enable this driver for ARM64 for ZynqMP soon too. Should we probably
> drop these arch dependencies completely? It seems to become quite a long list.

I've been thinking about this a while ago. This is certainly not the only
driver affected by this problem. But the thing is people always complain if
new symbols become visable in Kconfig that don't apply to their platform.

Maybe we should introduce a HAS_REPROGRAMABLE_LOGIC (or similar) feature
Kconfig symbol and let platforms which have a FPGA select it and let drivers
for FPGA peripherals depend on it.

- Lars

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

* Re: [PATCH 2/5] gpio/xilinx: enable for MIPS
  2015-10-14 15:57     ` Lars-Peter Clausen
@ 2015-10-14 16:54         ` Sören Brinkmann
  2015-10-19  6:55       ` Linus Walleij
  1 sibling, 0 replies; 38+ messages in thread
From: Sören Brinkmann @ 2015-10-14 16:54 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Zubair Lutfullah Kakakhel, ralf, robh+dt, linus.walleij,
	linux-mips, linux-gpio, devicetree, linux-kernel

On Wed, 2015-10-14 at 05:57PM +0200, Lars-Peter Clausen wrote:
> On 10/14/2015 05:18 PM, Sören Brinkmann wrote:
> > On Wed, 2015-10-14 at 01:51PM +0100, Zubair Lutfullah Kakakhel wrote:
> >> MIPSfpga uses the axi gpio controller. Enable the driver for MIPS.
> >>
> >> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> >> ---
> >>  drivers/gpio/Kconfig | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> >> index 8949b3f..58e9afd 100644
> >> --- a/drivers/gpio/Kconfig
> >> +++ b/drivers/gpio/Kconfig
> >> @@ -508,7 +508,7 @@ config GPIO_XGENE_SB
> >>  
> >>  config GPIO_XILINX
> >>  	tristate "Xilinx GPIO support"
> >> -	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86)
> >> +	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86 || MIPS)
> > 
> > Hmm, in general, this driver is hopefully generic enough that it doesn't
> > have any real architecture dependencies. And I suspect, we want to
> > enable this driver for ARM64 for ZynqMP soon too. Should we probably
> > drop these arch dependencies completely? It seems to become quite a long list.
> 
> I've been thinking about this a while ago. This is certainly not the only
> driver affected by this problem. But the thing is people always complain if
> new symbols become visable in Kconfig that don't apply to their platform.
> 
> Maybe we should introduce a HAS_REPROGRAMABLE_LOGIC (or similar) feature
> Kconfig symbol and let platforms which have a FPGA select it and let drivers
> for FPGA peripherals depend on it.

Sounds like a good idea to me. But, does that work for all use-cases.
E.g. if you plug some PCIe card with an FPGA into an x86(_64) machine.
That would allow you to use those drivers, but I'm not sure how that
could pull in the new config symbol.

	Sören

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

* Re: [PATCH 2/5] gpio/xilinx: enable for MIPS
@ 2015-10-14 16:54         ` Sören Brinkmann
  0 siblings, 0 replies; 38+ messages in thread
From: Sören Brinkmann @ 2015-10-14 16:54 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Zubair Lutfullah Kakakhel, ralf, robh+dt, linus.walleij,
	linux-mips, linux-gpio, devicetree, linux-kernel

On Wed, 2015-10-14 at 05:57PM +0200, Lars-Peter Clausen wrote:
> On 10/14/2015 05:18 PM, Sören Brinkmann wrote:
> > On Wed, 2015-10-14 at 01:51PM +0100, Zubair Lutfullah Kakakhel wrote:
> >> MIPSfpga uses the axi gpio controller. Enable the driver for MIPS.
> >>
> >> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> >> ---
> >>  drivers/gpio/Kconfig | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> >> index 8949b3f..58e9afd 100644
> >> --- a/drivers/gpio/Kconfig
> >> +++ b/drivers/gpio/Kconfig
> >> @@ -508,7 +508,7 @@ config GPIO_XGENE_SB
> >>  
> >>  config GPIO_XILINX
> >>  	tristate "Xilinx GPIO support"
> >> -	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86)
> >> +	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86 || MIPS)
> > 
> > Hmm, in general, this driver is hopefully generic enough that it doesn't
> > have any real architecture dependencies. And I suspect, we want to
> > enable this driver for ARM64 for ZynqMP soon too. Should we probably
> > drop these arch dependencies completely? It seems to become quite a long list.
> 
> I've been thinking about this a while ago. This is certainly not the only
> driver affected by this problem. But the thing is people always complain if
> new symbols become visable in Kconfig that don't apply to their platform.
> 
> Maybe we should introduce a HAS_REPROGRAMABLE_LOGIC (or similar) feature
> Kconfig symbol and let platforms which have a FPGA select it and let drivers
> for FPGA peripherals depend on it.

Sounds like a good idea to me. But, does that work for all use-cases.
E.g. if you plug some PCIe card with an FPGA into an x86(_64) machine.
That would allow you to use those drivers, but I'm not sure how that
could pull in the new config symbol.

	Sören

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

* Re: [PATCH 2/5] gpio/xilinx: enable for MIPS
  2015-10-14 16:54         ` Sören Brinkmann
@ 2015-10-14 17:24           ` Lars-Peter Clausen
  -1 siblings, 0 replies; 38+ messages in thread
From: Lars-Peter Clausen @ 2015-10-14 17:24 UTC (permalink / raw)
  To: Sören Brinkmann
  Cc: Zubair Lutfullah Kakakhel, ralf-6z/3iImG2C8G8FEW9MqTrA,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On 10/14/2015 06:54 PM, Sören Brinkmann wrote:
> On Wed, 2015-10-14 at 05:57PM +0200, Lars-Peter Clausen wrote:
>> On 10/14/2015 05:18 PM, Sören Brinkmann wrote:
>>> On Wed, 2015-10-14 at 01:51PM +0100, Zubair Lutfullah Kakakhel wrote:
>>>> MIPSfpga uses the axi gpio controller. Enable the driver for MIPS.
>>>>
>>>> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
>>>> ---
>>>>  drivers/gpio/Kconfig | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
>>>> index 8949b3f..58e9afd 100644
>>>> --- a/drivers/gpio/Kconfig
>>>> +++ b/drivers/gpio/Kconfig
>>>> @@ -508,7 +508,7 @@ config GPIO_XGENE_SB
>>>>  
>>>>  config GPIO_XILINX
>>>>  	tristate "Xilinx GPIO support"
>>>> -	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86)
>>>> +	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86 || MIPS)
>>>
>>> Hmm, in general, this driver is hopefully generic enough that it doesn't
>>> have any real architecture dependencies. And I suspect, we want to
>>> enable this driver for ARM64 for ZynqMP soon too. Should we probably
>>> drop these arch dependencies completely? It seems to become quite a long list.
>>
>> I've been thinking about this a while ago. This is certainly not the only
>> driver affected by this problem. But the thing is people always complain if
>> new symbols become visable in Kconfig that don't apply to their platform.
>>
>> Maybe we should introduce a HAS_REPROGRAMABLE_LOGIC (or similar) feature
>> Kconfig symbol and let platforms which have a FPGA select it and let drivers
>> for FPGA peripherals depend on it.
> 
> Sounds like a good idea to me. But, does that work for all use-cases.
> E.g. if you plug some PCIe card with an FPGA into an x86(_64) machine.
> That would allow you to use those drivers, but I'm not sure how that
> could pull in the new config symbol.

Hm, right. We could also make it a user-selectable config symbol. In that
case you only need to disable one symbol when you don't have FPGA support
rather than one for each driver. Although I'm not quite sure where to put
such a symbol.

- Lars

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 2/5] gpio/xilinx: enable for MIPS
@ 2015-10-14 17:24           ` Lars-Peter Clausen
  0 siblings, 0 replies; 38+ messages in thread
From: Lars-Peter Clausen @ 2015-10-14 17:24 UTC (permalink / raw)
  To: Sören Brinkmann
  Cc: Zubair Lutfullah Kakakhel, ralf, robh+dt, linus.walleij,
	linux-mips, linux-gpio, devicetree, linux-kernel

On 10/14/2015 06:54 PM, Sören Brinkmann wrote:
> On Wed, 2015-10-14 at 05:57PM +0200, Lars-Peter Clausen wrote:
>> On 10/14/2015 05:18 PM, Sören Brinkmann wrote:
>>> On Wed, 2015-10-14 at 01:51PM +0100, Zubair Lutfullah Kakakhel wrote:
>>>> MIPSfpga uses the axi gpio controller. Enable the driver for MIPS.
>>>>
>>>> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
>>>> ---
>>>>  drivers/gpio/Kconfig | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
>>>> index 8949b3f..58e9afd 100644
>>>> --- a/drivers/gpio/Kconfig
>>>> +++ b/drivers/gpio/Kconfig
>>>> @@ -508,7 +508,7 @@ config GPIO_XGENE_SB
>>>>  
>>>>  config GPIO_XILINX
>>>>  	tristate "Xilinx GPIO support"
>>>> -	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86)
>>>> +	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86 || MIPS)
>>>
>>> Hmm, in general, this driver is hopefully generic enough that it doesn't
>>> have any real architecture dependencies. And I suspect, we want to
>>> enable this driver for ARM64 for ZynqMP soon too. Should we probably
>>> drop these arch dependencies completely? It seems to become quite a long list.
>>
>> I've been thinking about this a while ago. This is certainly not the only
>> driver affected by this problem. But the thing is people always complain if
>> new symbols become visable in Kconfig that don't apply to their platform.
>>
>> Maybe we should introduce a HAS_REPROGRAMABLE_LOGIC (or similar) feature
>> Kconfig symbol and let platforms which have a FPGA select it and let drivers
>> for FPGA peripherals depend on it.
> 
> Sounds like a good idea to me. But, does that work for all use-cases.
> E.g. if you plug some PCIe card with an FPGA into an x86(_64) machine.
> That would allow you to use those drivers, but I'm not sure how that
> could pull in the new config symbol.

Hm, right. We could also make it a user-selectable config symbol. In that
case you only need to disable one symbol when you don't have FPGA support
rather than one for each driver. Although I'm not quite sure where to put
such a symbol.

- Lars


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

* Re: [PATCH 2/5] gpio/xilinx: enable for MIPS
  2015-10-14 17:24           ` Lars-Peter Clausen
@ 2015-10-14 17:33             ` Sören Brinkmann
  -1 siblings, 0 replies; 38+ messages in thread
From: Sören Brinkmann @ 2015-10-14 17:33 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Zubair Lutfullah Kakakhel, ralf, robh+dt, linus.walleij,
	linux-mips, linux-gpio, devicetree, linux-kernel

On Wed, 2015-10-14 at 07:24PM +0200, Lars-Peter Clausen wrote:
> On 10/14/2015 06:54 PM, Sören Brinkmann wrote:
> > On Wed, 2015-10-14 at 05:57PM +0200, Lars-Peter Clausen wrote:
> >> On 10/14/2015 05:18 PM, Sören Brinkmann wrote:
> >>> On Wed, 2015-10-14 at 01:51PM +0100, Zubair Lutfullah Kakakhel wrote:
> >>>> MIPSfpga uses the axi gpio controller. Enable the driver for MIPS.
> >>>>
> >>>> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> >>>> ---
> >>>>  drivers/gpio/Kconfig | 2 +-
> >>>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>>
> >>>> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> >>>> index 8949b3f..58e9afd 100644
> >>>> --- a/drivers/gpio/Kconfig
> >>>> +++ b/drivers/gpio/Kconfig
> >>>> @@ -508,7 +508,7 @@ config GPIO_XGENE_SB
> >>>>  
> >>>>  config GPIO_XILINX
> >>>>  	tristate "Xilinx GPIO support"
> >>>> -	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86)
> >>>> +	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86 || MIPS)
> >>>
> >>> Hmm, in general, this driver is hopefully generic enough that it doesn't
> >>> have any real architecture dependencies. And I suspect, we want to
> >>> enable this driver for ARM64 for ZynqMP soon too. Should we probably
> >>> drop these arch dependencies completely? It seems to become quite a long list.
> >>
> >> I've been thinking about this a while ago. This is certainly not the only
> >> driver affected by this problem. But the thing is people always complain if
> >> new symbols become visable in Kconfig that don't apply to their platform.
> >>
> >> Maybe we should introduce a HAS_REPROGRAMABLE_LOGIC (or similar) feature
> >> Kconfig symbol and let platforms which have a FPGA select it and let drivers
> >> for FPGA peripherals depend on it.
> > 
> > Sounds like a good idea to me. But, does that work for all use-cases.
> > E.g. if you plug some PCIe card with an FPGA into an x86(_64) machine.
> > That would allow you to use those drivers, but I'm not sure how that
> > could pull in the new config symbol.
> 
> Hm, right. We could also make it a user-selectable config symbol. In that
> case you only need to disable one symbol when you don't have FPGA support
> rather than one for each driver. Although I'm not quite sure where to put
> such a symbol.

Eventually, the FPGA manager subsystem could probably provide some high
level config symbols. Though, it is probably also not given that every
FPGA-enabled platform needs the FPGA manager.

	Sören

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

* Re: [PATCH 2/5] gpio/xilinx: enable for MIPS
@ 2015-10-14 17:33             ` Sören Brinkmann
  0 siblings, 0 replies; 38+ messages in thread
From: Sören Brinkmann @ 2015-10-14 17:33 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Zubair Lutfullah Kakakhel, ralf, robh+dt, linus.walleij,
	linux-mips, linux-gpio, devicetree, linux-kernel

On Wed, 2015-10-14 at 07:24PM +0200, Lars-Peter Clausen wrote:
> On 10/14/2015 06:54 PM, Sören Brinkmann wrote:
> > On Wed, 2015-10-14 at 05:57PM +0200, Lars-Peter Clausen wrote:
> >> On 10/14/2015 05:18 PM, Sören Brinkmann wrote:
> >>> On Wed, 2015-10-14 at 01:51PM +0100, Zubair Lutfullah Kakakhel wrote:
> >>>> MIPSfpga uses the axi gpio controller. Enable the driver for MIPS.
> >>>>
> >>>> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> >>>> ---
> >>>>  drivers/gpio/Kconfig | 2 +-
> >>>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>>
> >>>> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> >>>> index 8949b3f..58e9afd 100644
> >>>> --- a/drivers/gpio/Kconfig
> >>>> +++ b/drivers/gpio/Kconfig
> >>>> @@ -508,7 +508,7 @@ config GPIO_XGENE_SB
> >>>>  
> >>>>  config GPIO_XILINX
> >>>>  	tristate "Xilinx GPIO support"
> >>>> -	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86)
> >>>> +	depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86 || MIPS)
> >>>
> >>> Hmm, in general, this driver is hopefully generic enough that it doesn't
> >>> have any real architecture dependencies. And I suspect, we want to
> >>> enable this driver for ARM64 for ZynqMP soon too. Should we probably
> >>> drop these arch dependencies completely? It seems to become quite a long list.
> >>
> >> I've been thinking about this a while ago. This is certainly not the only
> >> driver affected by this problem. But the thing is people always complain if
> >> new symbols become visable in Kconfig that don't apply to their platform.
> >>
> >> Maybe we should introduce a HAS_REPROGRAMABLE_LOGIC (or similar) feature
> >> Kconfig symbol and let platforms which have a FPGA select it and let drivers
> >> for FPGA peripherals depend on it.
> > 
> > Sounds like a good idea to me. But, does that work for all use-cases.
> > E.g. if you plug some PCIe card with an FPGA into an x86(_64) machine.
> > That would allow you to use those drivers, but I'm not sure how that
> > could pull in the new config symbol.
> 
> Hm, right. We could also make it a user-selectable config symbol. In that
> case you only need to disable one symbol when you don't have FPGA support
> rather than one for each driver. Although I'm not quite sure where to put
> such a symbol.

Eventually, the FPGA manager subsystem could probably provide some high
level config symbols. Though, it is probably also not given that every
FPGA-enabled platform needs the FPGA manager.

	Sören

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

* Re: [PATCH 2/5] gpio/xilinx: enable for MIPS
  2015-10-14 17:33             ` Sören Brinkmann
@ 2015-10-14 18:22               ` Moritz Fischer
  -1 siblings, 0 replies; 38+ messages in thread
From: Moritz Fischer @ 2015-10-14 18:22 UTC (permalink / raw)
  To: Sören Brinkmann
  Cc: Lars-Peter Clausen, Zubair Lutfullah Kakakhel,
	ralf-6z/3iImG2C8G8FEW9MqTrA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	Linus Walleij, linux-mips-6z/3iImG2C8G8FEW9MqTrA,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Wed, Oct 14, 2015 at 10:33 AM, Sören Brinkmann
<soren.brinkmann-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org> wrote:
> On Wed, 2015-10-14 at 07:24PM +0200, Lars-Peter Clausen wrote:
>> On 10/14/2015 06:54 PM, Sören Brinkmann wrote:
>> > On Wed, 2015-10-14 at 05:57PM +0200, Lars-Peter Clausen wrote:
>> >> On 10/14/2015 05:18 PM, Sören Brinkmann wrote:
>> >>> On Wed, 2015-10-14 at 01:51PM +0100, Zubair Lutfullah Kakakhel wrote:
>> >>>> MIPSfpga uses the axi gpio controller. Enable the driver for MIPS.
>> >>>>
>> >>>> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
>> >>>> ---
>> >>>>  drivers/gpio/Kconfig | 2 +-
>> >>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> >>>>
>> >>>> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
>> >>>> index 8949b3f..58e9afd 100644
>> >>>> --- a/drivers/gpio/Kconfig
>> >>>> +++ b/drivers/gpio/Kconfig
>> >>>> @@ -508,7 +508,7 @@ config GPIO_XGENE_SB
>> >>>>
>> >>>>  config GPIO_XILINX
>> >>>>          tristate "Xilinx GPIO support"
>> >>>> -        depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86)
>> >>>> +        depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86 || MIPS)
>> >>>
>> >>> Hmm, in general, this driver is hopefully generic enough that it doesn't
>> >>> have any real architecture dependencies. And I suspect, we want to
>> >>> enable this driver for ARM64 for ZynqMP soon too. Should we probably
>> >>> drop these arch dependencies completely? It seems to become quite a long list.
>> >>
>> >> I've been thinking about this a while ago. This is certainly not the only
>> >> driver affected by this problem. But the thing is people always complain if
>> >> new symbols become visable in Kconfig that don't apply to their platform.
>> >>
>> >> Maybe we should introduce a HAS_REPROGRAMABLE_LOGIC (or similar) feature
>> >> Kconfig symbol and let platforms which have a FPGA select it and let drivers
>> >> for FPGA peripherals depend on it.
>> >
>> > Sounds like a good idea to me. But, does that work for all use-cases.
>> > E.g. if you plug some PCIe card with an FPGA into an x86(_64) machine.
>> > That would allow you to use those drivers, but I'm not sure how that
>> > could pull in the new config symbol.
>>
>> Hm, right. We could also make it a user-selectable config symbol. In that
>> case you only need to disable one symbol when you don't have FPGA support
>> rather than one for each driver. Although I'm not quite sure where to put
>> such a symbol.
>
> Eventually, the FPGA manager subsystem could probably provide some high
> level config symbols. Though, it is probably also not given that every
> FPGA-enabled platform needs the FPGA manager.

I agree. I suspect most platforms will not actually runtime reload the
FPGA using
FPGA manager they probably use onboard flash or something similar.

>
>         Sören
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Moritz
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 2/5] gpio/xilinx: enable for MIPS
@ 2015-10-14 18:22               ` Moritz Fischer
  0 siblings, 0 replies; 38+ messages in thread
From: Moritz Fischer @ 2015-10-14 18:22 UTC (permalink / raw)
  To: Sören Brinkmann
  Cc: Lars-Peter Clausen, Zubair Lutfullah Kakakhel, ralf, robh+dt,
	Linus Walleij, linux-mips, linux-gpio, devicetree, linux-kernel

On Wed, Oct 14, 2015 at 10:33 AM, Sören Brinkmann
<soren.brinkmann@xilinx.com> wrote:
> On Wed, 2015-10-14 at 07:24PM +0200, Lars-Peter Clausen wrote:
>> On 10/14/2015 06:54 PM, Sören Brinkmann wrote:
>> > On Wed, 2015-10-14 at 05:57PM +0200, Lars-Peter Clausen wrote:
>> >> On 10/14/2015 05:18 PM, Sören Brinkmann wrote:
>> >>> On Wed, 2015-10-14 at 01:51PM +0100, Zubair Lutfullah Kakakhel wrote:
>> >>>> MIPSfpga uses the axi gpio controller. Enable the driver for MIPS.
>> >>>>
>> >>>> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
>> >>>> ---
>> >>>>  drivers/gpio/Kconfig | 2 +-
>> >>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> >>>>
>> >>>> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
>> >>>> index 8949b3f..58e9afd 100644
>> >>>> --- a/drivers/gpio/Kconfig
>> >>>> +++ b/drivers/gpio/Kconfig
>> >>>> @@ -508,7 +508,7 @@ config GPIO_XGENE_SB
>> >>>>
>> >>>>  config GPIO_XILINX
>> >>>>          tristate "Xilinx GPIO support"
>> >>>> -        depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86)
>> >>>> +        depends on OF_GPIO && (PPC || MICROBLAZE || ARCH_ZYNQ || X86 || MIPS)
>> >>>
>> >>> Hmm, in general, this driver is hopefully generic enough that it doesn't
>> >>> have any real architecture dependencies. And I suspect, we want to
>> >>> enable this driver for ARM64 for ZynqMP soon too. Should we probably
>> >>> drop these arch dependencies completely? It seems to become quite a long list.
>> >>
>> >> I've been thinking about this a while ago. This is certainly not the only
>> >> driver affected by this problem. But the thing is people always complain if
>> >> new symbols become visable in Kconfig that don't apply to their platform.
>> >>
>> >> Maybe we should introduce a HAS_REPROGRAMABLE_LOGIC (or similar) feature
>> >> Kconfig symbol and let platforms which have a FPGA select it and let drivers
>> >> for FPGA peripherals depend on it.
>> >
>> > Sounds like a good idea to me. But, does that work for all use-cases.
>> > E.g. if you plug some PCIe card with an FPGA into an x86(_64) machine.
>> > That would allow you to use those drivers, but I'm not sure how that
>> > could pull in the new config symbol.
>>
>> Hm, right. We could also make it a user-selectable config symbol. In that
>> case you only need to disable one symbol when you don't have FPGA support
>> rather than one for each driver. Although I'm not quite sure where to put
>> such a symbol.
>
> Eventually, the FPGA manager subsystem could probably provide some high
> level config symbols. Though, it is probably also not given that every
> FPGA-enabled platform needs the FPGA manager.

I agree. I suspect most platforms will not actually runtime reload the
FPGA using
FPGA manager they probably use onboard flash or something similar.

>
>         Sören
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Moritz

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

* Re: [PATCH 1/5] dt-bindings: MIPS: Document xilfpga bindings and boot style
  2015-10-14 12:51     ` Zubair Lutfullah Kakakhel
@ 2015-10-15  7:22       ` James Hogan
  -1 siblings, 0 replies; 38+ messages in thread
From: James Hogan @ 2015-10-15  7:22 UTC (permalink / raw)
  To: Zubair Lutfullah Kakakhel
  Cc: ralf, robh+dt, linus.walleij, linux-mips, linux-gpio, devicetree,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4040 bytes --]

Hi Zubair,

On Wed, Oct 14, 2015 at 01:51:53PM +0100, Zubair Lutfullah Kakakhel wrote:
> Xilfpga boots only with device-tree. Document the required properties
> and the unique boot style
> 
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> ---
>  .../devicetree/bindings/mips/img/xilfpga.txt       | 76 ++++++++++++++++++++++
>  1 file changed, 76 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mips/img/xilfpga.txt
> 
> diff --git a/Documentation/devicetree/bindings/mips/img/xilfpga.txt b/Documentation/devicetree/bindings/mips/img/xilfpga.txt
> new file mode 100644
> index 0000000..1e7084c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mips/img/xilfpga.txt
> @@ -0,0 +1,76 @@
> +Imagination University Program MIPSFpga
> +=======================================
> +
> +Under the Imagination University Program, a microAptiv UP core has been released for academic usage.

Documentation files should still be wrapped to 80 columns.

> +
> +As we are dealing with a mips core instantiated on an FPGA, specifications are fluid and can be varied in RTL.
> +
> +This binding document is provided as baseline guidance for the example project provided by IMG.
> +
> +The example project runs on the Nexys4DDR board by Digilent powered by the ARTIX-7 FPGA by Xilinx.
> +
> +Relevant details about the example project and the Nexys4DDR board:
> +
> +- microAptiv UP core m14Kc
> +- 50MHz clock speed
> +- 128Mbyte DDR RAM	at 0x0000_0000
> +- 8Kbyte RAM		at 0x1000_0000
> +- axi_intc		at 0x1020_0000
> +- axi_uart16550		at 0x1040_0000
> +- axi_gpio		at 0x1060_0000
> +- axi_i2c		at 0x10A0_0000
> +- custom_gpio		at 0x10C0_0000
> +- axi_ethernetlite	at 0x10E0_0000
> +- 8Kbyte BootRAM	at 0x1FC0_0000
> +
> +Required properties:
> +--------------------
> + - compatible: Must include "img,xilfpga".

Is that specific enough to describe the system you're referring to
unambiguously?

> +
> +CPU nodes:
> +----------
> +A "cpus" node is required.  Required properties:
> + - #address-cells: Must be 1.
> + - #size-cells: Must be 0.
> +A CPU sub-node is also required for at least CPU 0. Required properties:
> + - device_type: Must be "cpu".
> + - compatible: Must be "mips,m14Kc".
> + - reg: Must be <0>.
> + - clocks: Must include the CPU clock.  See ../../clock/clock-bindings.txt for
> +   details on clock bindings.
> + - ext clock handle for fixed-clock received by MIPS core.

that last bullet would appear to be a description of required clocks,
rather than a required property of the cpu node. Perhaps it should be in
the same paragraph as clocks property description.

> +Example:

your example doesn't have the required compatible string.

> +	cpus {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		cpu0: cpu@0 {
> +			device_type = "cpu";
> +			compatible = "mips,m14Kc";
> +			reg = <0>;
> +			clocks	= <&ext>;
> +		};
> +	};
> +
> +	ext: ext {
> +		compatible = "fixed-clock";
> +		#clock-cells = <0>;
> +		clock-frequency = <50000000>;
> +	};
> +
> +Boot protocol:
> +--------------
> +
> +The BootRAM is a writeable "RAM" in FPGA at 0x1FC0_0000. This is for easy reprogrammibility via JTAG.
> +
> +The BootRAM inializes the cache and the axi_uart peripheral.
> +
> +DDR initialiation is already handled by a HW IP block.
> +
> +When the example project bitstream is loaded, the cpu_reset button needs to be pressed.
> +
> +The bootram initializes the cache and axi_uart. Then outputs MIPSFPGA\n\r on the serial port
> +on the Nexys4DDR board.
> +
> +At this point, the board is ready to load the Linux kernel vmlinux file via JTAG.

Maybe worth clarifying whether register state should be set to anything
in particular, such as setting argument registers to zero so that you
could use them for passing command line or device tree in future, e.g.
if somebody ported u-boot to it (maybe ensure its compatible with the
UHI boot specs).

Cheers
James

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 1/5] dt-bindings: MIPS: Document xilfpga bindings and boot style
@ 2015-10-15  7:22       ` James Hogan
  0 siblings, 0 replies; 38+ messages in thread
From: James Hogan @ 2015-10-15  7:22 UTC (permalink / raw)
  To: Zubair Lutfullah Kakakhel
  Cc: ralf, robh+dt, linus.walleij, linux-mips, linux-gpio, devicetree,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4040 bytes --]

Hi Zubair,

On Wed, Oct 14, 2015 at 01:51:53PM +0100, Zubair Lutfullah Kakakhel wrote:
> Xilfpga boots only with device-tree. Document the required properties
> and the unique boot style
> 
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> ---
>  .../devicetree/bindings/mips/img/xilfpga.txt       | 76 ++++++++++++++++++++++
>  1 file changed, 76 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mips/img/xilfpga.txt
> 
> diff --git a/Documentation/devicetree/bindings/mips/img/xilfpga.txt b/Documentation/devicetree/bindings/mips/img/xilfpga.txt
> new file mode 100644
> index 0000000..1e7084c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mips/img/xilfpga.txt
> @@ -0,0 +1,76 @@
> +Imagination University Program MIPSFpga
> +=======================================
> +
> +Under the Imagination University Program, a microAptiv UP core has been released for academic usage.

Documentation files should still be wrapped to 80 columns.

> +
> +As we are dealing with a mips core instantiated on an FPGA, specifications are fluid and can be varied in RTL.
> +
> +This binding document is provided as baseline guidance for the example project provided by IMG.
> +
> +The example project runs on the Nexys4DDR board by Digilent powered by the ARTIX-7 FPGA by Xilinx.
> +
> +Relevant details about the example project and the Nexys4DDR board:
> +
> +- microAptiv UP core m14Kc
> +- 50MHz clock speed
> +- 128Mbyte DDR RAM	at 0x0000_0000
> +- 8Kbyte RAM		at 0x1000_0000
> +- axi_intc		at 0x1020_0000
> +- axi_uart16550		at 0x1040_0000
> +- axi_gpio		at 0x1060_0000
> +- axi_i2c		at 0x10A0_0000
> +- custom_gpio		at 0x10C0_0000
> +- axi_ethernetlite	at 0x10E0_0000
> +- 8Kbyte BootRAM	at 0x1FC0_0000
> +
> +Required properties:
> +--------------------
> + - compatible: Must include "img,xilfpga".

Is that specific enough to describe the system you're referring to
unambiguously?

> +
> +CPU nodes:
> +----------
> +A "cpus" node is required.  Required properties:
> + - #address-cells: Must be 1.
> + - #size-cells: Must be 0.
> +A CPU sub-node is also required for at least CPU 0. Required properties:
> + - device_type: Must be "cpu".
> + - compatible: Must be "mips,m14Kc".
> + - reg: Must be <0>.
> + - clocks: Must include the CPU clock.  See ../../clock/clock-bindings.txt for
> +   details on clock bindings.
> + - ext clock handle for fixed-clock received by MIPS core.

that last bullet would appear to be a description of required clocks,
rather than a required property of the cpu node. Perhaps it should be in
the same paragraph as clocks property description.

> +Example:

your example doesn't have the required compatible string.

> +	cpus {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		cpu0: cpu@0 {
> +			device_type = "cpu";
> +			compatible = "mips,m14Kc";
> +			reg = <0>;
> +			clocks	= <&ext>;
> +		};
> +	};
> +
> +	ext: ext {
> +		compatible = "fixed-clock";
> +		#clock-cells = <0>;
> +		clock-frequency = <50000000>;
> +	};
> +
> +Boot protocol:
> +--------------
> +
> +The BootRAM is a writeable "RAM" in FPGA at 0x1FC0_0000. This is for easy reprogrammibility via JTAG.
> +
> +The BootRAM inializes the cache and the axi_uart peripheral.
> +
> +DDR initialiation is already handled by a HW IP block.
> +
> +When the example project bitstream is loaded, the cpu_reset button needs to be pressed.
> +
> +The bootram initializes the cache and axi_uart. Then outputs MIPSFPGA\n\r on the serial port
> +on the Nexys4DDR board.
> +
> +At this point, the board is ready to load the Linux kernel vmlinux file via JTAG.

Maybe worth clarifying whether register state should be set to anything
in particular, such as setting argument registers to zero so that you
could use them for passing command line or device tree in future, e.g.
if somebody ported u-boot to it (maybe ensure its compatible with the
UHI boot specs).

Cheers
James

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 3/5] MIPS: dt: xilfpga: Add xilfpga device tree files.
  2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
  (?)
@ 2015-10-15  7:45       ` James Hogan
  -1 siblings, 0 replies; 38+ messages in thread
From: James Hogan @ 2015-10-15  7:45 UTC (permalink / raw)
  To: Zubair Lutfullah Kakakhel
  Cc: ralf-6z/3iImG2C8G8FEW9MqTrA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
	linux-mips-6z/3iImG2C8G8FEW9MqTrA,
	linux-gpio-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 4469 bytes --]

On Wed, Oct 14, 2015 at 01:51:55PM +0100, Zubair Lutfullah Kakakhel wrote:
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>

Any chance of a little more explanation, other than the subject line?

> ---
>  arch/mips/boot/dts/Makefile                |  1 +
>  arch/mips/boot/dts/xilfpga/Makefile        |  9 ++++++
>  arch/mips/boot/dts/xilfpga/microAptiv.dtsi | 21 +++++++++++++
>  arch/mips/boot/dts/xilfpga/nexys4ddr.dts   | 47 ++++++++++++++++++++++++++++++
>  4 files changed, 78 insertions(+)
>  create mode 100644 arch/mips/boot/dts/xilfpga/Makefile
>  create mode 100644 arch/mips/boot/dts/xilfpga/microAptiv.dtsi
>  create mode 100644 arch/mips/boot/dts/xilfpga/nexys4ddr.dts
> 
> diff --git a/arch/mips/boot/dts/Makefile b/arch/mips/boot/dts/Makefile
> index 778a340..0571ef7 100644
> --- a/arch/mips/boot/dts/Makefile
> +++ b/arch/mips/boot/dts/Makefile
> @@ -6,6 +6,7 @@ dts-dirs	+= mti
>  dts-dirs	+= netlogic
>  dts-dirs	+= qca
>  dts-dirs	+= ralink
> +dts-dirs	+= xilfpga
>  
>  obj-y		:= $(addsuffix /, $(dts-dirs))
>  
> diff --git a/arch/mips/boot/dts/xilfpga/Makefile b/arch/mips/boot/dts/xilfpga/Makefile
> new file mode 100644
> index 0000000..913a752
> --- /dev/null
> +++ b/arch/mips/boot/dts/xilfpga/Makefile
> @@ -0,0 +1,9 @@
> +dtb-$(CONFIG_XILFPGA_NEXYS4DDR)	+= nexys4ddr.dtb
> +
> +obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
> +
> +# Force kbuild to make empty built-in.o if necessary
> +obj-				+= dummy.o
> +
> +always				:= $(dtb-y)
> +clean-files	:= *.dtb *.dtb.S
> diff --git a/arch/mips/boot/dts/xilfpga/microAptiv.dtsi b/arch/mips/boot/dts/xilfpga/microAptiv.dtsi
> new file mode 100644
> index 0000000..81d518e
> --- /dev/null
> +++ b/arch/mips/boot/dts/xilfpga/microAptiv.dtsi
> @@ -0,0 +1,21 @@
> +/ {
> +	#address-cells = <1>;
> +	#size-cells = <1>;
> +	compatible = "img,xilfpga";
> +
> +	cpus {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		cpu@0 {
> +			device_type = "cpu";
> +			compatible = "mips,m14Kc";
> +			clocks	= <&ext>;
> +			reg = <0>;
> +		};
> +	};
> +
> +	ext: ext {
> +		compatible = "fixed-clock";
> +		#clock-cells = <0>;
> +	};
> +};
> diff --git a/arch/mips/boot/dts/xilfpga/nexys4ddr.dts b/arch/mips/boot/dts/xilfpga/nexys4ddr.dts
> new file mode 100644
> index 0000000..e225ae7
> --- /dev/null
> +++ b/arch/mips/boot/dts/xilfpga/nexys4ddr.dts
> @@ -0,0 +1,47 @@
> +/dts-v1/;
> +
> +#include "microAptiv.dtsi"
> +
> +/ {
> +	compatible = "img,xilfpga";

You can have more than one compatible string, separated by commas. Does
it make sense to have one that describes the specific system first
(nexys4ddr??) in addition to the generic xilfpga one? That way software
can still distinguish if it becomes necessary.

> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0x0 0x07ffffff>;

I think the second cell is size, not end address, so it should
presumably be 0x08000000?

> +	};
> +
> +	cpuintc: interrupt-controller@0 {
> +		#address-cells = <0>;
> +		#interrupt-cells = <1>;
> +		interrupt-controller;
> +		compatible = "mti,cpu-interrupt-controller";
> +	};
> +
> +	axi_gpio: gpio@10600000 {
> +		#gpio-cells = <1>;
> +		compatible = "xlnx,xps-gpio-1.00.a";
> +		gpio-controller;
> +		reg = < 0x10600000 0x10000 >;

Inconsistent whitespace between < > compared to other properties.

> +		xlnx,all-inputs = <0x0>;
> +		xlnx,dout-default = <0x0>;
> +		xlnx,gpio-width = <0x16>;
> +		xlnx,interrupt-present = <0x0>;
> +		xlnx,is-dual = <0x0>;
> +		xlnx,tri-default = <0xffffffff>;
> +	} ;
> +
> +	axi_uart16550: serial@10400000 {
> +		compatible = "ns16550a";
> +		reg = <0x10400000 0x10000>;
> +
> +		reg-shift = <2>;
> +		reg-offset = <0x1000>;
> +
> +		clock-frequency = <50000000>;

I guess the binding for that device already exists, but is it worth
extending it to take a clock node reference instead of a hardcoded
frequency (I'm guessing ext by the frequency and choice of clocks)?

> +		status = "okay";

I don't think you normally need that unless you describe e.g. SoC
peripheral hardware that might not be brought out by the board, in which
case you'd say its disabled in the SoC dtsi file, but enable it at the
board level, which doesn't seem to be happening here.

Cheers
James

> +	};
> +};
> +
> +&ext {
> +	clock-frequency = <50000000>;
> +};
> -- 
> 1.9.1
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 3/5] MIPS: dt: xilfpga: Add xilfpga device tree files.
@ 2015-10-15  7:45       ` James Hogan
  0 siblings, 0 replies; 38+ messages in thread
From: James Hogan @ 2015-10-15  7:45 UTC (permalink / raw)
  To: Zubair Lutfullah Kakakhel
  Cc: ralf, robh+dt, linus.walleij, linux-mips, linux-gpio, devicetree,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4440 bytes --]

On Wed, Oct 14, 2015 at 01:51:55PM +0100, Zubair Lutfullah Kakakhel wrote:
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>

Any chance of a little more explanation, other than the subject line?

> ---
>  arch/mips/boot/dts/Makefile                |  1 +
>  arch/mips/boot/dts/xilfpga/Makefile        |  9 ++++++
>  arch/mips/boot/dts/xilfpga/microAptiv.dtsi | 21 +++++++++++++
>  arch/mips/boot/dts/xilfpga/nexys4ddr.dts   | 47 ++++++++++++++++++++++++++++++
>  4 files changed, 78 insertions(+)
>  create mode 100644 arch/mips/boot/dts/xilfpga/Makefile
>  create mode 100644 arch/mips/boot/dts/xilfpga/microAptiv.dtsi
>  create mode 100644 arch/mips/boot/dts/xilfpga/nexys4ddr.dts
> 
> diff --git a/arch/mips/boot/dts/Makefile b/arch/mips/boot/dts/Makefile
> index 778a340..0571ef7 100644
> --- a/arch/mips/boot/dts/Makefile
> +++ b/arch/mips/boot/dts/Makefile
> @@ -6,6 +6,7 @@ dts-dirs	+= mti
>  dts-dirs	+= netlogic
>  dts-dirs	+= qca
>  dts-dirs	+= ralink
> +dts-dirs	+= xilfpga
>  
>  obj-y		:= $(addsuffix /, $(dts-dirs))
>  
> diff --git a/arch/mips/boot/dts/xilfpga/Makefile b/arch/mips/boot/dts/xilfpga/Makefile
> new file mode 100644
> index 0000000..913a752
> --- /dev/null
> +++ b/arch/mips/boot/dts/xilfpga/Makefile
> @@ -0,0 +1,9 @@
> +dtb-$(CONFIG_XILFPGA_NEXYS4DDR)	+= nexys4ddr.dtb
> +
> +obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
> +
> +# Force kbuild to make empty built-in.o if necessary
> +obj-				+= dummy.o
> +
> +always				:= $(dtb-y)
> +clean-files	:= *.dtb *.dtb.S
> diff --git a/arch/mips/boot/dts/xilfpga/microAptiv.dtsi b/arch/mips/boot/dts/xilfpga/microAptiv.dtsi
> new file mode 100644
> index 0000000..81d518e
> --- /dev/null
> +++ b/arch/mips/boot/dts/xilfpga/microAptiv.dtsi
> @@ -0,0 +1,21 @@
> +/ {
> +	#address-cells = <1>;
> +	#size-cells = <1>;
> +	compatible = "img,xilfpga";
> +
> +	cpus {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		cpu@0 {
> +			device_type = "cpu";
> +			compatible = "mips,m14Kc";
> +			clocks	= <&ext>;
> +			reg = <0>;
> +		};
> +	};
> +
> +	ext: ext {
> +		compatible = "fixed-clock";
> +		#clock-cells = <0>;
> +	};
> +};
> diff --git a/arch/mips/boot/dts/xilfpga/nexys4ddr.dts b/arch/mips/boot/dts/xilfpga/nexys4ddr.dts
> new file mode 100644
> index 0000000..e225ae7
> --- /dev/null
> +++ b/arch/mips/boot/dts/xilfpga/nexys4ddr.dts
> @@ -0,0 +1,47 @@
> +/dts-v1/;
> +
> +#include "microAptiv.dtsi"
> +
> +/ {
> +	compatible = "img,xilfpga";

You can have more than one compatible string, separated by commas. Does
it make sense to have one that describes the specific system first
(nexys4ddr??) in addition to the generic xilfpga one? That way software
can still distinguish if it becomes necessary.

> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0x0 0x07ffffff>;

I think the second cell is size, not end address, so it should
presumably be 0x08000000?

> +	};
> +
> +	cpuintc: interrupt-controller@0 {
> +		#address-cells = <0>;
> +		#interrupt-cells = <1>;
> +		interrupt-controller;
> +		compatible = "mti,cpu-interrupt-controller";
> +	};
> +
> +	axi_gpio: gpio@10600000 {
> +		#gpio-cells = <1>;
> +		compatible = "xlnx,xps-gpio-1.00.a";
> +		gpio-controller;
> +		reg = < 0x10600000 0x10000 >;

Inconsistent whitespace between < > compared to other properties.

> +		xlnx,all-inputs = <0x0>;
> +		xlnx,dout-default = <0x0>;
> +		xlnx,gpio-width = <0x16>;
> +		xlnx,interrupt-present = <0x0>;
> +		xlnx,is-dual = <0x0>;
> +		xlnx,tri-default = <0xffffffff>;
> +	} ;
> +
> +	axi_uart16550: serial@10400000 {
> +		compatible = "ns16550a";
> +		reg = <0x10400000 0x10000>;
> +
> +		reg-shift = <2>;
> +		reg-offset = <0x1000>;
> +
> +		clock-frequency = <50000000>;

I guess the binding for that device already exists, but is it worth
extending it to take a clock node reference instead of a hardcoded
frequency (I'm guessing ext by the frequency and choice of clocks)?

> +		status = "okay";

I don't think you normally need that unless you describe e.g. SoC
peripheral hardware that might not be brought out by the board, in which
case you'd say its disabled in the SoC dtsi file, but enable it at the
board level, which doesn't seem to be happening here.

Cheers
James

> +	};
> +};
> +
> +&ext {
> +	clock-frequency = <50000000>;
> +};
> -- 
> 1.9.1
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 3/5] MIPS: dt: xilfpga: Add xilfpga device tree files.
@ 2015-10-15  7:45       ` James Hogan
  0 siblings, 0 replies; 38+ messages in thread
From: James Hogan @ 2015-10-15  7:45 UTC (permalink / raw)
  To: Zubair Lutfullah Kakakhel
  Cc: ralf, robh+dt, linus.walleij, linux-mips, linux-gpio, devicetree,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4440 bytes --]

On Wed, Oct 14, 2015 at 01:51:55PM +0100, Zubair Lutfullah Kakakhel wrote:
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>

Any chance of a little more explanation, other than the subject line?

> ---
>  arch/mips/boot/dts/Makefile                |  1 +
>  arch/mips/boot/dts/xilfpga/Makefile        |  9 ++++++
>  arch/mips/boot/dts/xilfpga/microAptiv.dtsi | 21 +++++++++++++
>  arch/mips/boot/dts/xilfpga/nexys4ddr.dts   | 47 ++++++++++++++++++++++++++++++
>  4 files changed, 78 insertions(+)
>  create mode 100644 arch/mips/boot/dts/xilfpga/Makefile
>  create mode 100644 arch/mips/boot/dts/xilfpga/microAptiv.dtsi
>  create mode 100644 arch/mips/boot/dts/xilfpga/nexys4ddr.dts
> 
> diff --git a/arch/mips/boot/dts/Makefile b/arch/mips/boot/dts/Makefile
> index 778a340..0571ef7 100644
> --- a/arch/mips/boot/dts/Makefile
> +++ b/arch/mips/boot/dts/Makefile
> @@ -6,6 +6,7 @@ dts-dirs	+= mti
>  dts-dirs	+= netlogic
>  dts-dirs	+= qca
>  dts-dirs	+= ralink
> +dts-dirs	+= xilfpga
>  
>  obj-y		:= $(addsuffix /, $(dts-dirs))
>  
> diff --git a/arch/mips/boot/dts/xilfpga/Makefile b/arch/mips/boot/dts/xilfpga/Makefile
> new file mode 100644
> index 0000000..913a752
> --- /dev/null
> +++ b/arch/mips/boot/dts/xilfpga/Makefile
> @@ -0,0 +1,9 @@
> +dtb-$(CONFIG_XILFPGA_NEXYS4DDR)	+= nexys4ddr.dtb
> +
> +obj-y				+= $(patsubst %.dtb, %.dtb.o, $(dtb-y))
> +
> +# Force kbuild to make empty built-in.o if necessary
> +obj-				+= dummy.o
> +
> +always				:= $(dtb-y)
> +clean-files	:= *.dtb *.dtb.S
> diff --git a/arch/mips/boot/dts/xilfpga/microAptiv.dtsi b/arch/mips/boot/dts/xilfpga/microAptiv.dtsi
> new file mode 100644
> index 0000000..81d518e
> --- /dev/null
> +++ b/arch/mips/boot/dts/xilfpga/microAptiv.dtsi
> @@ -0,0 +1,21 @@
> +/ {
> +	#address-cells = <1>;
> +	#size-cells = <1>;
> +	compatible = "img,xilfpga";
> +
> +	cpus {
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		cpu@0 {
> +			device_type = "cpu";
> +			compatible = "mips,m14Kc";
> +			clocks	= <&ext>;
> +			reg = <0>;
> +		};
> +	};
> +
> +	ext: ext {
> +		compatible = "fixed-clock";
> +		#clock-cells = <0>;
> +	};
> +};
> diff --git a/arch/mips/boot/dts/xilfpga/nexys4ddr.dts b/arch/mips/boot/dts/xilfpga/nexys4ddr.dts
> new file mode 100644
> index 0000000..e225ae7
> --- /dev/null
> +++ b/arch/mips/boot/dts/xilfpga/nexys4ddr.dts
> @@ -0,0 +1,47 @@
> +/dts-v1/;
> +
> +#include "microAptiv.dtsi"
> +
> +/ {
> +	compatible = "img,xilfpga";

You can have more than one compatible string, separated by commas. Does
it make sense to have one that describes the specific system first
(nexys4ddr??) in addition to the generic xilfpga one? That way software
can still distinguish if it becomes necessary.

> +
> +	memory {
> +		device_type = "memory";
> +		reg = <0x0 0x07ffffff>;

I think the second cell is size, not end address, so it should
presumably be 0x08000000?

> +	};
> +
> +	cpuintc: interrupt-controller@0 {
> +		#address-cells = <0>;
> +		#interrupt-cells = <1>;
> +		interrupt-controller;
> +		compatible = "mti,cpu-interrupt-controller";
> +	};
> +
> +	axi_gpio: gpio@10600000 {
> +		#gpio-cells = <1>;
> +		compatible = "xlnx,xps-gpio-1.00.a";
> +		gpio-controller;
> +		reg = < 0x10600000 0x10000 >;

Inconsistent whitespace between < > compared to other properties.

> +		xlnx,all-inputs = <0x0>;
> +		xlnx,dout-default = <0x0>;
> +		xlnx,gpio-width = <0x16>;
> +		xlnx,interrupt-present = <0x0>;
> +		xlnx,is-dual = <0x0>;
> +		xlnx,tri-default = <0xffffffff>;
> +	} ;
> +
> +	axi_uart16550: serial@10400000 {
> +		compatible = "ns16550a";
> +		reg = <0x10400000 0x10000>;
> +
> +		reg-shift = <2>;
> +		reg-offset = <0x1000>;
> +
> +		clock-frequency = <50000000>;

I guess the binding for that device already exists, but is it worth
extending it to take a clock node reference instead of a hardcoded
frequency (I'm guessing ext by the frequency and choice of clocks)?

> +		status = "okay";

I don't think you normally need that unless you describe e.g. SoC
peripheral hardware that might not be brought out by the board, in which
case you'd say its disabled in the SoC dtsi file, but enable it at the
board level, which doesn't seem to be happening here.

Cheers
James

> +	};
> +};
> +
> +&ext {
> +	clock-frequency = <50000000>;
> +};
> -- 
> 1.9.1
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 4/5] MIPS: xilfpga: Add mipsfpga platform code
  2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
@ 2015-10-15  8:11     ` James Hogan
  -1 siblings, 0 replies; 38+ messages in thread
From: James Hogan @ 2015-10-15  8:11 UTC (permalink / raw)
  To: Zubair Lutfullah Kakakhel
  Cc: ralf, robh+dt, linus.walleij, linux-mips, linux-gpio, devicetree,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 10382 bytes --]

On Wed, Oct 14, 2015 at 01:51:56PM +0100, Zubair Lutfullah Kakakhel wrote:
> The xilfpga platform will be DT only.
> 
> Add required platform code. DT files have already been added separately

Please wrap to 72 characters (keeps it looking pretty in git-log
output), and maybe add a full stop.

> 
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> ---
>  arch/mips/Kbuild.platforms                |  1 +
>  arch/mips/Kconfig                         | 25 ++++++++++++++
>  arch/mips/include/asm/mach-xilfpga/gpio.h | 19 +++++++++++
>  arch/mips/include/asm/mach-xilfpga/irq.h  | 18 ++++++++++
>  arch/mips/xilfpga/Kconfig                 |  9 +++++
>  arch/mips/xilfpga/Makefile                |  7 ++++
>  arch/mips/xilfpga/Platform                |  3 ++
>  arch/mips/xilfpga/init.c                  | 57 +++++++++++++++++++++++++++++++
>  arch/mips/xilfpga/intc.c                  | 26 ++++++++++++++
>  arch/mips/xilfpga/time.c                  | 41 ++++++++++++++++++++++
>  10 files changed, 206 insertions(+)
>  create mode 100644 arch/mips/include/asm/mach-xilfpga/gpio.h
>  create mode 100644 arch/mips/include/asm/mach-xilfpga/irq.h
>  create mode 100644 arch/mips/xilfpga/Kconfig
>  create mode 100644 arch/mips/xilfpga/Makefile
>  create mode 100644 arch/mips/xilfpga/Platform
>  create mode 100644 arch/mips/xilfpga/init.c
>  create mode 100644 arch/mips/xilfpga/intc.c
>  create mode 100644 arch/mips/xilfpga/time.c
> 
> diff --git a/arch/mips/Kbuild.platforms b/arch/mips/Kbuild.platforms
> index a424e46..a96c81d 100644
> --- a/arch/mips/Kbuild.platforms
> +++ b/arch/mips/Kbuild.platforms
> @@ -33,6 +33,7 @@ platforms += sibyte
>  platforms += sni
>  platforms += txx9
>  platforms += vr41xx
> +platforms += xilfpga
>  
>  # include the platform specific files
>  include $(patsubst %, $(srctree)/arch/mips/%/Platform, $(platforms))
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index e3aa5b0..66c1a7e 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -401,6 +401,30 @@ config MACH_PISTACHIO
>  	help
>  	  This enables support for the IMG Pistachio SoC platform.
>  
> +config MACH_XILFPGA
> +	bool "MIPSFPGA Xilinx based boards"
> +	select ARCH_REQUIRE_GPIOLIB
> +	select BOOT_ELF32
> +	select BOOT_RAW
> +	select BUILTIN_DTB
> +	select CEVT_R4K
> +	select COMMON_CLK
> +	select CSRC_R4K
> +	select IRQ_MIPS_CPU
> +	select LIBFDT
> +	select MIPS_CPU_SCACHE
> +	select SERIAL_8250
> +	select SERIAL_8250_CONSOLE

Is it really necessary to select SERIAL_8250[_CONSOLE]? Its something
that I think belongs in the defconfig rather than as a strict
requirement to enable the platform.

> +	select SYS_HAS_EARLY_PRINTK
> +	select SYS_HAS_CPU_MIPS32_R2
> +	select SYS_SUPPORTS_32BIT_KERNEL
> +	select SYS_SUPPORTS_LITTLE_ENDIAN
> +	select SYS_SUPPORTS_ZBOOT_UART16550
> +	select USE_OF
> +	select USE_GENERIC_EARLY_PRINTK_8250
> +	help
> +	  This enables support for the Xilinx

Is some description missing here?

> +
>  config MIPS_MALTA
>  	bool "MIPS Malta board"
>  	select ARCH_MAY_HAVE_PC_FDC
> @@ -964,6 +988,7 @@ source "arch/mips/loongson32/Kconfig"
>  source "arch/mips/loongson64/Kconfig"
>  source "arch/mips/netlogic/Kconfig"
>  source "arch/mips/paravirt/Kconfig"
> +source "arch/mips/xilfpga/Kconfig"
>  
>  endmenu
>  
> diff --git a/arch/mips/include/asm/mach-xilfpga/gpio.h b/arch/mips/include/asm/mach-xilfpga/gpio.h
> new file mode 100644
> index 0000000..26778fc
> --- /dev/null
> +++ b/arch/mips/include/asm/mach-xilfpga/gpio.h
> @@ -0,0 +1,19 @@
> +/*
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * 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 __ASM_MACH_XILFPGA_GPIO_H
> +#define __ASM_MACH_XILFPGA_GPIO_H
> +
> +#include <asm-generic/gpio.h>
> +
> +#define gpio_get_value __gpio_get_value
> +#define gpio_set_value __gpio_set_value
> +
> +#endif /* __ASM_MACH_XILFPGA_GPIO_H */
> diff --git a/arch/mips/include/asm/mach-xilfpga/irq.h b/arch/mips/include/asm/mach-xilfpga/irq.h
> new file mode 100644
> index 0000000..0132a5b9
> --- /dev/null
> +++ b/arch/mips/include/asm/mach-xilfpga/irq.h
> @@ -0,0 +1,18 @@
> +/*
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * 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 __MIPS_ASM_MACH_XILFPGA_IRQ_H__
> +#define __MIPS_ASM_MACH_XILFPGA_IRQ_H__
> +
> +#define NR_IRQS 32
> +
> +#include_next <irq.h>
> +
> +#endif /* __MIPS_ASM_MACH_XILFPGA_IRQ_H__ */
> diff --git a/arch/mips/xilfpga/Kconfig b/arch/mips/xilfpga/Kconfig
> new file mode 100644
> index 0000000..42a030a
> --- /dev/null
> +++ b/arch/mips/xilfpga/Kconfig
> @@ -0,0 +1,9 @@
> +choice
> +	prompt "Machine type"
> +	depends on MACH_XILFPGA
> +	default XILFPGA_NEXYS4DDR
> +
> +config XILFPGA_NEXYS4DDR
> +	bool "Nexys4DDR by Digilent"
> +
> +endchoice
> diff --git a/arch/mips/xilfpga/Makefile b/arch/mips/xilfpga/Makefile
> new file mode 100644
> index 0000000..2385aa7
> --- /dev/null
> +++ b/arch/mips/xilfpga/Makefile
> @@ -0,0 +1,7 @@
> +#
> +# Makefile for the Xilfpga
> +#
> +
> +obj-y +=	init.o \
> +		intc.o \
> +		time.o

Can I suggest instead doing this:
obj-y +=	init.o
obj-y +=	intc.o
obj-y +=	time.o

> diff --git a/arch/mips/xilfpga/Platform b/arch/mips/xilfpga/Platform
> new file mode 100644
> index 0000000..ed375af
> --- /dev/null
> +++ b/arch/mips/xilfpga/Platform
> @@ -0,0 +1,3 @@
> +platform-$(CONFIG_MACH_XILFPGA) += xilfpga/
> +cflags-$(CONFIG_MACH_XILFPGA) += -I$(srctree)/arch/mips/include/asm/mach-xilfpga
> +load-$(CONFIG_MACH_XILFPGA) += 0xffffffff80100000
> diff --git a/arch/mips/xilfpga/init.c b/arch/mips/xilfpga/init.c
> new file mode 100644
> index 0000000..5348af8
> --- /dev/null
> +++ b/arch/mips/xilfpga/init.c
> @@ -0,0 +1,57 @@
> +/*
> + * Xilfpga platform setup
> + *
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + */
> +
> +#include <linux/of_fdt.h>
> +#include <linux/of_platform.h>
> +
> +#include <asm/prom.h>
> +
> +#define XILFPGA_UART_BASE	0xb0401000
> +
> +const char *get_system_type(void)
> +{
> +	return "MIPSFpga";
> +}
> +
> +void __init plat_mem_setup(void)
> +{
> +	__dt_setup_arch(__dtb_start);
> +	strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
> +}
> +
> +void __init prom_init(void)
> +{
> +	setup_8250_early_printk_port(XILFPGA_UART_BASE, 2, 50000);
> +}
> +
> +void __init prom_free_prom_memory(void)
> +{
> +}
> +
> +void __init device_tree_init(void)
> +{
> +	if (!initial_boot_params)
> +		return;
> +
> +	unflatten_and_copy_device_tree();
> +}
> +
> +static int __init plat_of_setup(void)
> +{
> +	if (!of_have_populated_dt())
> +		panic("Device tree not present");
> +
> +	if (of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL))
> +		panic("Failed to populate DT");
> +
> +	return 0;
> +}
> +arch_initcall(plat_of_setup);
> diff --git a/arch/mips/xilfpga/intc.c b/arch/mips/xilfpga/intc.c
> new file mode 100644
> index 0000000..919eb97
> --- /dev/null
> +++ b/arch/mips/xilfpga/intc.c
> @@ -0,0 +1,26 @@
> +/*
> + * Xilfpga interrupt controller setup
> + *
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + */
> +
> +#include <linux/of.h>
> +#include <linux/of_irq.h>
> +
> +#include <asm/irq_cpu.h>
> +
> +static struct of_device_id of_irq_ids[] __initdata = {
> +	{ .compatible = "mti,cpu-interrupt-controller", .data = mips_cpu_irq_of_init },
> +	{},
> +};
> +
> +void __init arch_init_irq(void)
> +{
> +	of_irq_init(of_irq_ids);
> +}
> +

no need for extra newline at end of file.

> diff --git a/arch/mips/xilfpga/time.c b/arch/mips/xilfpga/time.c
> new file mode 100644
> index 0000000..3f2e39e
> --- /dev/null
> +++ b/arch/mips/xilfpga/time.c
> @@ -0,0 +1,41 @@
> +/*
> + * Xilfpga clocksource/timer setup
> + *
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + */
> +
> +#include <linux/clk.h>
> +#include <linux/clk-provider.h>

You don't appear to be providing any clocks, so do you actually need
that include?

> +#include <linux/clocksource.h>
> +#include <linux/of.h>
> +
> +#include <asm/time.h>
> +
> +void __init plat_time_init(void)
> +{
> +	struct device_node *np;
> +	struct clk *clk = 0;

No need to initialise to 0 since you always set before use (and this is
C, so NULL is better than 0 anyway).

Cheers
James

> +
> +	of_clk_init(NULL);
> +	clocksource_of_init();
> +
> +	np = of_get_cpu_node(0, NULL);
> +	if (!np) {
> +		pr_err("Failed to get CPU node\n");
> +		return;
> +	}
> +
> +	clk = of_clk_get(np, 0);
> +	if (IS_ERR(clk)) {
> +		pr_err("Failed to get CPU clock: %ld\n", PTR_ERR(clk));
> +		return;
> +	}
> +
> +	mips_hpt_frequency = clk_get_rate(clk) / 2;
> +	clk_put(clk);
> +}
> -- 
> 1.9.1
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 4/5] MIPS: xilfpga: Add mipsfpga platform code
@ 2015-10-15  8:11     ` James Hogan
  0 siblings, 0 replies; 38+ messages in thread
From: James Hogan @ 2015-10-15  8:11 UTC (permalink / raw)
  To: Zubair Lutfullah Kakakhel
  Cc: ralf, robh+dt, linus.walleij, linux-mips, linux-gpio, devicetree,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 10382 bytes --]

On Wed, Oct 14, 2015 at 01:51:56PM +0100, Zubair Lutfullah Kakakhel wrote:
> The xilfpga platform will be DT only.
> 
> Add required platform code. DT files have already been added separately

Please wrap to 72 characters (keeps it looking pretty in git-log
output), and maybe add a full stop.

> 
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> ---
>  arch/mips/Kbuild.platforms                |  1 +
>  arch/mips/Kconfig                         | 25 ++++++++++++++
>  arch/mips/include/asm/mach-xilfpga/gpio.h | 19 +++++++++++
>  arch/mips/include/asm/mach-xilfpga/irq.h  | 18 ++++++++++
>  arch/mips/xilfpga/Kconfig                 |  9 +++++
>  arch/mips/xilfpga/Makefile                |  7 ++++
>  arch/mips/xilfpga/Platform                |  3 ++
>  arch/mips/xilfpga/init.c                  | 57 +++++++++++++++++++++++++++++++
>  arch/mips/xilfpga/intc.c                  | 26 ++++++++++++++
>  arch/mips/xilfpga/time.c                  | 41 ++++++++++++++++++++++
>  10 files changed, 206 insertions(+)
>  create mode 100644 arch/mips/include/asm/mach-xilfpga/gpio.h
>  create mode 100644 arch/mips/include/asm/mach-xilfpga/irq.h
>  create mode 100644 arch/mips/xilfpga/Kconfig
>  create mode 100644 arch/mips/xilfpga/Makefile
>  create mode 100644 arch/mips/xilfpga/Platform
>  create mode 100644 arch/mips/xilfpga/init.c
>  create mode 100644 arch/mips/xilfpga/intc.c
>  create mode 100644 arch/mips/xilfpga/time.c
> 
> diff --git a/arch/mips/Kbuild.platforms b/arch/mips/Kbuild.platforms
> index a424e46..a96c81d 100644
> --- a/arch/mips/Kbuild.platforms
> +++ b/arch/mips/Kbuild.platforms
> @@ -33,6 +33,7 @@ platforms += sibyte
>  platforms += sni
>  platforms += txx9
>  platforms += vr41xx
> +platforms += xilfpga
>  
>  # include the platform specific files
>  include $(patsubst %, $(srctree)/arch/mips/%/Platform, $(platforms))
> diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
> index e3aa5b0..66c1a7e 100644
> --- a/arch/mips/Kconfig
> +++ b/arch/mips/Kconfig
> @@ -401,6 +401,30 @@ config MACH_PISTACHIO
>  	help
>  	  This enables support for the IMG Pistachio SoC platform.
>  
> +config MACH_XILFPGA
> +	bool "MIPSFPGA Xilinx based boards"
> +	select ARCH_REQUIRE_GPIOLIB
> +	select BOOT_ELF32
> +	select BOOT_RAW
> +	select BUILTIN_DTB
> +	select CEVT_R4K
> +	select COMMON_CLK
> +	select CSRC_R4K
> +	select IRQ_MIPS_CPU
> +	select LIBFDT
> +	select MIPS_CPU_SCACHE
> +	select SERIAL_8250
> +	select SERIAL_8250_CONSOLE

Is it really necessary to select SERIAL_8250[_CONSOLE]? Its something
that I think belongs in the defconfig rather than as a strict
requirement to enable the platform.

> +	select SYS_HAS_EARLY_PRINTK
> +	select SYS_HAS_CPU_MIPS32_R2
> +	select SYS_SUPPORTS_32BIT_KERNEL
> +	select SYS_SUPPORTS_LITTLE_ENDIAN
> +	select SYS_SUPPORTS_ZBOOT_UART16550
> +	select USE_OF
> +	select USE_GENERIC_EARLY_PRINTK_8250
> +	help
> +	  This enables support for the Xilinx

Is some description missing here?

> +
>  config MIPS_MALTA
>  	bool "MIPS Malta board"
>  	select ARCH_MAY_HAVE_PC_FDC
> @@ -964,6 +988,7 @@ source "arch/mips/loongson32/Kconfig"
>  source "arch/mips/loongson64/Kconfig"
>  source "arch/mips/netlogic/Kconfig"
>  source "arch/mips/paravirt/Kconfig"
> +source "arch/mips/xilfpga/Kconfig"
>  
>  endmenu
>  
> diff --git a/arch/mips/include/asm/mach-xilfpga/gpio.h b/arch/mips/include/asm/mach-xilfpga/gpio.h
> new file mode 100644
> index 0000000..26778fc
> --- /dev/null
> +++ b/arch/mips/include/asm/mach-xilfpga/gpio.h
> @@ -0,0 +1,19 @@
> +/*
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * 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 __ASM_MACH_XILFPGA_GPIO_H
> +#define __ASM_MACH_XILFPGA_GPIO_H
> +
> +#include <asm-generic/gpio.h>
> +
> +#define gpio_get_value __gpio_get_value
> +#define gpio_set_value __gpio_set_value
> +
> +#endif /* __ASM_MACH_XILFPGA_GPIO_H */
> diff --git a/arch/mips/include/asm/mach-xilfpga/irq.h b/arch/mips/include/asm/mach-xilfpga/irq.h
> new file mode 100644
> index 0000000..0132a5b9
> --- /dev/null
> +++ b/arch/mips/include/asm/mach-xilfpga/irq.h
> @@ -0,0 +1,18 @@
> +/*
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * 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 __MIPS_ASM_MACH_XILFPGA_IRQ_H__
> +#define __MIPS_ASM_MACH_XILFPGA_IRQ_H__
> +
> +#define NR_IRQS 32
> +
> +#include_next <irq.h>
> +
> +#endif /* __MIPS_ASM_MACH_XILFPGA_IRQ_H__ */
> diff --git a/arch/mips/xilfpga/Kconfig b/arch/mips/xilfpga/Kconfig
> new file mode 100644
> index 0000000..42a030a
> --- /dev/null
> +++ b/arch/mips/xilfpga/Kconfig
> @@ -0,0 +1,9 @@
> +choice
> +	prompt "Machine type"
> +	depends on MACH_XILFPGA
> +	default XILFPGA_NEXYS4DDR
> +
> +config XILFPGA_NEXYS4DDR
> +	bool "Nexys4DDR by Digilent"
> +
> +endchoice
> diff --git a/arch/mips/xilfpga/Makefile b/arch/mips/xilfpga/Makefile
> new file mode 100644
> index 0000000..2385aa7
> --- /dev/null
> +++ b/arch/mips/xilfpga/Makefile
> @@ -0,0 +1,7 @@
> +#
> +# Makefile for the Xilfpga
> +#
> +
> +obj-y +=	init.o \
> +		intc.o \
> +		time.o

Can I suggest instead doing this:
obj-y +=	init.o
obj-y +=	intc.o
obj-y +=	time.o

> diff --git a/arch/mips/xilfpga/Platform b/arch/mips/xilfpga/Platform
> new file mode 100644
> index 0000000..ed375af
> --- /dev/null
> +++ b/arch/mips/xilfpga/Platform
> @@ -0,0 +1,3 @@
> +platform-$(CONFIG_MACH_XILFPGA) += xilfpga/
> +cflags-$(CONFIG_MACH_XILFPGA) += -I$(srctree)/arch/mips/include/asm/mach-xilfpga
> +load-$(CONFIG_MACH_XILFPGA) += 0xffffffff80100000
> diff --git a/arch/mips/xilfpga/init.c b/arch/mips/xilfpga/init.c
> new file mode 100644
> index 0000000..5348af8
> --- /dev/null
> +++ b/arch/mips/xilfpga/init.c
> @@ -0,0 +1,57 @@
> +/*
> + * Xilfpga platform setup
> + *
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + */
> +
> +#include <linux/of_fdt.h>
> +#include <linux/of_platform.h>
> +
> +#include <asm/prom.h>
> +
> +#define XILFPGA_UART_BASE	0xb0401000
> +
> +const char *get_system_type(void)
> +{
> +	return "MIPSFpga";
> +}
> +
> +void __init plat_mem_setup(void)
> +{
> +	__dt_setup_arch(__dtb_start);
> +	strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
> +}
> +
> +void __init prom_init(void)
> +{
> +	setup_8250_early_printk_port(XILFPGA_UART_BASE, 2, 50000);
> +}
> +
> +void __init prom_free_prom_memory(void)
> +{
> +}
> +
> +void __init device_tree_init(void)
> +{
> +	if (!initial_boot_params)
> +		return;
> +
> +	unflatten_and_copy_device_tree();
> +}
> +
> +static int __init plat_of_setup(void)
> +{
> +	if (!of_have_populated_dt())
> +		panic("Device tree not present");
> +
> +	if (of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL))
> +		panic("Failed to populate DT");
> +
> +	return 0;
> +}
> +arch_initcall(plat_of_setup);
> diff --git a/arch/mips/xilfpga/intc.c b/arch/mips/xilfpga/intc.c
> new file mode 100644
> index 0000000..919eb97
> --- /dev/null
> +++ b/arch/mips/xilfpga/intc.c
> @@ -0,0 +1,26 @@
> +/*
> + * Xilfpga interrupt controller setup
> + *
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + */
> +
> +#include <linux/of.h>
> +#include <linux/of_irq.h>
> +
> +#include <asm/irq_cpu.h>
> +
> +static struct of_device_id of_irq_ids[] __initdata = {
> +	{ .compatible = "mti,cpu-interrupt-controller", .data = mips_cpu_irq_of_init },
> +	{},
> +};
> +
> +void __init arch_init_irq(void)
> +{
> +	of_irq_init(of_irq_ids);
> +}
> +

no need for extra newline at end of file.

> diff --git a/arch/mips/xilfpga/time.c b/arch/mips/xilfpga/time.c
> new file mode 100644
> index 0000000..3f2e39e
> --- /dev/null
> +++ b/arch/mips/xilfpga/time.c
> @@ -0,0 +1,41 @@
> +/*
> + * Xilfpga clocksource/timer setup
> + *
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + */
> +
> +#include <linux/clk.h>
> +#include <linux/clk-provider.h>

You don't appear to be providing any clocks, so do you actually need
that include?

> +#include <linux/clocksource.h>
> +#include <linux/of.h>
> +
> +#include <asm/time.h>
> +
> +void __init plat_time_init(void)
> +{
> +	struct device_node *np;
> +	struct clk *clk = 0;

No need to initialise to 0 since you always set before use (and this is
C, so NULL is better than 0 anyway).

Cheers
James

> +
> +	of_clk_init(NULL);
> +	clocksource_of_init();
> +
> +	np = of_get_cpu_node(0, NULL);
> +	if (!np) {
> +		pr_err("Failed to get CPU node\n");
> +		return;
> +	}
> +
> +	clk = of_clk_get(np, 0);
> +	if (IS_ERR(clk)) {
> +		pr_err("Failed to get CPU clock: %ld\n", PTR_ERR(clk));
> +		return;
> +	}
> +
> +	mips_hpt_frequency = clk_get_rate(clk) / 2;
> +	clk_put(clk);
> +}
> -- 
> 1.9.1
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 5/5] MIPS: Add xilfpga defconfig
  2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
@ 2015-10-15  8:34     ` James Hogan
  -1 siblings, 0 replies; 38+ messages in thread
From: James Hogan @ 2015-10-15  8:34 UTC (permalink / raw)
  To: Zubair Lutfullah Kakakhel
  Cc: ralf, robh+dt, linus.walleij, linux-mips, linux-gpio, devicetree,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3290 bytes --]

On Wed, Oct 14, 2015 at 01:51:57PM +0100, Zubair Lutfullah Kakakhel wrote:
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> ---
>  arch/mips/configs/xilfpga_defconfig | 59 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
>  create mode 100644 arch/mips/configs/xilfpga_defconfig
> 
> diff --git a/arch/mips/configs/xilfpga_defconfig b/arch/mips/configs/xilfpga_defconfig
> new file mode 100644
> index 0000000..94bb9b8
> --- /dev/null
> +++ b/arch/mips/configs/xilfpga_defconfig
> @@ -0,0 +1,59 @@
> +CONFIG_MACH_XILFPGA=y
> +# CONFIG_COMPACTION is not set
> +# CONFIG_LOCALVERSION_AUTO is not set
> +# CONFIG_CROSS_MEMORY_ATTACH is not set
> +# CONFIG_USELIB is not set
> +# CONFIG_SHMEM is not set
> +# CONFIG_AIO is not set
> +# CONFIG_ADVISE_SYSCALLS is not set

Did you disable these intentionally? Its a kernel tinification option
that is rarely used in defconfigs.

> +CONFIG_EMBEDDED=y
> +# CONFIG_VM_EVENT_COUNTERS is not set
> +# CONFIG_COMPAT_BRK is not set
> +CONFIG_SLAB=y
> +# CONFIG_BLOCK is not set
> +# CONFIG_SUSPEND is not set
> +# CONFIG_UEVENT_HELPER is not set
> +CONFIG_DEVTMPFS=y
> +CONFIG_DEVTMPFS_MOUNT=y
> +# CONFIG_STANDALONE is not set
> +# CONFIG_PREVENT_FIRMWARE_BUILD is not set
> +# CONFIG_FW_LOADER is not set
> +# CONFIG_ALLOW_DEV_COREDUMP is not set
> +# CONFIG_INPUT_MOUSEDEV is not set
> +# CONFIG_INPUT_KEYBOARD is not set
> +# CONFIG_INPUT_MOUSE is not set
> +# CONFIG_SERIO is not set
> +CONFIG_VT_HW_CONSOLE_BINDING=y
> +# CONFIG_UNIX98_PTYS is not set
> +# CONFIG_LEGACY_PTYS is not set
> +# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
> +CONFIG_SERIAL_8250_NR_UARTS=1
> +CONFIG_SERIAL_8250_RUNTIME_UARTS=1
> +CONFIG_SERIAL_OF_PLATFORM=y
> +# CONFIG_HW_RANDOM is not set
> +CONFIG_GPIO_SYSFS=y
> +CONFIG_GPIO_XILINX=y
> +# CONFIG_HWMON is not set
> +# CONFIG_USB_SUPPORT is not set
> +# CONFIG_MIPS_PLATFORM_DEVICES is not set
> +# CONFIG_IOMMU_SUPPORT is not set
> +# CONFIG_FILE_LOCKING is not set

Likewise, intentional? Its another tinification option that isn't all
that commonly used in defconfigs.

> +# CONFIG_DNOTIFY is not set
> +# CONFIG_INOTIFY_USER is not set

Likewise, intentional? I don't think inotify is deprecated in favour of
anything else yet (it appears to superscede dnotify).

> +# CONFIG_PROC_SYSCTL is not set

Likewise.

> +# CONFIG_PROC_PAGE_MONITOR is not set
> +# CONFIG_MISC_FILESYSTEMS is not set
> +# CONFIG_ENABLE_WARN_DEPRECATED is not set
> +# CONFIG_ENABLE_MUST_CHECK is not set

Particular reason to disable these two compile time warnings?

> +CONFIG_PANIC_ON_OOPS=y
> +# CONFIG_SCHED_DEBUG is not set
> +CONFIG_DEBUG_LOCK_ALLOC=y

Did you mean to leave this turned on?

> +# CONFIG_FTRACE is not set
> +CONFIG_CMDLINE_BOOL=y
> +CONFIG_CMDLINE="console=ttyS0,115200 clk_ignore_unused earlyprintk=serial,ttyS0,115200"

I believe you can specify an earlyprintk address on command line. Would
it be preferable to do that rather than hard coding the address in the
platform code?

Cheers
James

> +CONFIG_CRYPTO_MD5=y
> +CONFIG_CRYPTO_SHA1=y
> +CONFIG_CRYPTO_DES=y
> +CONFIG_CRYPTO_DEFLATE=y
> +CONFIG_CRC16=y
> +CONFIG_LIBCRC32C=y
> -- 
> 1.9.1
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 5/5] MIPS: Add xilfpga defconfig
@ 2015-10-15  8:34     ` James Hogan
  0 siblings, 0 replies; 38+ messages in thread
From: James Hogan @ 2015-10-15  8:34 UTC (permalink / raw)
  To: Zubair Lutfullah Kakakhel
  Cc: ralf, robh+dt, linus.walleij, linux-mips, linux-gpio, devicetree,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3290 bytes --]

On Wed, Oct 14, 2015 at 01:51:57PM +0100, Zubair Lutfullah Kakakhel wrote:
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> ---
>  arch/mips/configs/xilfpga_defconfig | 59 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
>  create mode 100644 arch/mips/configs/xilfpga_defconfig
> 
> diff --git a/arch/mips/configs/xilfpga_defconfig b/arch/mips/configs/xilfpga_defconfig
> new file mode 100644
> index 0000000..94bb9b8
> --- /dev/null
> +++ b/arch/mips/configs/xilfpga_defconfig
> @@ -0,0 +1,59 @@
> +CONFIG_MACH_XILFPGA=y
> +# CONFIG_COMPACTION is not set
> +# CONFIG_LOCALVERSION_AUTO is not set
> +# CONFIG_CROSS_MEMORY_ATTACH is not set
> +# CONFIG_USELIB is not set
> +# CONFIG_SHMEM is not set
> +# CONFIG_AIO is not set
> +# CONFIG_ADVISE_SYSCALLS is not set

Did you disable these intentionally? Its a kernel tinification option
that is rarely used in defconfigs.

> +CONFIG_EMBEDDED=y
> +# CONFIG_VM_EVENT_COUNTERS is not set
> +# CONFIG_COMPAT_BRK is not set
> +CONFIG_SLAB=y
> +# CONFIG_BLOCK is not set
> +# CONFIG_SUSPEND is not set
> +# CONFIG_UEVENT_HELPER is not set
> +CONFIG_DEVTMPFS=y
> +CONFIG_DEVTMPFS_MOUNT=y
> +# CONFIG_STANDALONE is not set
> +# CONFIG_PREVENT_FIRMWARE_BUILD is not set
> +# CONFIG_FW_LOADER is not set
> +# CONFIG_ALLOW_DEV_COREDUMP is not set
> +# CONFIG_INPUT_MOUSEDEV is not set
> +# CONFIG_INPUT_KEYBOARD is not set
> +# CONFIG_INPUT_MOUSE is not set
> +# CONFIG_SERIO is not set
> +CONFIG_VT_HW_CONSOLE_BINDING=y
> +# CONFIG_UNIX98_PTYS is not set
> +# CONFIG_LEGACY_PTYS is not set
> +# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
> +CONFIG_SERIAL_8250_NR_UARTS=1
> +CONFIG_SERIAL_8250_RUNTIME_UARTS=1
> +CONFIG_SERIAL_OF_PLATFORM=y
> +# CONFIG_HW_RANDOM is not set
> +CONFIG_GPIO_SYSFS=y
> +CONFIG_GPIO_XILINX=y
> +# CONFIG_HWMON is not set
> +# CONFIG_USB_SUPPORT is not set
> +# CONFIG_MIPS_PLATFORM_DEVICES is not set
> +# CONFIG_IOMMU_SUPPORT is not set
> +# CONFIG_FILE_LOCKING is not set

Likewise, intentional? Its another tinification option that isn't all
that commonly used in defconfigs.

> +# CONFIG_DNOTIFY is not set
> +# CONFIG_INOTIFY_USER is not set

Likewise, intentional? I don't think inotify is deprecated in favour of
anything else yet (it appears to superscede dnotify).

> +# CONFIG_PROC_SYSCTL is not set

Likewise.

> +# CONFIG_PROC_PAGE_MONITOR is not set
> +# CONFIG_MISC_FILESYSTEMS is not set
> +# CONFIG_ENABLE_WARN_DEPRECATED is not set
> +# CONFIG_ENABLE_MUST_CHECK is not set

Particular reason to disable these two compile time warnings?

> +CONFIG_PANIC_ON_OOPS=y
> +# CONFIG_SCHED_DEBUG is not set
> +CONFIG_DEBUG_LOCK_ALLOC=y

Did you mean to leave this turned on?

> +# CONFIG_FTRACE is not set
> +CONFIG_CMDLINE_BOOL=y
> +CONFIG_CMDLINE="console=ttyS0,115200 clk_ignore_unused earlyprintk=serial,ttyS0,115200"

I believe you can specify an earlyprintk address on command line. Would
it be preferable to do that rather than hard coding the address in the
platform code?

Cheers
James

> +CONFIG_CRYPTO_MD5=y
> +CONFIG_CRYPTO_SHA1=y
> +CONFIG_CRYPTO_DES=y
> +CONFIG_CRYPTO_DEFLATE=y
> +CONFIG_CRC16=y
> +CONFIG_LIBCRC32C=y
> -- 
> 1.9.1
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH 1/5] dt-bindings: MIPS: Document xilfpga bindings and boot style
  2015-10-14 12:51     ` Zubair Lutfullah Kakakhel
                       ` (2 preceding siblings ...)
  (?)
@ 2015-10-18 16:47     ` Moritz Fischer
  -1 siblings, 0 replies; 38+ messages in thread
From: Moritz Fischer @ 2015-10-18 16:47 UTC (permalink / raw)
  To: Zubair Lutfullah Kakakhel
  Cc: ralf, Rob Herring, Linus Walleij, linux-mips, linux-gpio,
	devicetree, linux-kernel

Hi Zubair,

On Wed, Oct 14, 2015 at 5:51 AM, Zubair Lutfullah Kakakhel
<Zubair.Kakakhel@imgtec.com> wrote:
> Xilfpga boots only with device-tree. Document the required properties
> and the unique boot style
>
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> ---
>  .../devicetree/bindings/mips/img/xilfpga.txt       | 76 ++++++++++++++++++++++
>  1 file changed, 76 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mips/img/xilfpga.txt
>
> diff --git a/Documentation/devicetree/bindings/mips/img/xilfpga.txt b/Documentation/devicetree/bindings/mips/img/xilfpga.txt
> new file mode 100644
> index 0000000..1e7084c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mips/img/xilfpga.txt
> @@ -0,0 +1,76 @@
> +Imagination University Program MIPSFpga
> +=======================================
> +
> +Under the Imagination University Program, a microAptiv UP core has been released for academic usage.
> +
> +As we are dealing with a mips core instantiated on an FPGA, specifications are fluid and can be varied in RTL.
> +
> +This binding document is provided as baseline guidance for the example project provided by IMG.
> +
> +The example project runs on the Nexys4DDR board by Digilent powered by the ARTIX-7 FPGA by Xilinx.
> +
> +Relevant details about the example project and the Nexys4DDR board:
> +
> +- microAptiv UP core m14Kc
> +- 50MHz clock speed
> +- 128Mbyte DDR RAM     at 0x0000_0000
> +- 8Kbyte RAM           at 0x1000_0000
> +- axi_intc             at 0x1020_0000
> +- axi_uart16550                at 0x1040_0000
> +- axi_gpio             at 0x1060_0000
> +- axi_i2c              at 0x10A0_0000
> +- custom_gpio          at 0x10C0_0000
> +- axi_ethernetlite     at 0x10E0_0000
> +- 8Kbyte BootRAM       at 0x1FC0_0000
> +
> +Required properties:
> +--------------------
> + - compatible: Must include "img,xilfpga".
> +
> +CPU nodes:
> +----------
> +A "cpus" node is required.  Required properties:
> + - #address-cells: Must be 1.
> + - #size-cells: Must be 0.
> +A CPU sub-node is also required for at least CPU 0. Required properties:
> + - device_type: Must be "cpu".
> + - compatible: Must be "mips,m14Kc".
> + - reg: Must be <0>.
> + - clocks: Must include the CPU clock.  See ../../clock/clock-bindings.txt for
> +   details on clock bindings.
I think the reference to clock binding docs is not required.

> + - ext clock handle for fixed-clock received by MIPS core.
> +Example:
> +       cpus {
> +               #address-cells = <1>;
> +               #size-cells = <0>;
> +
> +               cpu0: cpu@0 {
> +                       device_type = "cpu";
> +                       compatible = "mips,m14Kc";
> +                       reg = <0>;
> +                       clocks  = <&ext>;
> +               };
> +       };
> +
> +       ext: ext {
> +               compatible = "fixed-clock";
> +               #clock-cells = <0>;
> +               clock-frequency = <50000000>;
> +       };
> +
> +Boot protocol:
> +--------------
> +
> +The BootRAM is a writeable "RAM" in FPGA at 0x1FC0_0000. This is for easy reprogrammibility via JTAG.
> +
> +The BootRAM inializes the cache and the axi_uart peripheral.
> +
> +DDR initialiation is already handled by a HW IP block.
> +
> +When the example project bitstream is loaded, the cpu_reset button needs to be pressed.
> +
> +The bootram initializes the cache and axi_uart. Then outputs MIPSFPGA\n\r on the serial port
> +on the Nexys4DDR board.
> +
> +At this point, the board is ready to load the Linux kernel vmlinux file via JTAG.
> +
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Cheers,

Moritz

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

* Re: [PATCH 2/5] gpio/xilinx: enable for MIPS
  2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
  (?)
  (?)
@ 2015-10-19  6:53   ` Linus Walleij
  -1 siblings, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2015-10-19  6:53 UTC (permalink / raw)
  To: Zubair Lutfullah Kakakhel
  Cc: Ralf Baechle, Rob Herring, Linux MIPS, linux-gpio, devicetree,
	linux-kernel

On Wed, Oct 14, 2015 at 2:51 PM, Zubair Lutfullah Kakakhel
<Zubair.Kakakhel@imgtec.com> wrote:

> MIPSfpga uses the axi gpio controller. Enable the driver for MIPS.
>
> Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 2/5] gpio/xilinx: enable for MIPS
  2015-10-14 15:57     ` Lars-Peter Clausen
  2015-10-14 16:54         ` Sören Brinkmann
@ 2015-10-19  6:55       ` Linus Walleij
  1 sibling, 0 replies; 38+ messages in thread
From: Linus Walleij @ 2015-10-19  6:55 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Sören Brinkmann, Zubair Lutfullah Kakakhel, Ralf Baechle,
	Rob Herring, Linux MIPS, linux-gpio, devicetree, linux-kernel

On Wed, Oct 14, 2015 at 5:57 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> On 10/14/2015 05:18 PM, Sören Brinkmann wrote:
>> On Wed, 2015-10-14 at 01:51PM +0100, Zubair Lutfullah Kakakhel wrote:

>> Hmm, in general, this driver is hopefully generic enough that it doesn't
>> have any real architecture dependencies. And I suspect, we want to
>> enable this driver for ARM64 for ZynqMP soon too. Should we probably
>> drop these arch dependencies completely? It seems to become quite a long list.
>
> I've been thinking about this a while ago. This is certainly not the only
> driver affected by this problem. But the thing is people always complain if
> new symbols become visable in Kconfig that don't apply to their platform.

I don't think it's that important. If people go do down in the GPIO submenu
they are looking at real weird stuff anyways. Please send a patch enabling
this for all rather than coming up with strange config symbols IMO.

Yours,
Linus Walleij

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

* Re: [PATCH 4/5] MIPS: xilfpga: Add mipsfpga platform code
  2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
@ 2015-10-21 14:35     ` Alban
  -1 siblings, 0 replies; 38+ messages in thread
From: Alban @ 2015-10-21 14:35 UTC (permalink / raw)
  To: Zubair Lutfullah Kakakhel
  Cc: Alban, ralf, robh+dt, linus.walleij, linux-mips, linux-gpio,
	devicetree, linux-kernel

Am Wed, 14 Oct 2015 13:51:56 +0100
schrieb Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>:

> The xilfpga platform will be DT only.
> 
> Add required platform code. DT files have already been added separately
>
> [...]
>
> diff --git a/arch/mips/include/asm/mach-xilfpga/gpio.h b/arch/mips/include/asm/mach-xilfpga/gpio.h
> new file mode 100644
> index 0000000..26778fc
> --- /dev/null
> +++ b/arch/mips/include/asm/mach-xilfpga/gpio.h
> @@ -0,0 +1,19 @@
> +/*
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * 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 __ASM_MACH_XILFPGA_GPIO_H
> +#define __ASM_MACH_XILFPGA_GPIO_H
> +
> +#include <asm-generic/gpio.h>
> +
> +#define gpio_get_value __gpio_get_value
> +#define gpio_set_value __gpio_set_value
> +
> +#endif /* __ASM_MACH_XILFPGA_GPIO_H */

Custom gpio.h has been disabled, this file won't be used, it can just
be dropped.

> diff --git a/arch/mips/include/asm/mach-xilfpga/irq.h b/arch/mips/include/asm/mach-xilfpga/irq.h
> new file mode 100644
> index 0000000..0132a5b9
> --- /dev/null
> +++ b/arch/mips/include/asm/mach-xilfpga/irq.h
> @@ -0,0 +1,18 @@
> +/*
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * 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 __MIPS_ASM_MACH_XILFPGA_IRQ_H__
> +#define __MIPS_ASM_MACH_XILFPGA_IRQ_H__
> +
> +#define NR_IRQS 32
> +
> +#include_next <irq.h>
> +
> +#endif /* __MIPS_ASM_MACH_XILFPGA_IRQ_H__ */

Is this really needed? If not I would not add it to keep the maintenance
burden down.

> [...]
>
> diff --git a/arch/mips/xilfpga/time.c b/arch/mips/xilfpga/time.c
> new file mode 100644
> index 0000000..3f2e39e
> --- /dev/null
> +++ b/arch/mips/xilfpga/time.c
> @@ -0,0 +1,41 @@
> +/*
> + * Xilfpga clocksource/timer setup
> + *
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + */
> +
> +#include <linux/clk.h>
> +#include <linux/clk-provider.h>
> +#include <linux/clocksource.h>
> +#include <linux/of.h>
> +
> +#include <asm/time.h>
> +
> +void __init plat_time_init(void)
> +{
> +	struct device_node *np;
> +	struct clk *clk = 0;
> +
> +	of_clk_init(NULL);
> +	clocksource_of_init();
> +
> +	np = of_get_cpu_node(0, NULL);
> +	if (!np) {
> +		pr_err("Failed to get CPU node\n");
> +		return;
> +	}
> +
> +	clk = of_clk_get(np, 0);
> +	if (IS_ERR(clk)) {
> +		pr_err("Failed to get CPU clock: %ld\n", PTR_ERR(clk));
> +		return;
> +	}
> +
> +	mips_hpt_frequency = clk_get_rate(clk) / 2;
> +	clk_put(clk);
> +}

I wanted to use something similar on ATH79 once all boards moved to DT.
On the other hand I saw that BMIPS use a dedicated property on the CPU
node to represent the HPT frequency. If possible it would make sense to
use a common scheme for all MIPS platforms. However I personally don't
know enough about MIPS in general to judge this.

On the other hand I think it might make more sense to have a dedicated
node in DT to represent the HPT timer instead of hacking on the CPU
node. That would also fit better if the HPT code ever become is a real
driver.

Alban

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

* Re: [PATCH 4/5] MIPS: xilfpga: Add mipsfpga platform code
@ 2015-10-21 14:35     ` Alban
  0 siblings, 0 replies; 38+ messages in thread
From: Alban @ 2015-10-21 14:35 UTC (permalink / raw)
  To: Zubair Lutfullah Kakakhel
  Cc: Alban, ralf, robh+dt, linus.walleij, linux-mips, linux-gpio,
	devicetree, linux-kernel

Am Wed, 14 Oct 2015 13:51:56 +0100
schrieb Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>:

> The xilfpga platform will be DT only.
> 
> Add required platform code. DT files have already been added separately
>
> [...]
>
> diff --git a/arch/mips/include/asm/mach-xilfpga/gpio.h b/arch/mips/include/asm/mach-xilfpga/gpio.h
> new file mode 100644
> index 0000000..26778fc
> --- /dev/null
> +++ b/arch/mips/include/asm/mach-xilfpga/gpio.h
> @@ -0,0 +1,19 @@
> +/*
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * 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 __ASM_MACH_XILFPGA_GPIO_H
> +#define __ASM_MACH_XILFPGA_GPIO_H
> +
> +#include <asm-generic/gpio.h>
> +
> +#define gpio_get_value __gpio_get_value
> +#define gpio_set_value __gpio_set_value
> +
> +#endif /* __ASM_MACH_XILFPGA_GPIO_H */

Custom gpio.h has been disabled, this file won't be used, it can just
be dropped.

> diff --git a/arch/mips/include/asm/mach-xilfpga/irq.h b/arch/mips/include/asm/mach-xilfpga/irq.h
> new file mode 100644
> index 0000000..0132a5b9
> --- /dev/null
> +++ b/arch/mips/include/asm/mach-xilfpga/irq.h
> @@ -0,0 +1,18 @@
> +/*
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * 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 __MIPS_ASM_MACH_XILFPGA_IRQ_H__
> +#define __MIPS_ASM_MACH_XILFPGA_IRQ_H__
> +
> +#define NR_IRQS 32
> +
> +#include_next <irq.h>
> +
> +#endif /* __MIPS_ASM_MACH_XILFPGA_IRQ_H__ */

Is this really needed? If not I would not add it to keep the maintenance
burden down.

> [...]
>
> diff --git a/arch/mips/xilfpga/time.c b/arch/mips/xilfpga/time.c
> new file mode 100644
> index 0000000..3f2e39e
> --- /dev/null
> +++ b/arch/mips/xilfpga/time.c
> @@ -0,0 +1,41 @@
> +/*
> + * Xilfpga clocksource/timer setup
> + *
> + * Copyright (C) 2015 Imagination Technologies
> + * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + */
> +
> +#include <linux/clk.h>
> +#include <linux/clk-provider.h>
> +#include <linux/clocksource.h>
> +#include <linux/of.h>
> +
> +#include <asm/time.h>
> +
> +void __init plat_time_init(void)
> +{
> +	struct device_node *np;
> +	struct clk *clk = 0;
> +
> +	of_clk_init(NULL);
> +	clocksource_of_init();
> +
> +	np = of_get_cpu_node(0, NULL);
> +	if (!np) {
> +		pr_err("Failed to get CPU node\n");
> +		return;
> +	}
> +
> +	clk = of_clk_get(np, 0);
> +	if (IS_ERR(clk)) {
> +		pr_err("Failed to get CPU clock: %ld\n", PTR_ERR(clk));
> +		return;
> +	}
> +
> +	mips_hpt_frequency = clk_get_rate(clk) / 2;
> +	clk_put(clk);
> +}

I wanted to use something similar on ATH79 once all boards moved to DT.
On the other hand I saw that BMIPS use a dedicated property on the CPU
node to represent the HPT frequency. If possible it would make sense to
use a common scheme for all MIPS platforms. However I personally don't
know enough about MIPS in general to judge this.

On the other hand I think it might make more sense to have a dedicated
node in DT to represent the HPT timer instead of hacking on the CPU
node. That would also fit better if the HPT code ever become is a real
driver.

Alban

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

end of thread, other threads:[~2015-10-21 14:35 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-14 12:51 [PATCH 0/5] MIPS: Add Xilfpga platform Zubair Lutfullah Kakakhel
2015-10-14 12:51 ` Zubair Lutfullah Kakakhel
     [not found] ` <1444827117-10939-1-git-send-email-Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-10-14 12:51   ` [PATCH 1/5] dt-bindings: MIPS: Document xilfpga bindings and boot style Zubair Lutfullah Kakakhel
2015-10-14 12:51     ` Zubair Lutfullah Kakakhel
2015-10-14 12:51     ` Zubair Lutfullah Kakakhel
2015-10-15  7:22     ` James Hogan
2015-10-15  7:22       ` James Hogan
2015-10-18 16:47     ` Moritz Fischer
2015-10-14 12:51 ` [PATCH 2/5] gpio/xilinx: enable for MIPS Zubair Lutfullah Kakakhel
2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
2015-10-14 15:18   ` Sören Brinkmann
2015-10-14 15:18     ` Sören Brinkmann
2015-10-14 15:57     ` Lars-Peter Clausen
2015-10-14 16:54       ` Sören Brinkmann
2015-10-14 16:54         ` Sören Brinkmann
2015-10-14 17:24         ` Lars-Peter Clausen
2015-10-14 17:24           ` Lars-Peter Clausen
2015-10-14 17:33           ` Sören Brinkmann
2015-10-14 17:33             ` Sören Brinkmann
2015-10-14 18:22             ` Moritz Fischer
2015-10-14 18:22               ` Moritz Fischer
2015-10-19  6:55       ` Linus Walleij
2015-10-19  6:53   ` Linus Walleij
2015-10-14 12:51 ` [PATCH 3/5] MIPS: dt: xilfpga: Add xilfpga device tree files Zubair Lutfullah Kakakhel
2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
     [not found]   ` <1444827117-10939-4-git-send-email-Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-10-15  7:45     ` James Hogan
2015-10-15  7:45       ` James Hogan
2015-10-15  7:45       ` James Hogan
2015-10-14 12:51 ` [PATCH 4/5] MIPS: xilfpga: Add mipsfpga platform code Zubair Lutfullah Kakakhel
2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
2015-10-15  8:11   ` James Hogan
2015-10-15  8:11     ` James Hogan
2015-10-21 14:35   ` Alban
2015-10-21 14:35     ` Alban
2015-10-14 12:51 ` [PATCH 5/5] MIPS: Add xilfpga defconfig Zubair Lutfullah Kakakhel
2015-10-14 12:51   ` Zubair Lutfullah Kakakhel
2015-10-15  8:34   ` James Hogan
2015-10-15  8:34     ` James Hogan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.