Signed-off-by: Dieter Pfeuffer <[email protected]>
---
 .../files/arch/powerpc/platforms/85xx/men_nm50.c   | 77 ++++++++++++++++++++++
 .../230-powerpc-85xx-men-nm50-support.patch        | 22 +++++++
 2 files changed, 99 insertions(+)
 create mode 100644 
target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/men_nm50.c
 create mode 100644 
target/linux/mpc85xx/patches-3.18/230-powerpc-85xx-men-nm50-support.patch

diff --git a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/men_nm50.c 
b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/men_nm50.c
new file mode 100644
index 0000000..d476529
--- /dev/null
+++ b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/men_nm50.c
@@ -0,0 +1,77 @@
+/*
+ * MEN NM50 board setup
+ *
+ * Copyright (c) 2016 MEN Mikro Elektronik GmbH
+ *
+ * Based on p1022_rdk.c (C) Timur Tabi <[email protected]>
+ *
+ * This is free software, licensed under the GNU General Public License v2.
+ * See /LICENSE for more information.
+ */
+
+#include <linux/pci.h>
+#include <linux/of_platform.h>
+#include <asm/mpic.h>
+#include <asm/swiotlb.h>
+
+#include <sysdev/fsl_soc.h>
+#include <sysdev/fsl_pci.h>
+#include <asm/udbg.h>
+
+#include "mpc85xx.h"
+#include "smp.h"
+
+static void __init men_nm50_pic_init(void)
+{
+       struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |
+                                  MPIC_SINGLE_DEST_CPU,
+                                  0, 256, " OpenPIC ");
+       BUG_ON(mpic == NULL);
+       mpic_init(mpic);
+}
+
+/**
+ * Setup the architecture
+ */
+static void __init men_nm50_setup_arch(void)
+{
+       if (ppc_md.progress)
+               ppc_md.progress("men_nm50_setup_arch()", 0);
+
+       mpc85xx_smp_init();
+
+       fsl_pci_assign_primary();
+
+       swiotlb_detect_4g();
+
+       pr_info("MEN NM50 Mobile Wireless LAN Access Point\n");
+}
+
+machine_arch_initcall(men_nm50, mpc85xx_common_publish_devices);
+machine_arch_initcall(men_nm50, swiotlb_setup_bus_notifier);
+
+/**
+ * Initial probe of hardware
+ *
+ * Called very early, device-tree isn't unflattened
+ */
+static int __init men_nm50_probe(void)
+{
+       unsigned long root = of_get_flat_dt_root();
+
+       return of_flat_dt_is_compatible(root, "men,nm50");
+}
+
+define_machine(men_nm50) {
+       .name = "MEN NM50",
+       .probe = men_nm50_probe,
+       .setup_arch = men_nm50_setup_arch,
+       .init_IRQ = men_nm50_pic_init,
+#ifdef CONFIG_PCI
+       .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
+#endif
+       .get_irq = mpic_get_irq,
+       .restart = fsl_rstcr_restart,
+       .calibrate_decr = generic_calibrate_decr,
+       .progress = udbg_progress,
+};
diff --git 
a/target/linux/mpc85xx/patches-3.18/230-powerpc-85xx-men-nm50-support.patch 
b/target/linux/mpc85xx/patches-3.18/230-powerpc-85xx-men-nm50-support.patch
new file mode 100644
index 0000000..1104051
--- /dev/null
+++ b/target/linux/mpc85xx/patches-3.18/230-powerpc-85xx-men-nm50-support.patch
@@ -0,0 +1,22 @@
+--- a/arch/powerpc/platforms/85xx/Makefile
++++ b/arch/powerpc/platforms/85xx/Makefile
+@@ -31,3 +31,4 @@ obj-$(CONFIG_XES_MPC85xx) += xes_mpc85xx
+ obj-$(CONFIG_GE_IMP3A)          += ge_imp3a.o
+ obj-$(CONFIG_PPC_QEMU_E500) += qemu_e500.o
+ obj-$(CONFIG_SGY_CTS1000) += sgy_cts1000.o
++obj-$(CONFIG_MEN_NM50)    += men_nm50.o
+--- a/arch/powerpc/platforms/85xx/Kconfig
++++ b/arch/powerpc/platforms/85xx/Kconfig
+@@ -241,6 +241,12 @@ config SGY_CTS1000
+       help
+         Enable this to support functionality in Servergy's CTS-1000 systems.
+ 
++config MEN_NM50
++      bool "MEN NM50"
++      select DEFAULT_UIMAGE
++      help
++        This option enables support for the MEN NM50 Mobile Wireless LAN 
Access Point.
++
+ endif # PPC32
+ 
+ config PPC_QEMU_E500
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to