* [PATCH_V3 0/4] MIPS: Add Xilfpga platform
@ 2015-10-26 11:30 Zubair Lutfullah Kakakhel
2015-10-26 11:30 ` [PATCH_V3 1/4] dt-bindings: MIPS: Document xilfpga bindings and boot style Zubair Lutfullah Kakakhel
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-26 11:30 UTC (permalink / raw)
To: ralf-6z/3iImG2C8G8FEW9MqTrA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A
Cc: Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA,
linux-mips-6z/3iImG2C8G8FEW9MqTrA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
Hi,
This series is based on v4.3-rc7.
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/4) welcome.
Regards,
ZubairLK
V2 -> V3
Minor typos/nitpicks.
Removed redundant header.
Individual patches have changelogs.
V1 -> V2
Nothing major functional.
Mostly cleanup. Individual patches have changelogs.
Removed the gpio patch from this series as Linus Walleij applied it.
Zubair Lutfullah Kakakhel (4):
dt-bindings: MIPS: Document xilfpga bindings and boot style
MIPS: dt: xilfpga: Add xilfpga device tree files.
MIPS: xilfpga: Add mipsfpga platform code
MIPS: Add xilfpga defconfig
.../devicetree/bindings/mips/img/xilfpga.txt | 83 ++++++++++++++++++++++
arch/mips/Kbuild.platforms | 1 +
arch/mips/Kconfig | 23 ++++++
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 | 46 ++++++++++++
arch/mips/configs/xilfpga_defconfig | 40 +++++++++++
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 | 25 +++++++
arch/mips/xilfpga/time.c | 41 +++++++++++
15 files changed, 384 insertions(+)
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/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
--
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] 6+ messages in thread
* [PATCH_V3 1/4] dt-bindings: MIPS: Document xilfpga bindings and boot style
2015-10-26 11:30 [PATCH_V3 0/4] MIPS: Add Xilfpga platform Zubair Lutfullah Kakakhel
@ 2015-10-26 11:30 ` Zubair Lutfullah Kakakhel
[not found] ` <1445859057-47665-2-git-send-email-Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-10-26 11:30 ` [PATCH_V3 2/4] MIPS: dt: xilfpga: Add xilfpga device tree files Zubair Lutfullah Kakakhel
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-26 11:30 UTC (permalink / raw)
To: ralf, robh+dt; +Cc: Zubair.Kakakhel, linux-mips, linux-kernel, devicetree
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>
---
V2->V3
minor nitpicks. mips->MIPS. typo. reorder compatible strings in priority
V1->V2
Reformatted to 80 char column
Correct clock phandle description
Added digilent,nexys4ddr to get more specific about platform
Added compatible string in example.
---
.../devicetree/bindings/mips/img/xilfpga.txt | 83 ++++++++++++++++++++++
1 file changed, 83 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..57e7ee9
--- /dev/null
+++ b/Documentation/devicetree/bindings/mips/img/xilfpga.txt
@@ -0,0 +1,83 @@
+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 "digilent,nexys4ddr","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: phandle to ext clock for fixed-clock received by MIPS core.
+
+Example:
+
+ compatible = "img,xilfpga","digilent,nexys4ddr";
+ 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 initializes the cache and the axi_uart peripheral.
+
+DDR initialization 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] 6+ messages in thread
* [PATCH_V3 2/4] MIPS: dt: xilfpga: Add xilfpga device tree files.
2015-10-26 11:30 [PATCH_V3 0/4] MIPS: Add Xilfpga platform Zubair Lutfullah Kakakhel
2015-10-26 11:30 ` [PATCH_V3 1/4] dt-bindings: MIPS: Document xilfpga bindings and boot style Zubair Lutfullah Kakakhel
@ 2015-10-26 11:30 ` Zubair Lutfullah Kakakhel
2015-10-26 11:30 ` [PATCH_V3 3/4] MIPS: xilfpga: Add mipsfpga platform code Zubair Lutfullah Kakakhel
2015-10-26 11:30 ` [PATCH_V3 4/4] MIPS: Add xilfpga defconfig Zubair Lutfullah Kakakhel
3 siblings, 0 replies; 6+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-26 11:30 UTC (permalink / raw)
To: ralf, robh+dt; +Cc: Zubair.Kakakhel, linux-mips, linux-kernel, devicetree
Add device tree files for the MIPSfpga platform.
See Documentation/devicetree/bindings/mips/img/xilfpga.txt
for details about MIPSfpga
Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
V2 -> V3
no change
V1 -> V2
Reformatted git log for 80 column
Added nexys4ddr compatible
Fixed some whitespace
Removed a redundant status okay
---
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 | 46 ++++++++++++++++++++++++++++++
4 files changed, 77 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..686ebd1
--- /dev/null
+++ b/arch/mips/boot/dts/xilfpga/nexys4ddr.dts
@@ -0,0 +1,46 @@
+/dts-v1/;
+
+#include "microAptiv.dtsi"
+
+/ {
+ compatible = "digilent,nexys4ddr";
+
+ memory {
+ device_type = "memory";
+ reg = <0x0 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>;
+ 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>;
+
+ clocks = <&ext>;
+ };
+};
+
+&ext {
+ clock-frequency = <50000000>;
+};
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH_V3 3/4] MIPS: xilfpga: Add mipsfpga platform code
2015-10-26 11:30 [PATCH_V3 0/4] MIPS: Add Xilfpga platform Zubair Lutfullah Kakakhel
2015-10-26 11:30 ` [PATCH_V3 1/4] dt-bindings: MIPS: Document xilfpga bindings and boot style Zubair Lutfullah Kakakhel
2015-10-26 11:30 ` [PATCH_V3 2/4] MIPS: dt: xilfpga: Add xilfpga device tree files Zubair Lutfullah Kakakhel
@ 2015-10-26 11:30 ` Zubair Lutfullah Kakakhel
2015-10-26 11:30 ` [PATCH_V3 4/4] MIPS: Add xilfpga defconfig Zubair Lutfullah Kakakhel
3 siblings, 0 replies; 6+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-26 11:30 UTC (permalink / raw)
To: ralf, robh+dt; +Cc: Zubair.Kakakhel, linux-mips, linux-kernel, devicetree
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>
---
V2 -> V3
removed redundant gpio.h
minor typos
V1 -> V2
Minor nitpicks. Nothing functional.
Removed some redundant select 8250 serial.
Removed a newline
Added description of platform in Kconfig
Reformated makefile
---
arch/mips/Kbuild.platforms | 1 +
arch/mips/Kconfig | 23 +++++++++++++
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 | 25 ++++++++++++++
arch/mips/xilfpga/time.c | 41 +++++++++++++++++++++++
9 files changed, 184 insertions(+)
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..a9f632f 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -401,6 +401,28 @@ 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 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 IMG University Program MIPSfpga platform.
+
config MIPS_MALTA
bool "MIPS Malta board"
select ARCH_MAY_HAVE_PC_FDC
@@ -964,6 +986,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/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..a4deec6
--- /dev/null
+++ b/arch/mips/xilfpga/Makefile
@@ -0,0 +1,7 @@
+#
+# Makefile for the Xilfpga
+#
+
+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..ce2aee2
--- /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..c4d1a71
--- /dev/null
+++ b/arch/mips/xilfpga/intc.c
@@ -0,0 +1,25 @@
+/*
+ * 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..a1c0fc8
--- /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;
+
+ 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] 6+ messages in thread
* [PATCH_V3 4/4] MIPS: Add xilfpga defconfig
2015-10-26 11:30 [PATCH_V3 0/4] MIPS: Add Xilfpga platform Zubair Lutfullah Kakakhel
` (2 preceding siblings ...)
2015-10-26 11:30 ` [PATCH_V3 3/4] MIPS: xilfpga: Add mipsfpga platform code Zubair Lutfullah Kakakhel
@ 2015-10-26 11:30 ` Zubair Lutfullah Kakakhel
3 siblings, 0 replies; 6+ messages in thread
From: Zubair Lutfullah Kakakhel @ 2015-10-26 11:30 UTC (permalink / raw)
To: ralf, robh+dt; +Cc: Zubair.Kakakhel, linux-mips, linux-kernel, devicetree
Add defconfig for MIPSfpga
Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
---
V2 -> V3
no change
V1 -> V2
Reduced redundant options that had crept in
---
arch/mips/configs/xilfpga_defconfig | 40 +++++++++++++++++++++++++++++++++++++
1 file changed, 40 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..ed1dce3
--- /dev/null
+++ b/arch/mips/configs/xilfpga_defconfig
@@ -0,0 +1,40 @@
+CONFIG_MACH_XILFPGA=y
+# CONFIG_COMPACTION is not set
+# CONFIG_LOCALVERSION_AUTO 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=y
+CONFIG_SERIAL_8250_CONSOLE=y
+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_PROC_PAGE_MONITOR is not set
+# CONFIG_MISC_FILESYSTEMS is not set
+CONFIG_PANIC_ON_OOPS=y
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_FTRACE is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="console=ttyS0,115200"
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH_V3 1/4] dt-bindings: MIPS: Document xilfpga bindings and boot style
[not found] ` <1445859057-47665-2-git-send-email-Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
@ 2015-11-13 14:52 ` Rob Herring
0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2015-11-13 14:52 UTC (permalink / raw)
To: Zubair Lutfullah Kakakhel
Cc: ralf-6z/3iImG2C8G8FEW9MqTrA, linux-mips-6z/3iImG2C8G8FEW9MqTrA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
On Mon, Oct 26, 2015 at 11:30:54AM +0000, 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-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>
> ---
> V2->V3
> minor nitpicks. mips->MIPS. typo. reorder compatible strings in priority
>
> V1->V2
>
> Reformatted to 80 char column
> Correct clock phandle description
> Added digilent,nexys4ddr to get more specific about platform
> Added compatible string in example.
> ---
> .../devicetree/bindings/mips/img/xilfpga.txt | 83 ++++++++++++++++++++++
> 1 file changed, 83 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..57e7ee9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mips/img/xilfpga.txt
> @@ -0,0 +1,83 @@
> +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 "digilent,nexys4ddr","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: phandle to ext clock for fixed-clock received by MIPS core.
> +
> +Example:
> +
> + compatible = "img,xilfpga","digilent,nexys4ddr";
> + 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 initializes the cache and the axi_uart peripheral.
> +
> +DDR initialization 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 [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-11-13 14:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-26 11:30 [PATCH_V3 0/4] MIPS: Add Xilfpga platform Zubair Lutfullah Kakakhel
2015-10-26 11:30 ` [PATCH_V3 1/4] dt-bindings: MIPS: Document xilfpga bindings and boot style Zubair Lutfullah Kakakhel
[not found] ` <1445859057-47665-2-git-send-email-Zubair.Kakakhel-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-11-13 14:52 ` Rob Herring
2015-10-26 11:30 ` [PATCH_V3 2/4] MIPS: dt: xilfpga: Add xilfpga device tree files Zubair Lutfullah Kakakhel
2015-10-26 11:30 ` [PATCH_V3 3/4] MIPS: xilfpga: Add mipsfpga platform code Zubair Lutfullah Kakakhel
2015-10-26 11:30 ` [PATCH_V3 4/4] MIPS: Add xilfpga defconfig Zubair Lutfullah Kakakhel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).