Subject: [PATCH 0/2] MIPS: Xilfpga: Switch to generic kernel

Hi,

Couple of patches that convert the MIPSfpga platform to using
the generic kernels

Based on v4.11-rc4.

Regards,
ZubairLK

Zubair Lutfullah Kakakhel (2):
MIPS: generic: Add support for MIPSfpga
MIPS: Xilfpga: Switch to using generic defconfigs

arch/mips/Kbuild.platforms | 1 -
arch/mips/Kconfig | 24 ---------
arch/mips/Makefile | 4 ++
arch/mips/boot/dts/xilfpga/Makefile | 2 +-
arch/mips/boot/dts/xilfpga/nexys4ddr.dts | 8 +++
arch/mips/configs/generic/board-xilfpga.config | 19 +++++++
arch/mips/configs/xilfpga_defconfig | 75 --------------------------
arch/mips/generic/Kconfig | 6 +++
arch/mips/generic/vmlinux.its.S | 25 +++++++++
arch/mips/xilfpga/Kconfig | 9 ----
arch/mips/xilfpga/Makefile | 7 ---
arch/mips/xilfpga/Platform | 3 --
arch/mips/xilfpga/init.c | 44 ---------------
arch/mips/xilfpga/intc.c | 22 --------
arch/mips/xilfpga/time.c | 41 --------------
15 files changed, 63 insertions(+), 227 deletions(-)
create mode 100644 arch/mips/configs/generic/board-xilfpga.config
delete mode 100644 arch/mips/configs/xilfpga_defconfig
delete mode 100644 arch/mips/xilfpga/Kconfig
delete mode 100644 arch/mips/xilfpga/Makefile
delete mode 100644 arch/mips/xilfpga/Platform
delete mode 100644 arch/mips/xilfpga/init.c
delete mode 100644 arch/mips/xilfpga/intc.c
delete mode 100644 arch/mips/xilfpga/time.c

--
2.10.2


Subject: [PATCH 2/2] MIPS: Xilfpga: Switch to using generic defconfigs

Use the generic platform code and remove arch/mips/xilfpga

Signed-off-by: Zubair Lutfullah Kakakhel <[email protected]>
---
arch/mips/Kbuild.platforms | 1 -
arch/mips/Kconfig | 24 ------------
arch/mips/Makefile | 4 ++
arch/mips/configs/xilfpga_defconfig | 75 -------------------------------------
arch/mips/xilfpga/Kconfig | 9 -----
arch/mips/xilfpga/Makefile | 7 ----
arch/mips/xilfpga/Platform | 3 --
arch/mips/xilfpga/init.c | 44 ----------------------
arch/mips/xilfpga/intc.c | 22 -----------
arch/mips/xilfpga/time.c | 41 --------------------
10 files changed, 4 insertions(+), 226 deletions(-)
delete mode 100644 arch/mips/configs/xilfpga_defconfig
delete mode 100644 arch/mips/xilfpga/Kconfig
delete mode 100644 arch/mips/xilfpga/Makefile
delete mode 100644 arch/mips/xilfpga/Platform
delete mode 100644 arch/mips/xilfpga/init.c
delete mode 100644 arch/mips/xilfpga/intc.c
delete mode 100644 arch/mips/xilfpga/time.c

diff --git a/arch/mips/Kbuild.platforms b/arch/mips/Kbuild.platforms
index f5f1bdb..ac7ad54 100644
--- a/arch/mips/Kbuild.platforms
+++ b/arch/mips/Kbuild.platforms
@@ -34,7 +34,6 @@ 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 a008a9f..d8f152e 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -463,29 +463,6 @@ config MACH_PISTACHIO
help
This enables support for the IMG Pistachio SoC platform.

