提交 02831df7 编写于 作者: C coolsnowwolf

bcm53xx: add usb3.0 support for PHICOMM K3

上级 7e119a32
......@@ -13,7 +13,7 @@ FEATURES:=squashfs nand usb pci pcie gpio
MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
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))
......@@ -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)"
......
......@@ -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
}
......
......@@ -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
......
--- 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 <haotia@gmail.com>
+*/
+
+/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 = <KEY_RESTART>;
+ gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
+ };
+ };
+};
+
+&uart1 {
+ status = "okay";
+};
From b7f264fa496eb2a6dd1d67dc91dbe8ffcb142487 Mon Sep 17 00:00:00 2001
From: Dan Haab <riproute@gmail.com>
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 <dan.haab@luxul.com>
Acked-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
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/;
From 40a17923367118e32e5e413a952736dd83635b32 Mon Sep 17 00:00:00 2001
From: Hao Dong <halbertdong@gmail.com>
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 <halbertdong@gmail.com>
[rmilecki: drop chosen { }, fix whitespaces, update commit message]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
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 <haotia@gmail.com>
+ * Copyright (C) 2019 Hao Dong <halbertdong@gmail.com>
+ */
+
+/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 = <KEY_RESTART>;
+ 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";
+ };
+ };
+};
......@@ -48,7 +48,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
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 <rafal@milecki.pl>
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 <rafal@milecki.pl>
};
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>;
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 */
From b7f264fa496eb2a6dd1d67dc91dbe8ffcb142487 Mon Sep 17 00:00:00 2001
From: Dan Haab <riproute@gmail.com>
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 <dan.haab@luxul.com>
Acked-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
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/;
From 40a17923367118e32e5e413a952736dd83635b32 Mon Sep 17 00:00:00 2001
From: Hao Dong <halbertdong@gmail.com>
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 <halbertdong@gmail.com>
[rmilecki: drop chosen { }, fix whitespaces, update commit message]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
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 <haotia@gmail.com>
+ * Copyright (C) 2019 Hao Dong <halbertdong@gmail.com>
+ */
+
+/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 = <KEY_RESTART>;
+ 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";
+ };
+ };
+};
--- 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 <haotia@gmail.com>
+*/
+
+/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 = <KEY_RESTART>;
+ gpios = <&chipcommon 17 GPIO_ACTIVE_LOW>;
+ };
+ };
+};
+
+&uart1 {
+ status = "okay";
+};
......@@ -48,7 +48,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
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 <rafal@milecki.pl>
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 <rafal@milecki.pl>
};
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>;
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 */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册