From 02831df79ad9a8d0f35c7c007aa789603d7cdb4a Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 11 Mar 2019 17:37:24 +0800 Subject: [PATCH] bcm53xx: add usb3.0 support for PHICOMM K3 --- target/linux/bcm53xx/Makefile | 4 +- .../bcm53xx/base-files/etc/board.d/02_network | 4 +- .../base-files/lib/upgrade/platform.sh | 4 +- target/linux/bcm53xx/image/Makefile | 13 ++- ...BCM5301X-Add-basic-DT-for-PHICOMM-K3.patch | 50 -------- ...-Relicense-Luxul-files-to-the-GPL-2..patch | 41 +++++++ ...BCM5301X-Add-basic-DT-for-Phicomm-K3.patch | 107 ++++++++++++++++++ ...-BCM5301X-Add-serial-to-the-bootargs.patch | 17 ++- ...add-partition-workaround-for-PHICOMM.patch | 19 ---- ...-Relicense-Luxul-files-to-the-GPL-2..patch | 41 +++++++ ...BCM5301X-Add-basic-DT-for-Phicomm-K3.patch | 107 ++++++++++++++++++ ...BCM5301X-Add-basic-DT-for-PHICOMM-K3.patch | 50 -------- ...-BCM5301X-Add-serial-to-the-bootargs.patch | 17 ++- ...add-partition-workaround-for-PHICOMM.patch | 19 ---- 14 files changed, 341 insertions(+), 152 deletions(-) delete mode 100644 target/linux/bcm53xx/patches-4.14/036-0001-ARM-dts-BCM5301X-Add-basic-DT-for-PHICOMM-K3.patch create mode 100644 target/linux/bcm53xx/patches-4.14/036-v5.1-0001-ARM-dts-BCM53573-Relicense-Luxul-files-to-the-GPL-2..patch create mode 100644 target/linux/bcm53xx/patches-4.14/036-v5.1-0002-ARM-dts-BCM5301X-Add-basic-DT-for-Phicomm-K3.patch delete mode 100644 target/linux/bcm53xx/patches-4.14/901-mtd-bcm47xxpart-add-partition-workaround-for-PHICOMM.patch create mode 100644 target/linux/bcm53xx/patches-4.19/032-v5.1-0001-ARM-dts-BCM53573-Relicense-Luxul-files-to-the-GPL-2..patch create mode 100644 target/linux/bcm53xx/patches-4.19/032-v5.1-0002-ARM-dts-BCM5301X-Add-basic-DT-for-Phicomm-K3.patch delete mode 100644 target/linux/bcm53xx/patches-4.19/036-0001-ARM-dts-BCM5301X-Add-basic-DT-for-PHICOMM-K3.patch delete mode 100644 target/linux/bcm53xx/patches-4.19/901-mtd-bcm47xxpart-add-partition-workaround-for-PHICOMM.patch diff --git a/target/linux/bcm53xx/Makefile b/target/linux/bcm53xx/Makefile index 3463700ad..2af1c7e71 100644 --- a/target/linux/bcm53xx/Makefile +++ b/target/linux/bcm53xx/Makefile @@ -13,7 +13,7 @@ FEATURES:=squashfs nand usb pci pcie gpio MAINTAINER:=Hauke Mehrtens CPU_TYPE:=cortex-a9 -KERNEL_PATCHVER:=4.19 +KERNEL_PATCHVER:=4.14 define Target/Description Build firmware images for Broadcom based BCM47xx/53xx routers with ARM CPU, *not* MIPS. @@ -26,6 +26,6 @@ KERNELNAME:=zImage dtbs DEFAULT_PACKAGES += swconfig nvram \ osafeloader oseama otrx \ kmod-gpio-button-hotplug \ - kmod-leds-gpio kmod-ledtrig-default-on kmod-ledtrig-timer ntfs-3g + kmod-leds-gpio kmod-ledtrig-default-on kmod-ledtrig-timer $(eval $(call BuildTarget)) diff --git a/target/linux/bcm53xx/base-files/etc/board.d/02_network b/target/linux/bcm53xx/base-files/etc/board.d/02_network index 7efcd542e..8c9e8b3f3 100755 --- a/target/linux/bcm53xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm53xx/base-files/etc/board.d/02_network @@ -26,10 +26,10 @@ buffalo,wzr-1750dhp) ;; phicomm,k3) ucidef_add_switch "switch0" \ - "0:lan:2" "1:lan:1" "2:lan:3" "3:wan:4" "5t@eth0" + "0:lan" "1:lan" "2:lan" "3:wan" "5@eth0" board_config_flush exit 0 - ;; + ;; esac wan_macaddr="$(nvram get wan_hwaddr)" diff --git a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh index 16285aaa0..5a42a36ae 100644 --- a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh @@ -206,7 +206,7 @@ platform_pre_upgrade_trx() { } # Flash - mtd write /tmp/kernel.trx firmware + mtd write /tmp/kernel.trx firmware || exit 1 nand_do_upgrade /tmp/root.ubi } @@ -252,7 +252,7 @@ platform_pre_upgrade_seama() { # Flash local kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"\(kernel\|linux\)".*/\1/p' /proc/mtd) - mtd write $dir/kernel.seama firmware + mtd write $dir/kernel.seama firmware || exit 1 mtd ${kernel_size:+-c 0x$kernel_size} fixseama firmware nand_do_upgrade $dir/root.ubi } diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index e701b4295..3d16c1d65 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -103,11 +103,11 @@ endef DEVICE_VARS += PRODUCTID SIGNATURE NETGEAR_BOARD_ID NETGEAR_REGION TPLINK_BOARD DEVICE_VARS += BUFFALO_TAG_PLATFORM BUFFALO_TAG_VERSION BUFFALO_TAG_MINOR -IEEE8021X := wpad-mini +IEEE8021X := wpad-basic B43 := $(IEEE8021X) kmod-b43 BRCMFMAC_43602A1 := $(IEEE8021X) kmod-brcmfmac brcmfmac-firmware-43602a1-pcie BRCMFMAC_4366B1 := $(IEEE8021X) kmod-brcmfmac brcmfmac-firmware-4366b1-pcie -BRCMFMAC_4366C0 := $(IEEE8021X) kmod-brcmfmac +BRCMFMAC_4366C0 := $(IEEE8021X) kmod-brcmfmac k3wifi USB2_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-phy-bcm-ns-usb2 USB2_PACKAGES += kmod-usb-ledtrig-usbport USB3_PACKAGES := $(USB2_PACKAGES) kmod-usb3 kmod-phy-bcm-ns-usb3 @@ -224,13 +224,18 @@ endef TARGET_DEVICES += dlink-dir-885l # Linksys devices are disabled due to problem with 2 TRX partitions - define Device/linksys-ea6300-v1 DEVICE_TITLE := Linksys EA6300 V1 DEVICE_PACKAGES := $(B43) $(USB3_PACKAGES) endef # TARGET_DEVICES += linksys-ea6300-v1 +define Device/linksys-ea6500-v2 + DEVICE_TITLE := Linksys EA6500 V2 + DEVICE_PACKAGES := $(B43) $(USB3_PACKAGES) +endef +TARGET_DEVICES += linksys-ea6500-v2 + define Device/linksys-ea9200 DEVICE_TITLE := Linksys EA9200 V1 DEVICE_PACKAGES := $(BRCMFMAC_43602A1) $(USB3_PACKAGES) @@ -310,7 +315,7 @@ TARGET_DEVICES += smartrg-sr400ac define Device/phicomm-k3 DEVICE_TITLE := PHICOMM K3 - DEVICE_PACKAGES := $(BRCMFMAC_4366C0) $(USB3_PACKAGES) k3wifi k3screenctrl + DEVICE_PACKAGES := $(BRCMFMAC_4366C0) $(USB3_PACKAGES) k3screenctrl IMAGES := trx endef TARGET_DEVICES += phicomm-k3 diff --git a/target/linux/bcm53xx/patches-4.14/036-0001-ARM-dts-BCM5301X-Add-basic-DT-for-PHICOMM-K3.patch b/target/linux/bcm53xx/patches-4.14/036-0001-ARM-dts-BCM5301X-Add-basic-DT-for-PHICOMM-K3.patch deleted file mode 100644 index 1fc6c0442..000000000 --- a/target/linux/bcm53xx/patches-4.14/036-0001-ARM-dts-BCM5301X-Add-basic-DT-for-PHICOMM-K3.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -105,6 +105,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ - bcm47094-luxul-xbr-4500.dtb \ - bcm47094-luxul-xwr-3100.dtb \ - bcm47094-netgear-r8500.dtb \ -+ bcm47094-phicomm-k3.dtb \ - bcm94708.dtb \ - bcm94709.dtb \ - bcm953012er.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/bcm47094-phicomm-k3.dts -@@ -0,0 +1,37 @@ -+/* -+* Copyright (C) 2017 Hamster Tian -+*/ -+ -+/dts-v1/; -+ -+#include "bcm47094.dtsi" -+#include "bcm5301x-nand-cs0-bch4.dtsi" -+ -+/ { -+ compatible = "phicomm,k3", "brcm,bcm47094", "brcm,bcm4708"; -+ model = "PHICOMM K3"; -+ -+ chosen { -+ bootargs = "console=ttyS0,115200"; -+ }; -+ memory { -+ reg = <0x00000000 0x08000000 -+ 0x88000000 0x18000000>; -+ }; -+ -+ gpio-keys { -+ compatible = "gpio-keys"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ restart { -+ label = "Reset"; -+ linux,code = ; -+ gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; -+ -+&uart1 { -+ status = "okay"; -+}; diff --git a/target/linux/bcm53xx/patches-4.14/036-v5.1-0001-ARM-dts-BCM53573-Relicense-Luxul-files-to-the-GPL-2..patch b/target/linux/bcm53xx/patches-4.14/036-v5.1-0001-ARM-dts-BCM53573-Relicense-Luxul-files-to-the-GPL-2..patch new file mode 100644 index 000000000..5883577d5 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.14/036-v5.1-0001-ARM-dts-BCM53573-Relicense-Luxul-files-to-the-GPL-2..patch @@ -0,0 +1,41 @@ +From b7f264fa496eb2a6dd1d67dc91dbe8ffcb142487 Mon Sep 17 00:00:00 2001 +From: Dan Haab +Date: Sun, 2 Dec 2018 17:00:15 -0700 +Subject: [PATCH] ARM: dts: BCM53573: Relicense Luxul files to the GPL 2.0+ / + MIT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This matches licensing used by other BCM53573 files and BCM5301X. + +Signed-off-by: Dan Haab +Acked-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts | 3 +-- + arch/arm/boot/dts/bcm47189-luxul-xap-810.dts | 3 +-- + 2 files changed, 2 insertions(+), 4 deletions(-) + +--- a/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts ++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts +@@ -1,7 +1,6 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /* + * Copyright 2017 Luxul Inc. +- * +- * Licensed under the ISC license. + */ + + /dts-v1/; +--- a/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts ++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts +@@ -1,7 +1,6 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /* + * Copyright 2017 Luxul Inc. +- * +- * Licensed under the ISC license. + */ + + /dts-v1/; diff --git a/target/linux/bcm53xx/patches-4.14/036-v5.1-0002-ARM-dts-BCM5301X-Add-basic-DT-for-Phicomm-K3.patch b/target/linux/bcm53xx/patches-4.14/036-v5.1-0002-ARM-dts-BCM5301X-Add-basic-DT-for-Phicomm-K3.patch new file mode 100644 index 000000000..d77dedbac --- /dev/null +++ b/target/linux/bcm53xx/patches-4.14/036-v5.1-0002-ARM-dts-BCM5301X-Add-basic-DT-for-Phicomm-K3.patch @@ -0,0 +1,107 @@ +From 40a17923367118e32e5e413a952736dd83635b32 Mon Sep 17 00:00:00 2001 +From: Hao Dong +Date: Sun, 20 Jan 2019 23:33:27 +0100 +Subject: [PATCH] ARM: dts: BCM5301X: Add basic DT for Phicomm K3 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This router has BCM4709C0 SoC, 128 MiB NAND flash (MX30LF1G18AC-TI), +512 MiB memory and 3 x LAN and 1 x WAN ports. WiFi chips are +BCM4366C0 x 2. The router has a small LCD and 3 capactive keys driven by +a PIC microcontroller, which is in turn wired to UART1 of main board. + +Signed-off-by: Hao Dong +[rmilecki: drop chosen { }, fix whitespaces, update commit message] +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/bcm47094-phicomm-k3.dts | 71 +++++++++++++++++++++++ + 2 files changed, 72 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm47094-phicomm-k3.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -108,6 +108,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm47094-luxul-xwr-3100.dtb \ + bcm47094-luxul-xwr-3150-v1.dtb \ + bcm47094-netgear-r8500.dtb \ ++ bcm47094-phicomm-k3.dtb \ + bcm94708.dtb \ + bcm94709.dtb \ + bcm953012er.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm47094-phicomm-k3.dts +@@ -0,0 +1,71 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Copyright (C) 2017 Hamster Tian ++ * Copyright (C) 2019 Hao Dong ++ */ ++ ++/dts-v1/; ++ ++#include "bcm47094.dtsi" ++#include "bcm5301x-nand-cs0-bch4.dtsi" ++ ++/ { ++ compatible = "phicomm,k3", "brcm,bcm47094", "brcm,bcm4708"; ++ model = "Phicomm K3"; ++ ++ memory { ++ reg = <0x00000000 0x08000000 ++ 0x88000000 0x18000000>; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ restart { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&uart1 { ++ status = "okay"; ++}; ++ ++&usb3_phy { ++ status = "okay"; ++}; ++ ++&nandcs { ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "boot"; ++ reg = <0x0000000 0x0080000>; ++ read-only; ++ }; ++ ++ partition@80000 { ++ label = "nvram"; ++ reg = <0x0080000 0x0100000>; ++ }; ++ ++ partition@180000{ ++ label = "phicomm"; ++ reg = <0x0180000 0x0280000>; ++ read-only; ++ }; ++ ++ partition@400000 { ++ label = "firmware"; ++ reg = <0x0400000 0x7C00000>; ++ compatible = "brcm,trx"; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-4.14/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch b/target/linux/bcm53xx/patches-4.14/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch index dc5faf2d2..65f9a5290 100644 --- a/target/linux/bcm53xx/patches-4.14/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch +++ b/target/linux/bcm53xx/patches-4.14/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch @@ -48,7 +48,7 @@ Signed-off-by: Rafał Miłecki memory { --- a/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts +++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts -@@ -13,7 +13,7 @@ +@@ -12,7 +12,7 @@ model = "Luxul XAP-1440 V1"; chosen { @@ -59,7 +59,7 @@ Signed-off-by: Rafał Miłecki memory { --- a/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts +++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts -@@ -13,7 +13,7 @@ +@@ -12,7 +12,7 @@ model = "Luxul XAP-810 V1"; chosen { @@ -90,3 +90,16 @@ Signed-off-by: Rafał Miłecki }; memory { +--- a/arch/arm/boot/dts/bcm47094-phicomm-k3.dts ++++ b/arch/arm/boot/dts/bcm47094-phicomm-k3.dts +@@ -13,6 +13,10 @@ + compatible = "phicomm,k3", "brcm,bcm47094", "brcm,bcm4708"; + model = "Phicomm K3"; + ++ chosen { ++ bootargs = "console=ttyS0,115200"; ++ }; ++ + memory { + reg = <0x00000000 0x08000000 + 0x88000000 0x18000000>; diff --git a/target/linux/bcm53xx/patches-4.14/901-mtd-bcm47xxpart-add-partition-workaround-for-PHICOMM.patch b/target/linux/bcm53xx/patches-4.14/901-mtd-bcm47xxpart-add-partition-workaround-for-PHICOMM.patch deleted file mode 100644 index 501d4a329..000000000 --- a/target/linux/bcm53xx/patches-4.14/901-mtd-bcm47xxpart-add-partition-workaround-for-PHICOMM.patch +++ /dev/null @@ -1,19 +0,0 @@ -Index: linux-4.14.29/drivers/mtd/bcm47xxpart.c -=================================================================== ---- linux-4.14.29.orig/drivers/mtd/bcm47xxpart.c -+++ linux-4.14.29/drivers/mtd/bcm47xxpart.c -@@ -163,6 +163,14 @@ static int bcm47xxpart_parse(struct mtd_ - */ - bcm47xxpart_add_part(&parts[curr_part++], "tplink", offset, MTD_WRITEABLE); - continue; -+ } else if (of_machine_is_compatible("phicomm,k3") && offset == 0x180000) { -+ /* -+ * This device has nvram_back, res_info, pro_info and dev_info from -+ * 0x180000 (end of nvram) to 0x400000 (start of linux). These partitions -+ * has essential information for original firwamre. We do not want these. -+ */ -+ bcm47xxpart_add_part(&parts[curr_part++], "phicomm", offset, MTD_WRITEABLE); -+ continue; - } - - /* Read beginning of the block */ diff --git a/target/linux/bcm53xx/patches-4.19/032-v5.1-0001-ARM-dts-BCM53573-Relicense-Luxul-files-to-the-GPL-2..patch b/target/linux/bcm53xx/patches-4.19/032-v5.1-0001-ARM-dts-BCM53573-Relicense-Luxul-files-to-the-GPL-2..patch new file mode 100644 index 000000000..5883577d5 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.19/032-v5.1-0001-ARM-dts-BCM53573-Relicense-Luxul-files-to-the-GPL-2..patch @@ -0,0 +1,41 @@ +From b7f264fa496eb2a6dd1d67dc91dbe8ffcb142487 Mon Sep 17 00:00:00 2001 +From: Dan Haab +Date: Sun, 2 Dec 2018 17:00:15 -0700 +Subject: [PATCH] ARM: dts: BCM53573: Relicense Luxul files to the GPL 2.0+ / + MIT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This matches licensing used by other BCM53573 files and BCM5301X. + +Signed-off-by: Dan Haab +Acked-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts | 3 +-- + arch/arm/boot/dts/bcm47189-luxul-xap-810.dts | 3 +-- + 2 files changed, 2 insertions(+), 4 deletions(-) + +--- a/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts ++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts +@@ -1,7 +1,6 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /* + * Copyright 2017 Luxul Inc. +- * +- * Licensed under the ISC license. + */ + + /dts-v1/; +--- a/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts ++++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts +@@ -1,7 +1,6 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /* + * Copyright 2017 Luxul Inc. +- * +- * Licensed under the ISC license. + */ + + /dts-v1/; diff --git a/target/linux/bcm53xx/patches-4.19/032-v5.1-0002-ARM-dts-BCM5301X-Add-basic-DT-for-Phicomm-K3.patch b/target/linux/bcm53xx/patches-4.19/032-v5.1-0002-ARM-dts-BCM5301X-Add-basic-DT-for-Phicomm-K3.patch new file mode 100644 index 000000000..3702dac41 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.19/032-v5.1-0002-ARM-dts-BCM5301X-Add-basic-DT-for-Phicomm-K3.patch @@ -0,0 +1,107 @@ +From 40a17923367118e32e5e413a952736dd83635b32 Mon Sep 17 00:00:00 2001 +From: Hao Dong +Date: Sun, 20 Jan 2019 23:33:27 +0100 +Subject: [PATCH] ARM: dts: BCM5301X: Add basic DT for Phicomm K3 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This router has BCM4709C0 SoC, 128 MiB NAND flash (MX30LF1G18AC-TI), +512 MiB memory and 3 x LAN and 1 x WAN ports. WiFi chips are +BCM4366C0 x 2. The router has a small LCD and 3 capactive keys driven by +a PIC microcontroller, which is in turn wired to UART1 of main board. + +Signed-off-by: Hao Dong +[rmilecki: drop chosen { }, fix whitespaces, update commit message] +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/bcm47094-phicomm-k3.dts | 71 +++++++++++++++++++++++ + 2 files changed, 72 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm47094-phicomm-k3.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -114,6 +114,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm47094-luxul-xwr-3100.dtb \ + bcm47094-luxul-xwr-3150-v1.dtb \ + bcm47094-netgear-r8500.dtb \ ++ bcm47094-phicomm-k3.dtb \ + bcm94708.dtb \ + bcm94709.dtb \ + bcm953012er.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm47094-phicomm-k3.dts +@@ -0,0 +1,71 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Copyright (C) 2017 Hamster Tian ++ * Copyright (C) 2019 Hao Dong ++ */ ++ ++/dts-v1/; ++ ++#include "bcm47094.dtsi" ++#include "bcm5301x-nand-cs0-bch4.dtsi" ++ ++/ { ++ compatible = "phicomm,k3", "brcm,bcm47094", "brcm,bcm4708"; ++ model = "Phicomm K3"; ++ ++ memory { ++ reg = <0x00000000 0x08000000 ++ 0x88000000 0x18000000>; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ restart { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&uart1 { ++ status = "okay"; ++}; ++ ++&usb3_phy { ++ status = "okay"; ++}; ++ ++&nandcs { ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "boot"; ++ reg = <0x0000000 0x0080000>; ++ read-only; ++ }; ++ ++ partition@80000 { ++ label = "nvram"; ++ reg = <0x0080000 0x0100000>; ++ }; ++ ++ partition@180000{ ++ label = "phicomm"; ++ reg = <0x0180000 0x0280000>; ++ read-only; ++ }; ++ ++ partition@400000 { ++ label = "firmware"; ++ reg = <0x0400000 0x7C00000>; ++ compatible = "brcm,trx"; ++ }; ++ }; ++}; diff --git a/target/linux/bcm53xx/patches-4.19/036-0001-ARM-dts-BCM5301X-Add-basic-DT-for-PHICOMM-K3.patch b/target/linux/bcm53xx/patches-4.19/036-0001-ARM-dts-BCM5301X-Add-basic-DT-for-PHICOMM-K3.patch deleted file mode 100644 index 1fc6c0442..000000000 --- a/target/linux/bcm53xx/patches-4.19/036-0001-ARM-dts-BCM5301X-Add-basic-DT-for-PHICOMM-K3.patch +++ /dev/null @@ -1,50 +0,0 @@ ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -105,6 +105,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ - bcm47094-luxul-xbr-4500.dtb \ - bcm47094-luxul-xwr-3100.dtb \ - bcm47094-netgear-r8500.dtb \ -+ bcm47094-phicomm-k3.dtb \ - bcm94708.dtb \ - bcm94709.dtb \ - bcm953012er.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/bcm47094-phicomm-k3.dts -@@ -0,0 +1,37 @@ -+/* -+* Copyright (C) 2017 Hamster Tian -+*/ -+ -+/dts-v1/; -+ -+#include "bcm47094.dtsi" -+#include "bcm5301x-nand-cs0-bch4.dtsi" -+ -+/ { -+ compatible = "phicomm,k3", "brcm,bcm47094", "brcm,bcm4708"; -+ model = "PHICOMM K3"; -+ -+ chosen { -+ bootargs = "console=ttyS0,115200"; -+ }; -+ memory { -+ reg = <0x00000000 0x08000000 -+ 0x88000000 0x18000000>; -+ }; -+ -+ gpio-keys { -+ compatible = "gpio-keys"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ restart { -+ label = "Reset"; -+ linux,code = ; -+ gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; -+ -+&uart1 { -+ status = "okay"; -+}; diff --git a/target/linux/bcm53xx/patches-4.19/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch b/target/linux/bcm53xx/patches-4.19/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch index dc5faf2d2..65f9a5290 100644 --- a/target/linux/bcm53xx/patches-4.19/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch +++ b/target/linux/bcm53xx/patches-4.19/320-ARM-dts-BCM5301X-Add-serial-to-the-bootargs.patch @@ -48,7 +48,7 @@ Signed-off-by: Rafał Miłecki memory { --- a/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts +++ b/arch/arm/boot/dts/bcm47189-luxul-xap-1440.dts -@@ -13,7 +13,7 @@ +@@ -12,7 +12,7 @@ model = "Luxul XAP-1440 V1"; chosen { @@ -59,7 +59,7 @@ Signed-off-by: Rafał Miłecki memory { --- a/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts +++ b/arch/arm/boot/dts/bcm47189-luxul-xap-810.dts -@@ -13,7 +13,7 @@ +@@ -12,7 +12,7 @@ model = "Luxul XAP-810 V1"; chosen { @@ -90,3 +90,16 @@ Signed-off-by: Rafał Miłecki }; memory { +--- a/arch/arm/boot/dts/bcm47094-phicomm-k3.dts ++++ b/arch/arm/boot/dts/bcm47094-phicomm-k3.dts +@@ -13,6 +13,10 @@ + compatible = "phicomm,k3", "brcm,bcm47094", "brcm,bcm4708"; + model = "Phicomm K3"; + ++ chosen { ++ bootargs = "console=ttyS0,115200"; ++ }; ++ + memory { + reg = <0x00000000 0x08000000 + 0x88000000 0x18000000>; diff --git a/target/linux/bcm53xx/patches-4.19/901-mtd-bcm47xxpart-add-partition-workaround-for-PHICOMM.patch b/target/linux/bcm53xx/patches-4.19/901-mtd-bcm47xxpart-add-partition-workaround-for-PHICOMM.patch deleted file mode 100644 index 501d4a329..000000000 --- a/target/linux/bcm53xx/patches-4.19/901-mtd-bcm47xxpart-add-partition-workaround-for-PHICOMM.patch +++ /dev/null @@ -1,19 +0,0 @@ -Index: linux-4.14.29/drivers/mtd/bcm47xxpart.c -=================================================================== ---- linux-4.14.29.orig/drivers/mtd/bcm47xxpart.c -+++ linux-4.14.29/drivers/mtd/bcm47xxpart.c -@@ -163,6 +163,14 @@ static int bcm47xxpart_parse(struct mtd_ - */ - bcm47xxpart_add_part(&parts[curr_part++], "tplink", offset, MTD_WRITEABLE); - continue; -+ } else if (of_machine_is_compatible("phicomm,k3") && offset == 0x180000) { -+ /* -+ * This device has nvram_back, res_info, pro_info and dev_info from -+ * 0x180000 (end of nvram) to 0x400000 (start of linux). These partitions -+ * has essential information for original firwamre. We do not want these. -+ */ -+ bcm47xxpart_add_part(&parts[curr_part++], "phicomm", offset, MTD_WRITEABLE); -+ continue; - } - - /* Read beginning of the block */ -- GitLab