-config MACH_XILFPGA
- bool "MIPSfpga Xilinx based boards"
- select BOOT_ELF32
- select BOOT_RAW
- select BUILTIN_DTB
- select CEVT_R4K
- select COMMON_CLK
- select CSRC_R4K
- select GPIOLIB
- 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
- select XILINX_INTC
- help
- This enables support for the IMG University Program MIPSfpga platform.
-
config MIPS_MALTA
bool "MIPS Malta board"
select ARCH_MAY_HAVE_PC_FDC
@@ -1029,7 +1006,6 @@ 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/Makefile b/arch/mips/Makefile
index 8ef9c02..ce65dea 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -501,6 +501,10 @@ $(generic_config_dir)/%.config: ;
# now that the boards have been converted to use the generic kernel they are
# wrappers around the generic rules above.
#
+.PHONY: xilfpga_defconfig
+xilfpga_defconfig:
+ $(Q)$(MAKE) 32r2el_defconfig BOARDS=xilfpga
+
.PHONY: sead3_defconfig
sead3_defconfig:
$(Q)$(MAKE) 32r2el_defconfig BOARDS=sead-3
diff --git a/arch/mips/configs/xilfpga_defconfig b/arch/mips/configs/xilfpga_defconfig
deleted file mode 100644
index 829c637..0000000
--- a/arch/mips/configs/xilfpga_defconfig
+++ /dev/null
@@ -1,75 +0,0 @@
-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_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-# CONFIG_IPV6 is not set
-# CONFIG_WIRELESS 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_NETDEVICES=y
-# CONFIG_NET_CORE is not set
-# CONFIG_NET_VENDOR_ARC is not set
-# CONFIG_NET_CADENCE is not set
-# CONFIG_NET_VENDOR_BROADCOM is not set
-# CONFIG_NET_VENDOR_EZCHIP is not set
-# CONFIG_NET_VENDOR_INTEL is not set
-# CONFIG_NET_VENDOR_MARVELL is not set
-# CONFIG_NET_VENDOR_MICREL is not set
-# CONFIG_NET_VENDOR_NATSEMI is not set
-# CONFIG_NET_VENDOR_NETRONOME is not set
-# CONFIG_NET_VENDOR_QUALCOMM is not set
-# CONFIG_NET_VENDOR_RENESAS is not set
-# CONFIG_NET_VENDOR_ROCKER is not set
-# CONFIG_NET_VENDOR_SAMSUNG is not set
-# CONFIG_NET_VENDOR_SEEQ is not set
-# CONFIG_NET_VENDOR_SMSC is not set
-# CONFIG_NET_VENDOR_STMICRO is not set
-# CONFIG_NET_VENDOR_SYNOPSYS is not set
-# CONFIG_NET_VENDOR_VIA is not set
-# CONFIG_NET_VENDOR_WIZNET is not set
-CONFIG_XILINX_EMACLITE=y
-CONFIG_SMSC_PHY=y
-# CONFIG_WLAN 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_I2C=y
-CONFIG_I2C_CHARDEV=y
-# CONFIG_I2C_HELPER_AUTO is not set
-CONFIG_I2C_XILINX=y
-CONFIG_GPIO_SYSFS=y
-CONFIG_GPIO_XILINX=y
-CONFIG_SENSORS_ADT7410=y
-# 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_TMPFS=y
-# 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"
diff --git a/arch/mips/xilfpga/Kconfig b/arch/mips/xilfpga/Kconfig
deleted file mode 100644
index 42a030a..0000000
--- a/arch/mips/xilfpga/Kconfig
+++ /dev/null
@@ -1,9 +0,0 @@
-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
deleted file mode 100644
index a4deec6..0000000
--- a/arch/mips/xilfpga/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# 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
deleted file mode 100644
index ed375af..0000000
--- a/arch/mips/xilfpga/Platform
+++ /dev/null
@@ -1,3 +0,0 @@
-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
deleted file mode 100644
index 602e384..0000000
--- a/arch/mips/xilfpga/init.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Xilfpga platform setup
- *
- * Copyright (C) 2015 Imagination Technologies
- * Author: Zubair Lutfullah Kakakhel <[email protected]>
- *
- * 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 <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();
-}
diff --git a/arch/mips/xilfpga/intc.c b/arch/mips/xilfpga/intc.c
deleted file mode 100644
index a127cca..0000000
--- a/arch/mips/xilfpga/intc.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Xilfpga interrupt controller setup
- *
- * Copyright (C) 2015 Imagination Technologies
- * Author: Zubair Lutfullah Kakakhel <[email protected]>
- *
- * 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 <linux/irqchip.h>
-
-#include <asm/irq_cpu.h>
-
-
-void __init arch_init_irq(void)
-{
- irqchip_init();
-}
diff --git a/arch/mips/xilfpga/time.c b/arch/mips/xilfpga/time.c
deleted file mode 100644
index cbb3fca..0000000
--- a/arch/mips/xilfpga/time.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Xilfpga clocksource/timer setup
- *
- * Copyright (C) 2015 Imagination Technologies
- * Author: Zubair Lutfullah Kakakhel <[email protected]>
- *
- * 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_probe();
-
- 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);
-}
--
2.10.2

