aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mpc85xx/files
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/mpc85xx/files')
-rw-r--r--target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts264
-rw-r--r--target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/panda.c91
2 files changed, 355 insertions, 0 deletions
diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts
new file mode 100644
index 0000000000..1dcaa7d296
--- /dev/null
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts
@@ -0,0 +1,264 @@
+// SPDX-License-Identifier: GPL-2.0-or-later or MIT
+
+/include/ "fsl/p1020si-pre.dtsi"
+/ {
+ model = "OCEDO Panda";
+ compatible = "ocedo,panda";
+
+ aliases {
+ led-boot = &system_blue;
+ led-failsafe = &system_blue;
+ led-running = &system_blue;
+ led-upgrade = &system_blue;
+ };
+
+ chosen {
+ /* Needed for initramfs */
+ bootargs-override = "console=ttyS0,115200 ubi.mtd=3,2048";
+ };
+
+ memory {
+ device_type = "memory";
+ };
+
+ lbc: localbus@ffe05000 {
+ reg = <0 0xffe05000 0 0x1000>;
+ ranges = <0x0 0x0 0x0 0xec000000 0x04000000
+ 0x1 0x0 0x0 0xff800000 0x00040000
+ 0x2 0x0 0x0 0xffa00000 0x00020000
+ 0x3 0x0 0x0 0xffb00000 0x00020000>;
+
+ nand@1,0 {
+ compatible = "fsl,p1020-fcm-nand", "fsl,elbc-fcm-nand";
+ reg = <0x1 0x0 0x40000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ reg = <0x0 0xa0000>;
+ label = "uboot";
+ read-only;
+ };
+
+ partition@a0000 {
+ reg = <0xa0000 0x20000>;
+ label = "uboot-env0";
+ };
+
+ partition@c0000 {
+ reg = <0xc0000 0x40000>;
+ label = "uboot-env1";
+ };
+
+ partition@100000 {
+ reg = <0x100000 0xff00000>;
+ label = "ubi";
+ };
+ };
+ };
+ };
+
+ soc: soc@ffe00000 {
+ ranges = <0x0 0x0 0xffe00000 0x100000>;
+
+ i2c@3000 {
+ rtc@68 {
+ compatible = "dallas,ds1339";
+ reg = <0x68>;
+ };
+ };
+
+ gpio0: gpio-controller@fc00 {
+ };
+
+ mdio@24000 {
+ phy0: ethernet-phy@8 {
+ reg = <0x8>;
+ };
+
+ phy1: ethernet-phy@9 {
+ reg = <0x9>;
+ };
+
+ switch0: ethernet-phy@0 {
+ reg = <0x0>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ label = "lan1";
+ };
+
+ port@1 {
+ reg = <1>;
+ label = "lan2";
+ };
+
+ port@2 {
+ reg = <2>;
+ label = "lan3";
+ };
+
+ port@3 {
+ reg = <3>;
+ label = "lan4";
+ };
+
+ port@4 {
+ reg = <4>;
+ label = "lan5";
+ };
+
+ port@5 {
+ reg = <5>;
+ label = "lan6";
+ };
+
+ port@6 {
+ reg = <6>;
+ label = "lan7";
+ };
+
+ port@7 {
+ reg = <7>;
+ label = "lan8";
+ };
+
+ port@8 {
+ reg = <8>;
+ label = "cpu";
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+ };
+ };
+ };
+
+ mdio@25000 {
+ tbi_phy0: tbi-phy@11 {
+ reg = <0x11>;
+ };
+ };
+
+ mdio@26000 {
+ tbi_phy1: tbi-phy@11 {
+ reg = <0x11>;
+ };
+ };
+
+ enet0: ethernet@b0000 {
+ phy-connection-type = "rgmii-id";
+ phy-handle = <&switch0>;
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+
+ enet1: ethernet@b1000 {
+ phy-connection-type = "sgmii";
+ phy-handle = <&phy0>;
+
+ tbi-handle = <&tbi_phy0>;
+ };
+
+ enet2: ethernet@b2000 {
+ phy-connection-type = "sgmii";
+ phy-handle = <&phy1>;
+
+ tbi-handle = <&tbi_phy1>;
+ };
+
+ usb@22000 {
+ phy_type = "ulpi";
+ dr_mode = "host";
+ };
+
+ usb@23000 {
+ status = "disabled";
+ };
+ };
+
+ pci0: pcie@ffe09000 {
+ ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000
+ 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>;
+ reg = <0 0xffe09000 0 0x1000>;
+ pcie@0 {
+ ranges = <0x2000000 0x0 0xa0000000
+ 0x2000000 0x0 0xa0000000
+ 0x0 0x20000000
+
+ 0x1000000 0x0 0x0
+ 0x1000000 0x0 0x0
+ 0x0 0x100000>;
+ };
+ };
+
+ pci1: pcie@ffe0a000 {
+ reg = <0 0xffe0a000 0 0x1000>;
+ ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000
+ 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>;
+ pcie@0 {
+ ranges = <0x2000000 0x0 0x80000000
+ 0x2000000 0x0 0x80000000
+ 0x0 0x20000000
+
+ 0x1000000 0x0 0x0
+ 0x1000000 0x0 0x0
+ 0x0 0x100000>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ power {
+ gpios = <&gpio0 0 0>;
+ label = "panda:green:power";
+ default-state = "on";
+ };
+
+ wlan0 {
+ gpios = <&gpio0 1 0>;
+ label = "panda:yellow:wlan0";
+ linux,default-trigger = "phy0tpt";
+ };
+
+ wlan1 {
+ gpios = <&gpio0 2 0>;
+ label = "panda:red:wlan1";
+ linux,default-trigger = "phy1tpt";
+ };
+
+ tbd_orange {
+ gpios = <&gpio0 3 0>;
+ label = "panda:orange:tbd";
+ };
+
+ system_blue: system {
+ gpios = <&gpio0 4 0>;
+ label = "panda:blue:system";
+ };
+ };
+
+ buttons {
+ compatible = "gpio-keys";
+
+ reset {
+ label = "Reset button";
+ gpios = <&gpio0 6 1>;
+ linux,code = <0x198>;
+ };
+ };
+};
+/include/ "fsl/p1020si-post.dtsi"
diff --git a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/panda.c b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/panda.c
new file mode 100644
index 0000000000..9f17f20ffc
--- /dev/null
+++ b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/panda.c
@@ -0,0 +1,91 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/*
+ * OCEDO Panda Board Setup
+ *
+ * Copyright (C) 2019 David Bauer <mail@david-bauer.net>
+ *
+ * Based on:
+ * mpc85xx_rdb.c:
+ * MPC85xx RDB Board Setup
+ * Copyright 2013 Freescale Semiconductor Inc.
+ *
+ * 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.
+ */
+
+#include <linux/stddef.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/of_platform.h>
+
+#include <asm/time.h>
+#include <asm/machdep.h>
+#include <asm/pci-bridge.h>
+#include <mm/mmu_decl.h>
+#include <asm/prom.h>
+#include <asm/udbg.h>
+#include <asm/mpic.h>
+
+#include <sysdev/fsl_soc.h>
+#include <sysdev/fsl_pci.h>
+#include "smp.h"
+
+#include "mpc85xx.h"
+
+void __init panda_pic_init(void)
+{
+ struct mpic *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 panda_setup_arch(void)
+{
+ if (ppc_md.progress)
+ ppc_md.progress("panda_setup_arch()", 0);
+
+ mpc85xx_smp_init();
+
+ fsl_pci_assign_primary();
+
+ pr_info("Panda board from OCEDO\n");
+}
+
+machine_arch_initcall(panda, mpc85xx_common_publish_devices);
+
+/*
+ * Called very early, device-tree isn't unflattened
+ */
+static int __init panda_probe(void)
+{
+ if (of_machine_is_compatible("ocedo,panda"))
+ return 1;
+ return 0;
+}
+
+define_machine(panda) {
+ .name = "P1020 RDB",
+ .probe = panda_probe,
+ .setup_arch = panda_setup_arch,
+ .init_IRQ = panda_pic_init,
+#ifdef CONFIG_PCI
+ .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
+ .pcibios_fixup_phb = fsl_pcibios_fixup_phb,
+#endif
+ .get_irq = mpic_get_irq,
+ .calibrate_decr = generic_calibrate_decr,
+ .progress = udbg_progress,
+};