From 68d3863af2a100f0d2d7782f938bfc8b01b146fa Mon Sep 17 00:00:00 2001 From: Martin Kennedy Date: Thu, 13 Jan 2022 17:42:15 -0500 Subject: [PATCH] mpc85xx: Add support for Adtran BlueSocket AP-2030 Argle bargle diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/bsap-2030.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/bsap-2030.dts new file mode 100644 index 0000000000..bd437014db --- /dev/null +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/bsap-2030.dts @@ -0,0 +1,179 @@ +// SPDX-License-Identifier: GPL-2.0-or-later or MIT +/include/ "fsl/p1010si-pre.dtsi" + +/ { + model = "Adtran BlueSocket AP-2030"; + compatible = "adtran,bsap-2030"; + + chosen { + bootargs-override = "console=ttyS0,115200"; + }; + + aliases { + ethernet0 = "/soc@ffe00000/ethernet@b0000"; + ethernet1 = "/soc@ffe00000/ethernet@b1000"; + led-boot = &system_green; + led-failsafe = &system_green; + led-running = &system_green; + led-upgrade = &system_green; + label-mac-device = &enet0; + }; + + memory { + device_type = "memory"; + }; + + soc: soc@ffe00000 { + ranges = <0x0 0x0 0xffe00000 0x100000>; + + spi0: spi@7000 { + cell-index = <0x00>; + #address-cells = <0x01>; + #size-cells = <0x00>; + compatible = "fsl,espi"; + reg = <0x7000 0x1000>; + interrupts = <0x3b 0x02>; + interrupt-parent = <0x02>; + espi,num-ss-bits = <0x04>; + mode = "cpu"; + fsl,espi-num-chipselects = <0x01>; + + flash@0 { + compatible = "spansion,s25fl512s"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x4000000>; + label = "u-boot"; + read-only; + }; + }; + }; + }; + + gpio-controller@f000 { + #gpio-cells = <0x02>; + compatible = "fsl,mpc8572-gpio"; + reg = <0xf000 0x100>; + interrupts = <0x2f 0x02>; + interrupt-parent = <0x02>; + gpio-controller; + }; + + usb@22000 { + phy_type = "utmi"; + dr_mode = "host"; + }; + + mdio@24000 { + phy0: ethernet-phy@0 { + interrupts = <0x03 0x01>; + reg = <0x01>; + }; + + phy1: ethernet-phy@1 { + interrupts = <0x02 0x01>; + reg = <0x02>; + }; + }; + + mdio@25000 { + status = "disabled"; + }; + + mdio@26000 { + status = "disabled"; + }; + + enet0: ethernet@b0000 { + phy-handle = <&phy0>; + phy-connection-type = "rgmii-id"; + }; + + enet1: ethernet@b1000 { + phy-handle = <&phy1>; + phy-connection-type = "rgmii-id"; + }; + + enet2: ethernet@b2000 { + status = "disabled"; + }; + + sdhc@2e000 { + status = "disabled"; + }; + + serial1: serial@4600 { + status = "disabled"; + }; + + can0: can@1c000 { + status = "disabled"; + }; + + can1: can@1d000 { + status = "disabled"; + }; + + ptp_clock@b0e00 { + compatible = "fsl,etsec-ptp"; + reg = <0xb0e00 0xb0>; + interrupts = <68 2 0 0 69 2 0 0 70 2 0 0>; + fsl,cksel = <1>; + fsl,tclk-period = <5>; + fsl,tmr-prsc = <2>; + fsl,tmr-add = <0xcccccccd>; + fsl,tmr-fiper1 = <0x3b9ac9fb>; /* 1PPS */ + fsl,tmr-fiper2 = <0x00018696>; + fsl,max-adj = <249999999>; + }; + }; + + pci0: pcie@ffe09000 { + reg = <0 0xffe09000 0 0x1000>; + ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 + 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>; + 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>; + }; + }; + + /* buttons { */ + /* compatible = "gpio-keys"; */ + + /* reset { */ + /* label = "Reset button"; */ + /* gpios = <&gpio0 5 1>; /\* active low *\/ */ + /* linux,code = <0x198>; /\* KEY_RESTART *\/ */ + /* }; */ + /* }; */ +}; + +/include/ "fsl/p1010si-post.dtsi" diff --git a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/bsap-2030.c b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/bsap-2030.c new file mode 100644 index 0000000000..fb0b1c9d05 --- /dev/null +++ b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/bsap-2030.c @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +/* + * Adtran BlueSocket AP-2030 Board Setup + * + * Copyright (C) 2019 Martin Kennedy + * + * Based on: + * p1010rdb.c: + * P1010 RDB Board Setup + * Copyright 2011 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 +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "mpc85xx.h" + +void __init bsap_2030_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 bsap_2030_setup_arch(void) +{ + if (ppc_md.progress) + ppc_md.progress("bsap_2030_setup_arch()", 0); + + fsl_pci_assign_primary(); + + pr_info("BlueSocket AP-2030 from Adtran\n"); +} + +machine_arch_initcall(bsap_2030, mpc85xx_common_publish_devices); + +/* + * Called very early, device-tree isn't unflattened + */ +static int __init bsap_2030_probe(void) +{ + if (of_machine_is_compatible("adtran,bsap-2030")) + return 1; + return 0; +} + +define_machine(bsap_2030) { + .name = "P1010 RDB", + .probe = bsap_2030_probe, + .setup_arch = bsap_2030_setup_arch, + .init_IRQ = bsap_2030_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, +}; diff --git a/target/linux/mpc85xx/image/p1010.mk b/target/linux/mpc85xx/image/p1010.mk index 86ab53e355..52b57d34c7 100644 --- a/target/linux/mpc85xx/image/p1010.mk +++ b/target/linux/mpc85xx/image/p1010.mk @@ -35,3 +35,14 @@ define Device/sophos_red-15w-rev1 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef TARGET_DEVICES += sophos_red-15w-rev1 + +define Device/adtran_bsap-2030 + DEVICE_VENDOR := Adtran + DEVICE_MODEL := BlueSocket AP-2030 + # Original firmware uses a dedicated DTB-partition. + # The bootloader however supports FIT-images. + KERNEL = kernel-bin | lzma | fit lzma $(KDIR)/image-$$(DEVICE_DTS).dtb + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += adtran_bsap-2030 diff --git a/target/linux/mpc85xx/patches-5.10/107-powerpc-85xx-add-support-for-the-Adtran-BlueSocket-A.patch b/target/linux/mpc85xx/patches-5.10/107-powerpc-85xx-add-support-for-the-Adtran-BlueSocket-A.patch new file mode 100644 index 0000000000..867269041c --- /dev/null +++ b/target/linux/mpc85xx/patches-5.10/107-powerpc-85xx-add-support-for-the-Adtran-BlueSocket-A.patch @@ -0,0 +1,43 @@ +From a116308ea302b16d0a4d39792c79358c8fc39b16 Mon Sep 17 00:00:00 2001 +From: Martin Kennedy +Date: Thu, 13 Jan 2022 17:48:53 -0500 +Subject: [PATCH] powerpc: 85xx: add support for the Adtran BlueSocket AP-2030 + + +diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig +index 764b916..03e016f 100644 +--- a/arch/powerpc/platforms/85xx/Kconfig ++++ b/arch/powerpc/platforms/85xx/Kconfig +@@ -25,6 +25,17 @@ config FSL_85XX_CACHE_SRAM + cache-sram-size and cache-sram-offset kernel boot + parameters should be passed when this option is enabled. + ++config BSAP_2030 ++ bool "Adtran BlueSocket AP-2030" ++ select DEFAULT_UIMAGE ++ select ARCH_REQUIRE_GPIOLIB ++ select GPIO_MPC8XXX ++ help ++ This option enables support for the Adtran BSAP-2030 board. ++ ++ This board is a Concurrent Dual-Band wireless access point with a ++ Freescale P1010E SoC. ++ + config BSC9131_RDB + bool "Freescale BSC9131RDB" + select DEFAULT_UIMAGE +diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile +index 443b44b..f34b8f2 100644 +--- a/arch/powerpc/platforms/85xx/Makefile ++++ b/arch/powerpc/platforms/85xx/Makefile +@@ -9,6 +9,7 @@ endif + + obj-y += common.o + ++obj-$(CONFIG_BSAP_2030) += bsap-2030.o + obj-$(CONFIG_BSC9131_RDB) += bsc913x_rdb.o + obj-$(CONFIG_BSC9132_QDS) += bsc913x_qds.o + obj-$(CONFIG_C293_PCIE) += c293pcie.o +-- +2.25.1 + -- 2.25.1