Subject: [PATCH 1/2] MIPS: generic: Add support for MIPSfpga

Add support for the MIPSfpga platform to generic kernel.

Signed-off-by: Zubair Lutfullah Kakakhel <[email protected]>
---
arch/mips/boot/dts/xilfpga/Makefile | 2 +-
arch/mips/boot/dts/xilfpga/nexys4ddr.dts | 8 ++++++++
arch/mips/configs/generic/board-xilfpga.config | 19 +++++++++++++++++++
arch/mips/generic/Kconfig | 6 ++++++
arch/mips/generic/vmlinux.its.S | 25 +++++++++++++++++++++++++
5 files changed, 59 insertions(+), 1 deletion(-)
create mode 100644 arch/mips/configs/generic/board-xilfpga.config

diff --git a/arch/mips/boot/dts/xilfpga/Makefile b/arch/mips/boot/dts/xilfpga/Makefile
index 913a752..bbf8fb6 100644
--- a/arch/mips/boot/dts/xilfpga/Makefile
+++ b/arch/mips/boot/dts/xilfpga/Makefile
@@ -1,4 +1,4 @@
-dtb-$(CONFIG_XILFPGA_NEXYS4DDR) += nexys4ddr.dtb
+dtb-$(CONFIG_FIT_IMAGE_FDT_XILFPGA) += nexys4ddr.dtb

obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))

diff --git a/arch/mips/boot/dts/xilfpga/nexys4ddr.dts b/arch/mips/boot/dts/xilfpga/nexys4ddr.dts
index 09a62f2..8050e84 100644
--- a/arch/mips/boot/dts/xilfpga/nexys4ddr.dts
+++ b/arch/mips/boot/dts/xilfpga/nexys4ddr.dts
@@ -4,6 +4,14 @@

/ {
compatible = "digilent,nexys4ddr";
+
+ aliases {
+ serial0 = &axi_uart16550;
+ };
+ chosen {
+ bootargs = "console=ttyS0,115200";
+ stdout-path = "serial0:115200n8";
+ };

memory {
device_type = "memory";
diff --git a/arch/mips/configs/generic/board-xilfpga.config b/arch/mips/configs/generic/board-xilfpga.config
new file mode 100644
index 0000000..786d387
--- /dev/null
+++ b/arch/mips/configs/generic/board-xilfpga.config
@@ -0,0 +1,19 @@
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_XILINX=y
+CONFIG_PANIC_ON_OOPS=y
+CONFIG_FIT_IMAGE_FDT_XILFPGA=y
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_XILINX=y
+CONFIG_SENSORS_ADT7410=y
+CONFIG_TMPFS=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_NETDEVICES=y
+CONFIG_XILINX_EMACLITE=y
+CONFIG_SMSC_PHY=y
diff --git a/arch/mips/generic/Kconfig b/arch/mips/generic/Kconfig
index a606b3f..26201e2 100644
--- a/arch/mips/generic/Kconfig
+++ b/arch/mips/generic/Kconfig
@@ -16,4 +16,10 @@ config LEGACY_BOARD_SEAD3
Enable this to include support for booting on MIPS SEAD-3 FPGA-based
development boards, which boot using a legacy boot protocol.

+config FIT_IMAGE_FDT_XILFPGA
+ bool "Include FDT for Xilfpga"
+ help
+ Enable this to include the FDT for the MIPSfpga platform
+ from Imagination Technologies in the FIT kernel image.
+
endif
diff --git a/arch/mips/generic/vmlinux.its.S b/arch/mips/generic/vmlinux.its.S
index f67fbf1..b2daa7e 100644
--- a/arch/mips/generic/vmlinux.its.S
+++ b/arch/mips/generic/vmlinux.its.S
@@ -29,3 +29,28 @@
};
};
};
+
+#ifdef CONFIG_FIT_IMAGE_FDT_XILFPGA
+/ {
+ images {
+ fdt@xilfpga {
+ description = "MIPSfpga (xilfpga) Device Tree";
+ data = /incbin/("boot/dts/xilfpga/nexys4ddr.dtb");
+ type = "flat_dt";
+ arch = "mips";
+ compression = "none";
+ hash@0 {
+ algo = "sha1";
+ };
+ };
+ };
+
+ configurations {
+ conf@xilfpga {
+ description = "MIPSfpga Linux kernel";
+ kernel = "kernel@0";
+ fdt = "fdt@xilfpga";
+ };
+ };
+};
+#endif /* CONFIG_FIT_IMAGE_FDT_XILFPGA */
--
2.10.2

2017-11-09 13:01:27

by James Hogan

[permalink] [raw]
Subject: Re: [PATCH 0/2] MIPS: Xilfpga: Switch to generic kernel

On Fri, Mar 31, 2017 at 10:00:40AM +0100, Zubair Lutfullah Kakakhel wrote:
> Hi,
>
> Couple of patches that convert the MIPSfpga platform to using
> the generic kernels
>
> Based on v4.11-rc4.

Thanks, Applied for 4.15.

Tweaks to fix conflicts:
- Use separate board-xilfpga.its.S.
- Add 32r2 and little endian requires to board-xilfpga.config
- Update arch/mips/Makefile snippet and move to end

Cheers
James


>
> Regards,
> ZubairLK
>
> Zubair Lutfullah Kakakhel (2):
> MIPS: generic: Add support for MIPSfpga
> MIPS: Xilfpga: Switch to using generic defconfigs
>
> arch/mips/Kbuild.platforms | 1 -
> arch/mips/Kconfig | 24 ---------
> arch/mips/Makefile | 4 ++
> arch/mips/boot/dts/xilfpga/Makefile | 2 +-
> arch/mips/boot/dts/xilfpga/nexys4ddr.dts | 8 +++
> arch/mips/configs/generic/board-xilfpga.config | 19 +++++++
> arch/mips/configs/xilfpga_defconfig | 75 --------------------------
> arch/mips/generic/Kconfig | 6 +++
> arch/mips/generic/vmlinux.its.S | 25 +++++++++
> arch/mips/xilfpga/Kconfig | 9 ----
> arch/mips/xilfpga/Makefile | 7 ---
> arch/mips/xilfpga/Platform | 3 --
> arch/mips/xilfpga/init.c | 44 ---------------
> arch/mips/xilfpga/intc.c | 22 --------
> arch/mips/xilfpga/time.c | 41 --------------
> 15 files changed, 63 insertions(+), 227 deletions(-)
> create mode 100644 arch/mips/configs/generic/board-xilfpga.config
> delete mode 100644 arch/mips/configs/xilfpga_defconfig
> delete mode 100644 arch/mips/xilfpga/Kconfig
> delete mode 100644 arch/mips/xilfpga/Makefile
> delete mode 100644 arch/mips/xilfpga/Platform
> delete mode 100644 arch/mips/xilfpga/init.c
> delete mode 100644 arch/mips/xilfpga/intc.c
> delete mode 100644 arch/mips/xilfpga/time.c
>
> --
> 2.10.2
>
>


Attachments:
(No filename) (2.03 kB)
signature.asc (849.00 B)
Digital signature
Download all attachments