Merge Official Source

This commit is contained in:
CN_SZTL 2020-07-27 19:37:58 +08:00
commit 2ceb8e57f9
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
89 changed files with 1738 additions and 550 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=tfa-layerscape
PKG_VERSION:=LSDK-20.04
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/atf
@ -37,130 +37,115 @@ define Host/Install
$(INSTALL_BIN) $(HOST_BUILD_DIR)/plat/nxp/tools/byte_swap $(STAGING_DIR_HOST)/bin/tfa-byte-swap
endef
define Package/tfa-layerscape/ls1012afrdm
define Package/tfa-generic
SECTION:=boot
CATEGORY:=Boot Loaders
DEPENDS:=@TARGET_layerscape_armv8_64b +layerscape-rcw +u-boot-fsl_$(subst tfa-,,$(1))
VARIANT:=$(subst tfa-,,$(1))
endef
define Package/tfa-ls1012a-frdm
$(Package/tfa-generic)
TITLE:=NXP LS1012AFRDM Trusted Firmware
PLAT:=ls1012afrdm
BOOT_MODE:=qspi
BIN_BL2:=build/ls1012afrdm/release/bl2_qspi.pbl
BIN_FIP:=build/ls1012afrdm/release/fip.bin
endef
define Package/tfa-layerscape/ls1012ardb
define Package/tfa-ls1012a-rdb
$(Package/tfa-generic)
TITLE:=NXP LS1012ARDB Trusted Firmware
PLAT:=ls1012ardb
BOOT_MODE:=qspi
BIN_BL2:=build/ls1012ardb/release/bl2_qspi.pbl
BIN_FIP:=build/ls1012ardb/release/fip.bin
endef
define Package/tfa-layerscape/ls1012afrwy
define Package/tfa-ls1012a-frwy-sdboot
$(Package/tfa-generic)
TITLE:=NXP LS1012AFRWY Trusted Firmware
PLAT:=ls1012afrwy
BOOT_MODE:=qspi
BIN_BL2:=build/ls1012afrwy/release/bl2_qspi.pbl
BIN_FIP:=build/ls1012afrwy/release/fip.bin
endef
define Package/tfa-layerscape/ls1043ardb
define Package/tfa-ls1043a-rdb
$(Package/tfa-generic)
TITLE:=NXP LS1043ARDB Trusted Firmware
PLAT:=ls1043ardb
BOOT_MODE:=nor
BIN_BL2:=build/ls1043ardb/release/bl2_nor.pbl
BIN_FIP:=build/ls1043ardb/release/fip.bin
endef
define Package/tfa-layerscape/ls1043ardb-sdboot
define Package/tfa-ls1043a-rdb-sdboot
$(Package/tfa-generic)
TITLE:=NXP LS1043ARDB SD Boot Trusted Firmware
PLAT:=ls1043ardb
BOOT_MODE:=sd
BIN_BL2:=build/ls1043ardb/release/bl2_sd.pbl
BIN_FIP:=build/ls1043ardb/release/fip.bin
endef
define Package/tfa-layerscape/ls1046ardb
define Package/tfa-ls1046a-rdb
$(Package/tfa-generic)
TITLE:=NXP LS1046ARDB Trusted Firmware
PLAT:=ls1046ardb
BOOT_MODE:=qspi
BIN_BL2:=build/ls1046ardb/release/bl2_qspi.pbl
BIN_FIP:=build/ls1046ardb/release/fip.bin
endef
define Package/tfa-layerscape/ls1046ardb-sdboot
define Package/tfa-ls1046a-rdb-sdboot
$(Package/tfa-generic)
TITLE:=NXP LS1046ARDB SD Boot Trusted Firmware
PLAT:=ls1046ardb
BOOT_MODE:=sd
BIN_BL2:=build/ls1046ardb/release/bl2_sd.pbl
BIN_FIP:=build/ls1046ardb/release/fip.bin
endef
define Package/tfa-layerscape/ls1088ardb
define Package/tfa-ls1088a-rdb
$(Package/tfa-generic)
TITLE:=NXP LS1088ARDB Trusted Firmware
PLAT:=ls1088ardb
BOOT_MODE:=qspi
BIN_BL2:=build/ls1088ardb/release/bl2_qspi.pbl
BIN_FIP:=build/ls1088ardb/release/fip.bin
endef
define Package/tfa-layerscape/ls1088ardb-sdboot
define Package/tfa-ls1088a-rdb-sdboot
$(Package/tfa-generic)
TITLE:=NXP LS1088ARDB SD Boot Trusted Firmware
PLAT:=ls1088ardb
BOOT_MODE:=sd
BIN_BL2:=build/ls1088ardb/release/bl2_sd.pbl
BIN_FIP:=build/ls1088ardb/release/fip.bin
endef
define Package/tfa-layerscape/ls2088ardb
define Package/tfa-ls2088a-rdb
$(Package/tfa-generic)
TITLE:=NXP LS2088ARDB Trusted Firmware
PLAT:=ls2088ardb
BOOT_MODE:=nor
BIN_BL2:=build/ls2088ardb/release/bl2_nor.pbl
BIN_FIP:=build/ls2088ardb/release/fip.bin
endef
define Package/tfa-layerscape/Config
define Package/tfa-$(1)
SECTION:=boot
CATEGORY:=Boot Loaders
TITLE:=$(2)
DEPENDS:=@TARGET_layerscape_armv8_64b +layerscape-rcw +u-boot-$(1)
VARIANT:=$(1)
BIN_BL2:=$(3)
BIN_FIP:=$(4)
endef
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/$(BIN_BL2) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-bl2.pbl
$(CP) $(PKG_BUILD_DIR)/$(BIN_FIP) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-fip.bin
$(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/bl2_$(BOOT_MODE).pbl \
$(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-bl2.pbl
$(CP) $(PKG_BUILD_DIR)/build/$(PLAT)/release/fip.bin \
$(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-fip.bin
endef
define Build/Compile
$(eval $(Package/tfa-layerscape/$(BUILD_VARIANT))) \
$(eval $(Package/tfa-$(BUILD_VARIANT))) \
$(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) \
fip pbl PLAT=$(PLAT) BOOT_MODE=$(BOOT_MODE) \
RCW=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-rcw.bin \
BL33=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-uboot.bin \
RCW=$(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-rcw.bin \
BL33=$(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-uboot.bin \
FIPTOOL=$(STAGING_DIR_HOST)/bin/tfa-fiptool \
CREATE_PBL=$(STAGING_DIR_HOST)/bin/tfa-create-pbl \
BYTE_SWAP=$(STAGING_DIR_HOST)/bin/tfa-byte-swap
endef
TFAS := \
ls1012afrdm \
ls1012ardb \
ls1012afrwy \
ls1043ardb \
ls1043ardb-sdboot \
ls1046ardb \
ls1046ardb-sdboot \
ls1088ardb \
ls1088ardb-sdboot \
ls2088ardb
ls1012a-frdm \
ls1012a-rdb \
ls1012a-frwy-sdboot \
ls1043a-rdb \
ls1043a-rdb-sdboot \
ls1046a-rdb \
ls1046a-rdb-sdboot \
ls1088a-rdb \
ls1088a-rdb-sdboot \
ls2088a-rdb
$(eval $(call HostBuild))
$(foreach tfa,$(TFAS), \
$(eval $(Package/tfa-layerscape/$(tfa))) \
$(eval $(call Package/tfa-layerscape/Config,$(tfa),$(TITLE),$(BIN_BL2),$(BIN_FIP))) \
$(eval $(call BuildPackage,tfa-$(tfa))) \
)

View File

@ -14,10 +14,31 @@ touch /etc/config/ubootenv
board=$(board_name)
case "$board" in
apalis*)
ubootenv_add_uci_config $(bootdev_from_uuid)boot0 -0x2200 0x2000 0x200 10
;;
*gw5*)
gw,imx6dl-gw51xx |\
gw,imx6dl-gw52xx |\
gw,imx6dl-gw53xx |\
gw,imx6dl-gw54xx |\
gw,imx6dl-gw551x |\
gw,imx6dl-gw552x |\
gw,imx6dl-gw553x |\
gw,imx6dl-gw5904 |\
gw,imx6dl-gw5907 |\
gw,imx6dl-gw5910 |\
gw,imx6dl-gw5912 |\
gw,imx6dl-gw5913 |\
gw,imx6q-gw51xx |\
gw,imx6q-gw52xx |\
gw,imx6q-gw53xx |\
gw,imx6q-gw5400-a |\
gw,imx6q-gw54xx |\
gw,imx6q-gw551x |\
gw,imx6q-gw552x |\
gw,imx6q-gw553x |\
gw,imx6q-gw5904 |\
gw,imx6q-gw5907 |\
gw,imx6q-gw5910 |\
gw,imx6q-gw5912 |\
gw,imx6q-gw5913 )
if [ -c /dev/mtd1 ]; then
# board boots from NAND
ubootenv_add_uci_config /dev/mtd1 0x0 0x20000 0x40000
@ -28,7 +49,12 @@ apalis*)
ubootenv_add_uci_config /dev/mmcblk0 0xd1400 0x20000
fi
;;
wandboard)
toradex,apalis_imx6q-eval |\
toradex,apalis_imx6q-ixora |\
toradex,apalis_imx6q-ixora-v1.1 )
ubootenv_add_uci_config $(bootdev_from_uuid)boot0 -0x2200 0x2000 0x200 10
;;
wand,imx6dl-wandboard)
ubootenv_add_uci_config "/dev/mmcblk0" "0x60000" "0x2000" "0x2000"
;;
esac

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=uboot-layerscape
PKG_VERSION:=LSDK-20.04
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/u-boot
@ -27,67 +27,67 @@ define U-Boot/Default
ENV_SIZE:=0x2000
endef
define U-Boot/ls1012afrdm
define U-Boot/fsl_ls1012a-frdm
NAME:=NXP LS1012AFRDM
UBOOT_CONFIG:=ls1012afrdm_tfa
ENV_SIZE:=0x40000
endef
define U-Boot/ls1012ardb
define U-Boot/fsl_ls1012a-rdb
NAME:=NXP LS1012ARDB
UBOOT_CONFIG:=ls1012ardb_tfa
ENV_SIZE:=0x40000
endef
define U-Boot/ls1012afrwy
define U-Boot/fsl_ls1012a-frwy-sdboot
NAME:=NXP LS1012AFRWY
UBOOT_CONFIG:=ls1012afrwy_tfa
ENV_SIZE:=0x10000
endef
define U-Boot/ls1043ardb
define U-Boot/fsl_ls1043a-rdb
NAME:=NXP LS1043ARDB
UBOOT_CONFIG:=ls1043ardb_tfa
endef
define U-Boot/ls1043ardb-sdboot
define U-Boot/fsl_ls1043a-rdb-sdboot
NAME:=NXP LS1043ARDB SD Card Boot
UBOOT_CONFIG:=ls1043ardb_tfa
endef
define U-Boot/ls1046ardb
define U-Boot/fsl_ls1046a-rdb
NAME:=NXP LS1046ARDB
UBOOT_CONFIG:=ls1046ardb_tfa
endef
define U-Boot/ls1046ardb-sdboot
define U-Boot/fsl_ls1046a-rdb-sdboot
NAME:=NXP LS1046ARDB SD Card Boot
UBOOT_CONFIG:=ls1046ardb_tfa
endef
define U-Boot/ls1088ardb
define U-Boot/fsl_ls1088a-rdb
NAME:=NXP LS1088ARDB
UBOOT_CONFIG:=ls1088ardb_tfa
endef
define U-Boot/ls1088ardb-sdboot
define U-Boot/fsl_ls1088a-rdb-sdboot
NAME:=NXP LS1088ARDB SD Card Boot
UBOOT_CONFIG:=ls1088ardb_tfa
endef
define U-Boot/ls2088ardb
define U-Boot/fsl_ls2088a-rdb
NAME:=NXP LS2088ARDB
UBOOT_CONFIG:=ls2088ardb_tfa
endef
define U-Boot/ls1021atwr
define U-Boot/fsl_ls1021a-twr
NAME:=NXP LS1021ATWR
BUILD_SUBTARGET:=armv7
UBOOT_CONFIG:=ls1021atwr_nor
ENV_SIZE:=0x20000
endef
define U-Boot/ls1021atwr-sdboot
define U-Boot/fsl_ls1021a-twr-sdboot
NAME:=NXP LS1021ATWR SD Card Boot
BUILD_SUBTARGET:=armv7
UBOOT_CONFIG:=ls1021atwr_sdcard_ifc
@ -95,7 +95,7 @@ define U-Boot/ls1021atwr-sdboot
ENV_SIZE:=0x20000
endef
define U-Boot/ls1021aiot-sdboot
define U-Boot/fsl_ls1021a-iot-sdboot
NAME:=NXP LS1021AIOT SD Card Boot
BUILD_SUBTARGET:=armv7
UBOOT_CONFIG:=ls1021aiot_sdcard
@ -104,19 +104,19 @@ define U-Boot/ls1021aiot-sdboot
endef
UBOOT_TARGETS := \
ls1012afrdm \
ls1012ardb \
ls1012afrwy \
ls1043ardb \
ls1043ardb-sdboot \
ls1046ardb \
ls1046ardb-sdboot \
ls1088ardb \
ls1088ardb-sdboot \
ls2088ardb \
ls1021atwr \
ls1021atwr-sdboot \
ls1021aiot-sdboot
fsl_ls1012a-frdm \
fsl_ls1012a-rdb \
fsl_ls1012a-frwy-sdboot \
fsl_ls1043a-rdb \
fsl_ls1043a-rdb-sdboot \
fsl_ls1046a-rdb \
fsl_ls1046a-rdb-sdboot \
fsl_ls1088a-rdb \
fsl_ls1088a-rdb-sdboot \
fsl_ls2088a-rdb \
fsl_ls1021a-twr \
fsl_ls1021a-twr-sdboot \
fsl_ls1021a-iot-sdboot
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)

View File

@ -15,18 +15,18 @@ define U-Boot/Default
DEFAULT:=y
endef
define U-Boot/mt7629
NAME:=MT7629
BUILD_SUBTARGET:=mt7629
UBOOT_CONFIG:=mt7629_rfb
endef
define U-Boot/mt7622
NAME:=MT7622
BUILD_SUBTARGET:=mt7622
UBOOT_CONFIG:=mt7622_rfb
endef
define U-Boot/mt7623a_unielec_u7623
NAME:=UniElec U7623 (mt7623)
BUILD_SUBTARGET:=mt7623
UBOOT_CONFIG:=mt7623a_unielec_u7623_02
endef
define U-Boot/mt7623n_bpir2
NAME:=Banana Pi R2 (mt7623)
BUILD_SUBTARGET:=mt7623
@ -34,7 +34,13 @@ define U-Boot/mt7623n_bpir2
UBOOT_CONFIG:=mt7623n_bpir2
endef
UBOOT_TARGETS := mt7629 mt7622 mt7623n_bpir2
define U-Boot/mt7629
NAME:=MT7629
BUILD_SUBTARGET:=mt7629
UBOOT_CONFIG:=mt7629_rfb
endef
UBOOT_TARGETS := mt7629 mt7622 mt7623n_bpir2 mt7623a_unielec_u7623
UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE)

View File

@ -0,0 +1,51 @@
From b0d1b85fb25a28a9532eaa9dda064b40a0e25f25 Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
Date: Sun, 12 Jul 2020 23:19:09 +0100
Subject: [PATCH 1/3] board: mediatek: fix mmc_get_boot_dev() for platforms
without external SD
On the UniElec U7623 board there is no external SD slot and the preloader
doesn't fill in the magic field at 0x81dffff0 to indicate that it was
booted from eMMC.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
---
board/mediatek/mt7623/mt7623_rfb.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/board/mediatek/mt7623/mt7623_rfb.c b/board/mediatek/mt7623/mt7623_rfb.c
index 4ec2764976..984e75ccaf 100644
--- a/board/mediatek/mt7623/mt7623_rfb.c
+++ b/board/mediatek/mt7623/mt7623_rfb.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <mmc.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -15,10 +16,15 @@ int board_init(void)
return 0;
}
+#ifdef CONFIG_MMC
int mmc_get_boot_dev(void)
{
int g_mmc_devid = -1;
char *uflag = (char *)0x81DFFFF0;
+
+ if (!find_mmc_device(1))
+ return 0;
+
if (strncmp(uflag,"eMMC",4)==0) {
g_mmc_devid = 0;
printf("Boot From Emmc(id:%d)\n\n", g_mmc_devid);
@@ -33,3 +39,4 @@ int mmc_get_env_dev(void)
{
return mmc_get_boot_dev();
}
+#endif
--
2.26.2

View File

@ -0,0 +1,310 @@
From d13abe5b2c5b85228bdd34584fcbd642f1883668 Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
Date: Sun, 12 Jul 2020 23:23:05 +0100
Subject: [PATCH 3/3] board: mediatek: Add support for UniElec U7623 board
This is an MT7623A-based board, very similar to the Banana Pi R2.
http://www.unielecinc.com/q/news/cn/p/product/detail.html?qd_guid=OjXwKCaRlN
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
---
arch/arm/dts/Makefile | 1 +
.../arm/dts/mt7623a-unielec-u7623-02-emmc.dts | 211 ++++++++++++++++++
configs/mt7623a_unielec_u7623_02_defconfig | 54 +++++
3 files changed, 266 insertions(+)
create mode 100644 arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts
create mode 100644 configs/mt7623a_unielec_u7623_02_defconfig
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 89fa448818..a140b1c8d4 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -938,6 +938,7 @@ dtb-$(CONFIG_SOC_K3_J721E) += k3-j721e-common-proc-board.dtb \
dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7622-rfb.dtb \
+ mt7623a-unielec-u7623-02-emmc.dtb \
mt7623n-bananapi-bpi-r2.dtb \
mt7629-rfb.dtb \
mt8512-bm1-emmc.dtb \
diff --git a/arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts b/arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts
new file mode 100644
index 0000000000..fdeec75b05
--- /dev/null
+++ b/arch/arm/dts/mt7623a-unielec-u7623-02-emmc.dts
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2018 MediaTek Inc.
+ * Author: Ryder Lee <ryder.lee@mediatek.com>
+ *
+ * SPDX-License-Identifier: (GPL-2.0 OR MIT)
+ */
+
+/dts-v1/;
+#include "mt7623.dtsi"
+#include "mt7623-u-boot.dtsi"
+
+/ {
+ model = "UniElec U7623-02 eMMC";
+ compatible = "unielec,u7623-02-emmc", "mediatek,mt7623";
+
+ memory@80000000 {
+ device_type = "memory";
+ reg = <0 0x80000000 0 0x20000000>;
+ };
+
+ chosen {
+ stdout-path = &uart2;
+ tick-timer = &timer0;
+ };
+
+ reg_1p8v: regulator-1p8v {
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-1.8V";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ reg_3p3v: regulator-3p3v {
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-3.3V";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ reg_5v: regulator-5v {
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-5V";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led3 {
+ label = "u7623-01:green:led3";
+ gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ };
+
+ led4 {
+ label = "u7623-01:green:led4";
+ gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+ default-state = "off";
+ };
+ };
+};
+
+&eth {
+ status = "okay";
+ mediatek,gmac-id = <0>;
+ phy-mode = "rgmii";
+ mediatek,switch = "mt7530";
+ mediatek,mcm;
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+};
+
+&mmc0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc0_pins_default>;
+ status = "okay";
+ bus-width = <8>;
+ max-frequency = <50000000>;
+ cap-mmc-highspeed;
+ vmmc-supply = <&reg_3p3v>;
+ vqmmc-supply = <&reg_1p8v>;
+ non-removable;
+};
+
+&pinctrl {
+ ephy_default: ephy_default {
+ mux {
+ function = "eth";
+ groups = "mdc_mdio", "ephy";
+ };
+
+ conf {
+ pins = "G2_TXEN", "G2_TXD0", "G2_TXD1", "G2_TXD2",
+ "G2_TXD3", "G2_TXC", "G2_RXC", "G2_RXD0",
+ "G2_RXD1", "G2_RXD2", "G2_RXD3", "G2_RXDV",
+ "MDC", "MDIO";
+ drive-strength = <12>;
+ mediatek,tdsel = <5>;
+ };
+ };
+
+ mmc0_pins_default: mmc0default {
+ mux {
+ function = "msdc";
+ groups = "msdc0";
+ };
+
+ conf-cmd-data {
+ pins = "MSDC0_CMD", "MSDC0_DAT0", "MSDC0_DAT1",
+ "MSDC0_DAT2", "MSDC0_DAT3", "MSDC0_DAT4",
+ "MSDC0_DAT5", "MSDC0_DAT6", "MSDC0_DAT7";
+ input-enable;
+ bias-pull-up;
+ };
+
+ conf-clk {
+ pins = "MSDC0_CLK";
+ bias-pull-down;
+ };
+
+ conf-rst {
+ pins = "MSDC0_RSTB";
+ bias-pull-up;
+ };
+ };
+
+ pcie_default: pcie-default {
+ mux {
+ function = "pcie";
+ groups = "pcie0_0_perst", "pcie1_0_perst";
+ };
+ };
+
+ uart0_pins_a: uart0-default {
+ mux {
+ function = "uart";
+ groups = "uart0_0_txd_rxd";
+ };
+ };
+
+ uart1_pins_a: uart1-default {
+ mux {
+ function = "uart";
+ groups = "uart1_0_txd_rxd";
+ };
+ };
+
+ uart2_pins_a: uart2-default {
+ mux {
+ function = "uart";
+ groups = "uart2_0_txd_rxd";
+ };
+ };
+
+ uart2_pins_b: uart2-alt {
+ mux {
+ function = "uart";
+ groups = "uart2_1_txd_rxd";
+ };
+ };
+};
+
+&pcie {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pcie_default>;
+ status = "okay";
+
+ pcie@0,0 {
+ status = "okay";
+ };
+
+ pcie@1,0 {
+ status = "okay";
+ };
+};
+
+&pcie0_phy {
+ status = "okay";
+};
+
+&pcie1_phy {
+ status = "okay";
+};
+
+&uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
+ status = "okay";
+};
+
+&uart1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart1_pins_a>;
+ status = "okay";
+};
+
+&uart2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart2_pins_b>;
+ status = "okay";
+};
diff --git a/configs/mt7623a_unielec_u7623_02_defconfig b/configs/mt7623a_unielec_u7623_02_defconfig
new file mode 100644
index 0000000000..72b5f31092
--- /dev/null
+++ b/configs/mt7623a_unielec_u7623_02_defconfig
@@ -0,0 +1,54 @@
+CONFIG_ARM=y
+CONFIG_SYS_THUMB_BUILD=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_SYS_TEXT_BASE=0x81e00000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_ENV_SIZE=0x1000
+CONFIG_ENV_OFFSET=0x100000
+CONFIG_TARGET_MT7623=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_BOOTDELAY=3
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_DEFAULT_FDT_FILE="mt7623a-unielec-u7623-02-emmc.dtb"
+# CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_SYS_PROMPT="U-Boot> "
+CONFIG_CMD_BOOTMENU=y
+# CONFIG_CMD_ELF is not set
+# CONFIG_CMD_XIMG is not set
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_READ=y
+# CONFIG_CMD_SETEXPR is not set
+# CONFIG_CMD_NFS is not set
+CONFIG_DEFAULT_DEVICE_TREE="mt7623a-unielec-u7623-02-emmc"
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_CLK=y
+CONFIG_DM_MMC=y
+# CONFIG_MMC_QUIRKS is not set
+CONFIG_SUPPORT_EMMC_BOOT=y
+CONFIG_MMC_HS400_SUPPORT=y
+CONFIG_MMC_MTK=y
+CONFIG_PHY_FIXED=y
+CONFIG_DM_ETH=y
+CONFIG_MEDIATEK_ETH=y
+CONFIG_PINCTRL=y
+CONFIG_PINCONF=y
+CONFIG_PINCTRL_MT7623=y
+CONFIG_POWER_DOMAIN=y
+CONFIG_MTK_POWER_DOMAIN=y
+CONFIG_DM_SERIAL=y
+CONFIG_MTK_SERIAL=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
+CONFIG_TIMER=y
+CONFIG_MTK_TIMER=y
+CONFIG_WDT_MTK=y
+CONFIG_LZMA=y
--
2.26.2

View File

@ -0,0 +1,17 @@
diff --git a/configs/mt7623n_bpir2_defconfig b/configs/mt7623n_bpir2_defconfig
index 6b9fbd7e22..fb2a004803 100644
--- a/configs/mt7623a_unielec_u7623_02_defconfig
+++ b/configs/mt7623a_unielec_u7623_02_defconfig
@@ -52,3 +52,12 @@ CONFIG_TIMER=y
CONFIG_MTK_TIMER=y
CONFIG_WDT_MTK=y
CONFIG_LZMA=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_OF_LIBFDT_OVERLAY=y
+#enables savenenv-command
+CONFIG_ENV_IS_IN_FAT=y
+CONFIG_ENV_FAT_INTERFACE="mmc"
+CONFIG_ENV_FAT_DEVICE_AND_PART="0:2"
+CONFIG_ENV_FAT_FILE="uboot.env"
+CONFIG_CMD_ASKENV=y
+CONFIG_CMD_SETEXPR=y

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=fman-ucode
PKG_VERSION:=LSDK-20.04
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/NXP/qoriq-fm-ucode.git
@ -31,9 +31,9 @@ endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/fsl_fman_ucode_ls1043_r1.1_106_4_18.bin \
$(STAGING_DIR_IMAGE)/ls1043ardb-fman.bin
$(STAGING_DIR_IMAGE)/fsl_ls1043a-rdb-fman.bin
$(CP) $(PKG_BUILD_DIR)/fsl_fman_ucode_ls1046_r1.0_106_4_18.bin \
$(STAGING_DIR_IMAGE)/ls1046ardb-fman.bin
$(STAGING_DIR_IMAGE)/fsl_ls1046a-rdb-fman.bin
endef
$(eval $(call BuildPackage,layerscape-fman))

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ls-dpl
PKG_VERSION:=LSDK-20.04
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/mc-utils
@ -33,13 +33,13 @@ MAKE_VARS+= \
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/config/ls1088a/RDB/dpl-eth.0x1D_0x0D.dtb \
$(STAGING_DIR_IMAGE)/ls1088ardb-dpl.dtb
$(STAGING_DIR_IMAGE)/fsl_ls1088a-rdb-dpl.dtb
$(CP) $(PKG_BUILD_DIR)/config/ls1088a/RDB/dpc.0x1D-0x0D.dtb \
$(STAGING_DIR_IMAGE)/ls1088ardb-dpc.dtb
$(STAGING_DIR_IMAGE)/fsl_ls1088a-rdb-dpc.dtb
$(CP) $(PKG_BUILD_DIR)/config/ls2088a/RDB/dpl-eth.0x2A_0x41.dtb \
$(STAGING_DIR_IMAGE)/ls2088ardb-dpl.dtb
$(STAGING_DIR_IMAGE)/fsl_ls2088a-rdb-dpl.dtb
$(CP) $(PKG_BUILD_DIR)/config/ls2088a/RDB/dpc.0x2A_0x41.dtb \
$(STAGING_DIR_IMAGE)/ls2088ardb-dpc.dtb
$(STAGING_DIR_IMAGE)/fsl_ls2088a-rdb-dpc.dtb
endef
$(eval $(call BuildPackage,layerscape-dpl))

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ls-mc
PKG_VERSION:=LSDK-20.04
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/NXP/qoriq-mc-binary.git
@ -31,9 +31,9 @@ endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/ls1088a/mc_10.20.4_ls1088a.itb \
$(STAGING_DIR_IMAGE)/ls1088ardb-mc.itb
$(STAGING_DIR_IMAGE)/fsl_ls1088a-rdb-mc.itb
$(CP) $(PKG_BUILD_DIR)/ls2088a/mc_10.20.4_ls2088a.itb \
$(STAGING_DIR_IMAGE)/ls2088ardb-mc.itb
$(STAGING_DIR_IMAGE)/fsl_ls2088a-rdb-mc.itb
endef
$(eval $(call BuildPackage,layerscape-mc))

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ls-rcw
PKG_VERSION:=LSDK-20.04
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://source.codeaurora.org/external/qoriq/qoriq-components/rcw
@ -26,34 +26,34 @@ define Package/layerscape-rcw
endef
BOARDS := \
ls1012ardb \
ls1012afrdm \
ls1012afrwy \
ls1043ardb \
ls1043ardb-sdboot \
ls1046ardb \
ls1046ardb-sdboot \
ls1088ardb \
ls1088ardb-sdboot \
ls2088ardb \
ls1021atwr
ls1012a-rdb \
ls1012a-frdm \
ls1012a-frwy-sdboot \
ls1043a-rdb \
ls1043a-rdb-sdboot \
ls1046a-rdb \
ls1046a-rdb-sdboot \
ls1088a-rdb \
ls1088a-rdb-sdboot \
ls2088a-rdb \
ls1021a-twr
RCW_ls1012ardb :=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin
RCW_ls1012afrdm :=ls1012afrdm/N_SSNP_3305/rcw_800.bin
RCW_ls1012afrwy :=ls1012afrwy/N_SSNP_3305/rcw_1000_default.bin
RCW_ls1043ardb :=ls1043ardb/RR_FQPP_1455/rcw_1600.bin
RCW_ls1043ardb-sdboot :=ls1043ardb/RR_FQPP_1455/rcw_1600_sdboot.bin
RCW_ls1046ardb :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin
RCW_ls1046ardb-sdboot :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_sdboot.bin
RCW_ls1088ardb :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_qspi.bin
RCW_ls1088ardb-sdboot :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_sd.bin
RCW_ls2088ardb :=ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/rcw_1800.bin
RCW_ls1021atwr :=ls1021atwr/SSR_PNS_30/rcw_1200.bin
RCW_ls1012a-rdb :=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin
RCW_ls1012a-frdm :=ls1012afrdm/N_SSNP_3305/rcw_800.bin
RCW_ls1012a-frwy-sdboot :=ls1012afrwy/N_SSNP_3305/rcw_1000_default.bin
RCW_ls1043a-rdb :=ls1043ardb/RR_FQPP_1455/rcw_1600.bin
RCW_ls1043a-rdb-sdboot :=ls1043ardb/RR_FQPP_1455/rcw_1600_sdboot.bin
RCW_ls1046a-rdb :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin
RCW_ls1046a-rdb-sdboot :=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_sdboot.bin
RCW_ls1088a-rdb :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_qspi.bin
RCW_ls1088a-rdb-sdboot :=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/rcw_1600_sd.bin
RCW_ls2088a-rdb :=ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/rcw_1800.bin
RCW_ls1021a-twr :=ls1021atwr/SSR_PNS_30/rcw_1200.bin
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
$(foreach board,$(BOARDS), \
$(CP) $(PKG_BUILD_DIR)/$(RCW_$(board)) $(STAGING_DIR_IMAGE)/$(board)-rcw.bin;)
$(CP) $(PKG_BUILD_DIR)/$(RCW_$(board)) $(STAGING_DIR_IMAGE)/fsl_$(board)-rcw.bin;)
endef
$(eval $(call BuildPackage,layerscape-rcw))

View File

@ -13,9 +13,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git
PKG_SOURCE_DATE:=2020-01-10
PKG_SOURCE_VERSION:=aeff7a3e61ffa3159a8a95384d33e47a006211f4
PKG_MIRROR_HASH:=3f634fdc05d30988abb4cae2f7fcb4bd55ff10b0b354ac16b8577e85a4b74f6f
PKG_SOURCE_DATE:=2020-07-24
PKG_SOURCE_VERSION:=48979385757f3408c3427b3ebbf5963efdada5aa
PKG_MIRROR_HASH:=0e8ed53f55e28ad0c30f20293c16988876bae8d6f70f5629a43cf2ce1e49fc51
PKG_MAINTAINER:=Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
include $(INCLUDE_DIR)/package.mk

View File

@ -0,0 +1,28 @@
From db6d1e942f5a2828e1245e16ceb997f537a2d1a4 Mon Sep 17 00:00:00 2001
From: David Bauer <mail@david-bauer.net>
Date: Sat, 25 Jul 2020 01:43:26 +0200
Subject: [PATCH] mac80211: util: don't warn on missing sband iftype data
The kernel currently floods the ringbuffer with warnings when adding a
mesh interface for a device not support HE 6GHz modes.
Return without warning in this case, as mesh_add_he_6ghz_cap_ie calls
ieee80211_ie_build_he_6ghz_cap regardless of the supported interface
modes.
Signed-off-by: David Bauer <mail@david-bauer.net>
---
net/mac80211/util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2875,7 +2875,7 @@ void ieee80211_ie_build_he_6ghz_cap(stru
return;
iftd = ieee80211_get_sband_iftype_data(sband, iftype);
- if (WARN_ON(!iftd))
+ if (!iftd)
return;
cap = le16_to_cpu(iftd->he_6ghz_capa.capa);

View File

@ -13,9 +13,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall3.git
PKG_SOURCE_DATE:=2019-11-22
PKG_SOURCE_VERSION:=8174814a507489ebbe8bb85c1004e1f02919ca82
PKG_MIRROR_HASH:=84e0cca2d47470bdb1788a8ae044cc425be8ff650a1137474ba43a15040085da
PKG_SOURCE_DATE:=2020-07-25
PKG_SOURCE_VERSION:=e9b90dfac2225927c035f6a76277b850c282dc9a
PKG_MIRROR_HASH:=9164089058b5c8d62e81806dcd2261b9f78b050fb40cd84cbd127794ad7a940e
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=ISC

View File

@ -12,9 +12,9 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
PKG_SOURCE_DATE:=2020-07-20
PKG_SOURCE_VERSION:=66ae2d947ea463c53de1bf2ed5491c9926694f02
PKG_MIRROR_HASH:=c66fb1d6f89c110b59cc53595754522272a9e62aaf1970a5aea34fe528ec3dcd
PKG_SOURCE_DATE:=2020-07-25
PKG_SOURCE_VERSION:=5cb3715a079c09d1e66a6455a246347c7cf7b998
PKG_MIRROR_HASH:=ab4e79ba5d1180ce850c811d346de7275889ba4df6f82e373c416f30da89ad12
CMAKE_INSTALL:=1
PKG_LICENSE:=GPL-2.0

View File

@ -131,7 +131,7 @@
qca,ar8327-initvals = <
0x04 0x07600000 /* PORT0 PAD MODE CTRL */
0x10 0x80000080 /* POWER_ON_STRIP */
0x10 0x80000080 /* POWER_ON_STRAP */
0x50 0x00000000 /* LED_CTRL0 */
0x54 0xc737c737 /* LED_CTRL1 */
0x58 0x00000000 /* LED_CTRL2 */

View File

@ -99,7 +99,7 @@
qca,ar8327-initvals = <
0x04 0x07600000 /* PORT0 PAD MODE CTRL */
0x10 0x80000080 /* POWER_ON_STRIP */
0x10 0x80000080 /* POWER_ON_STRAP */
0x50 0xc737c737 /* LED_CTRL0 */
0x54 0x00000000 /* LED_CTRL1 */
0x58 0x00000000 /* LED_CTRL2 */

View File

@ -192,7 +192,7 @@
qca,ar8327-initvals = <
0x04 0x07600000 /* PORT0 PAD MODE CTRL */
0x10 0x80000080 /* POWER_ON_STRIP */
0x10 0x80000080 /* POWER_ON_STRAP */
0x50 0xc737c737 /* LED_CTRL0 */
0x54 0x00000000 /* LED_CTRL1 */
0x58 0x00000000 /* LED_CTRL2 */

View File

@ -51,7 +51,7 @@
qca,ar8327-initvals = <
0x04 0x87600000 /* PORT0 PAD MODE CTRL */
0x0c 0x00080080 /* PORT6 PAD MODE CTRL */
0x10 0x81000080 /* POWER_ON_STRIP */
0x10 0x81000080 /* POWER_ON_STRAP */
0x7c 0x0000007e /* PORT0_STATUS */
0x94 0x0000007e /* PORT6 STATUS */
>;

View File

@ -134,7 +134,7 @@
qca,ar8327-initvals = <
0x04 0x00080080 /* PORT0 PAD MODE CTRL */
0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
0x10 0x81000080 /* POWER_ON_STRIP */
0x10 0x81000080 /* POWER_ON_STRAP */
0x50 0xcc35cc35 /* LED_CTRL0 */
0x54 0xca35ca35 /* LED_CTRL1 */
0x58 0xc935c935 /* LED_CTRL2 */

View File

@ -170,7 +170,7 @@
qca,ar8327-initvals = <
0x04 0x00080080 /* PORT0 PAD MODE CTRL */
0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
0x10 0x81000080 /* POWER_ON_STRIP */
0x10 0x81000080 /* POWER_ON_STRAP */
0x7c 0x0000007e /* PORT0_STATUS */
0x94 0x0000007e /* PORT6 STATUS */
>;

View File

@ -210,7 +210,7 @@
qca,ar8327-initvals = <
0x04 0x87600000 /* PORT0 PAD MODE CTRL */
0x0c 0x00080080 /* PORT6 PAD MODE CTRL */
0x10 0x81000080 /* POWER_ON_STRIP */
0x10 0x81000080 /* POWER_ON_STRAP */
0x50 0xffb7ffb7 /* LED_CTRL0 */
0x54 0xffb7ffb7 /* LED_CTRL1 */
0x58 0xffb7ffb7 /* LED_CTRL2 */

View File

@ -0,0 +1,145 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include "qca956x.dtsi"
/ {
model = "Compex WPJ563";
compatible = "compex,wpj563", "qca,qca9563";
aliases {
label-mac-device = &eth0;
led-boot = &led_sig4;
led-failsafe = &led_sig4;
led-running = &led_sig4;
led-upgrade = &led_sig4;
};
beeper {
compatible = "gpio-beeper";
gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
debounce-interval = <60>;
};
};
leds {
compatible = "gpio-leds";
sig1 {
label = "wpj563:green:sig1";
gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
};
sig2 {
label = "wpj563:green:sig2";
gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
};
sig3 {
label = "wpj563:green:sig4";
gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
};
led_sig4: sig4 {
label = "wpj563:green:sig4";
gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
};
};
};
&pcie {
status = "okay";
};
&spi {
status = "okay";
num-cs = <1>;
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <25000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
uboot: partition@0 {
label = "u-boot";
reg = <0x000000 0x030000>;
read-only;
};
partition@30000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x030000 0xfc0000>;
};
art: partition@ff0000 {
label = "art";
reg = <0xff0000 0x010000>;
read-only;
};
};
};
};
&mdio0 {
status = "okay";
phy-mask = <0>;
phy0: ethernet-phy@0 {
reg = <0>;
phy-mode = "sgmii";
qca,mib-poll-interval = <500>;
qca,ar8327-initvals = <
0x04 0x00080080 /* PORT0 PAD MODE CTRL */
0x7c 0x0000007e /* PORT0_STATUS */
>;
};
};
&eth0 {
status = "okay";
pll-data = <0x03000101 0x00000101 0x00001919>;
mtd-mac-address = <&uboot 0x2e010>;
phy-mode = "sgmii";
phy-handle = <&phy0>;
};
&usb_phy0 {
status = "okay";
};
&usb0 {
status = "okay";
};
&uart {
status = "okay";
};
&wmac {
status = "okay";
mtd-cal-data = <&art 0x1000>;
};

View File

@ -109,7 +109,7 @@
qca,ar8327-initvals = <
0x04 0x00080080 /* PORT0 PAD MODE CTRL */
0x10 0x81000080 /* POWER_ON_STRIP */
0x10 0x81000080 /* POWER_ON_STRAP */
0x50 0xcc35cc35 /* LED_CTRL0 */
0x54 0xcb37cb37 /* LED_CTRL1 */
0x58 0x00000000 /* LED_CTRL2 */

View File

@ -144,7 +144,7 @@
qca,ar8327-initvals = <
0x04 0x00080080 /* PORT0 PAD MODE CTRL */
0x10 0x81000080 /* POWER_ON_STRIP */
0x10 0x81000080 /* POWER_ON_STRAP */
0x50 0xcc35cc35 /* LED_CTRL0 */
0x54 0xcb37cb37 /* LED_CTRL1 */
0x58 0x00000000 /* LED_CTRL2 */

View File

@ -187,7 +187,7 @@
qca,ar8327-initvals = <
0x04 0x00000080 /* PORT0 PAD MODE CTRL */
0x10 0x81000080 /* POWER_ON_STRIP */
0x10 0x81000080 /* POWER_ON_STRAP */
0x50 0xcc35cc35 /* LED_CTRL0 */
0x54 0xcb37cb37 /* LED_CTRL1 */
0x58 0x00000000 /* LED_CTRL2 */

View File

@ -114,7 +114,7 @@
qca,ar8327-initvals = <
0x04 0x00080080 /* PORT0 PAD MODE CTRL */
0x10 0x81000080 /* POWER_ON_STRIP */
0x10 0x81000080 /* POWER_ON_STRAP */
0x50 0xcc35cc35 /* LED_CTRL0 */
0x54 0xcb37cb37 /* LED_CTRL1 */
0x58 0x00000000 /* LED_CTRL2 */

View File

@ -155,7 +155,7 @@
0x04 0x80080080 /* PORT0 PAD MODE CTRL */
0x08 0x00000000 /* PORT5 PAD MODE CTRL */
0x0c 0x00000000 /* PORT6 PAD MODE CTRL */
0x10 0x00000080 /* POWER_ON_STRIP */
0x10 0x00000080 /* POWER_ON_STRAP */
0x7c 0x0000007e /* PORT0_STATUS */
0x94 0x00000200 /* PORT6_STATUS */
>;

View File

@ -42,7 +42,7 @@
qca,ar8327-initvals = <
0x04 0x00080080 /* PORT0 PAD MODE CTRL */
0x10 0x81000080 /* POWER_ON_STRIP */
0x10 0x81000080 /* POWER_ON_STRAP */
0x50 0xcf37cf37 /* LED_CTRL0 */
0x54 0xcf37cf37 /* LED_CTRL1 */
0x58 0xcf37cf37 /* LED_CTRL2 */

View File

@ -135,7 +135,8 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
;;
compex,wpj344-16m)
compex,wpj344-16m|\
compex,wpj563)
ucidef_add_switch "switch0" \
"0@eth0" "3:lan" "2:wan"
;;
@ -383,7 +384,8 @@ ath79_setup_macs()
lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
wan_mac=$(fritz_tffs -n macb -i $(find_mtd_part "tffs (1)"))
;;
compex,wpj344-16m)
compex,wpj344-16m|\
compex,wpj563)
wan_mac=$(mtd_get_mac_binary u-boot 0x2e018)
;;
devolo,magic-2-wifi)

View File

@ -502,6 +502,18 @@ define Device/compex_wpj531-16m
endef
TARGET_DEVICES += compex_wpj531-16m
define Device/compex_wpj563
SOC := qca9563
DEVICE_PACKAGES := kmod-usb2 kmod-usb3
IMAGE_SIZE := 16128k
DEVICE_VENDOR := Compex
DEVICE_MODEL := WPJ563
SUPPORTED_DEVICES += wpj563
IMAGES += cpximg-7a02.bin
IMAGE/cpximg-7a02.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | mkmylofw_16m 0x694 2
endef
TARGET_DEVICES += compex_wpj563
define Device/devolo_dvl1200e
SOC := qca9558
DEVICE_VENDOR := devolo

View File

@ -34,6 +34,10 @@ ath79_setup_macs()
local mac_base="$(cat /sys/firmware/mikrotik/hard_config/mac_base)"
case "$board" in
mikrotik,routerboard-wap-g-5hact2hnd)
label_mac="$mac_base"
lan_mac="$mac_base"
;;
*)
label_mac="$mac_base"
wan_mac="$mac_base"

View File

@ -553,15 +553,15 @@ ar8327_hw_config_pdata(struct ar8xxx_priv *priv,
t = ar8327_get_pad_cfg(pdata->pad6_cfg);
ar8xxx_write(priv, AR8327_REG_PAD6_MODE, t);
pos = ar8xxx_read(priv, AR8327_REG_POWER_ON_STRIP);
pos = ar8xxx_read(priv, AR8327_REG_POWER_ON_STRAP);
new_pos = pos;
led_cfg = pdata->led_cfg;
if (led_cfg) {
if (led_cfg->open_drain)
new_pos |= AR8327_POWER_ON_STRIP_LED_OPEN_EN;
new_pos |= AR8327_POWER_ON_STRAP_LED_OPEN_EN;
else
new_pos &= ~AR8327_POWER_ON_STRIP_LED_OPEN_EN;
new_pos &= ~AR8327_POWER_ON_STRAP_LED_OPEN_EN;
ar8xxx_write(priv, AR8327_REG_LED_CTRL0, led_cfg->led_ctrl0);
ar8xxx_write(priv, AR8327_REG_LED_CTRL1, led_cfg->led_ctrl1);
@ -569,7 +569,7 @@ ar8327_hw_config_pdata(struct ar8xxx_priv *priv,
ar8xxx_write(priv, AR8327_REG_LED_CTRL3, led_cfg->led_ctrl3);
if (new_pos != pos)
new_pos |= AR8327_POWER_ON_STRIP_POWER_ON_SEL;
new_pos |= AR8327_POWER_ON_STRAP_POWER_ON_SEL;
}
if (pdata->sgmii_cfg) {
@ -586,12 +586,12 @@ ar8327_hw_config_pdata(struct ar8xxx_priv *priv,
ar8xxx_write(priv, AR8327_REG_SGMII_CTRL, t);
if (pdata->sgmii_cfg->serdes_aen)
new_pos &= ~AR8327_POWER_ON_STRIP_SERDES_AEN;
new_pos &= ~AR8327_POWER_ON_STRAP_SERDES_AEN;
else
new_pos |= AR8327_POWER_ON_STRIP_SERDES_AEN;
new_pos |= AR8327_POWER_ON_STRAP_SERDES_AEN;
}
ar8xxx_write(priv, AR8327_REG_POWER_ON_STRIP, new_pos);
ar8xxx_write(priv, AR8327_REG_POWER_ON_STRAP, new_pos);
if (pdata->leds && pdata->num_leds) {
int i;

View File

@ -53,10 +53,10 @@
#define AR8327_PAD_RGMII_TXCLK_DELAY_EN BIT(25)
#define AR8327_PAD_RGMII_EN BIT(26)
#define AR8327_REG_POWER_ON_STRIP 0x010
#define AR8327_POWER_ON_STRIP_POWER_ON_SEL BIT(31)
#define AR8327_POWER_ON_STRIP_LED_OPEN_EN BIT(24)
#define AR8327_POWER_ON_STRIP_SERDES_AEN BIT(7)
#define AR8327_REG_POWER_ON_STRAP 0x010
#define AR8327_POWER_ON_STRAP_POWER_ON_SEL BIT(31)
#define AR8327_POWER_ON_STRAP_LED_OPEN_EN BIT(24)
#define AR8327_POWER_ON_STRAP_SERDES_AEN BIT(7)
#define AR8327_REG_INT_STATUS0 0x020
#define AR8327_INT0_VT_DONE BIT(20)

View File

@ -10,22 +10,34 @@ board=$(board_name)
board_config_update
case "$board" in
cubox-i |\
gw51xx |\
gw52xx |\
gw5904 |\
gw5907 |\
gw5910 |\
gw5912 |\
gw5913)
gw,imx6dl-gw51xx |\
gw,imx6dl-gw52xx |\
gw,imx6dl-gw5904 |\
gw,imx6dl-gw5907 |\
gw,imx6dl-gw5910 |\
gw,imx6dl-gw5912 |\
gw,imx6dl-gw5913 |\
gw,imx6q-gw51xx |\
gw,imx6q-gw52xx |\
gw,imx6q-gw5904 |\
gw,imx6q-gw5907 |\
gw,imx6q-gw5910 |\
gw,imx6q-gw5912 |\
gw,imx6q-gw5913 |\
solidrun,cubox-i/dl |\
solidrun,cubox-i/q )
ucidef_set_interface_lan 'eth0'
;;
gw53xx |\
gw54xx |\
gw552x)
gw,imx6dl-gw53xx |\
gw,imx6dl-gw54xx |\
gw,imx6dl-gw552x |\
gw,imx6q-gw53xx |\
gw,imx6q-gw5400-a |\
gw,imx6q-gw54xx |\
gw,imx6q-gw552x )
ucidef_set_interfaces_lan_wan 'eth0' 'eth1'
;;
wandboard)
wand,imx6dl-wandboard )
ucidef_set_interface_wan 'eth0'
;;
esac

View File

@ -2,9 +2,6 @@
# Copyright (C) 2010-2013 OpenWrt.org
#
IMX6_BOARD_NAME=
IMX6_MODEL=
rootpartuuid() {
local cmdline=$(cat /proc/cmdline)
local bootpart=${cmdline##*root=}
@ -31,103 +28,3 @@ apalis_mount_boot() {
mount -o rw,noatime $(bootpart_from_uuid) /boot > /dev/null
}
}
imx6_board_detect() {
local machine
local name
machine=$(cat /proc/device-tree/model)
case "$machine" in
"Gateworks Ventana i.MX6 DualLite/Solo GW51XX" |\
"Gateworks Ventana i.MX6 Dual/Quad GW51XX")
name="gw51xx"
;;
"Gateworks Ventana i.MX6 DualLite/Solo GW52XX" |\
"Gateworks Ventana i.MX6 Dual/Quad GW52XX")
name="gw52xx"
;;
"Gateworks Ventana i.MX6 DualLite/Solo GW53XX" |\
"Gateworks Ventana i.MX6 Dual/Quad GW53XX")
name="gw53xx"
;;
"Gateworks Ventana i.MX6 DualLite/Solo GW54XX" |\
"Gateworks Ventana i.MX6 Dual/Quad GW54XX" |\
"Gateworks Ventana GW5400-A")
name="gw54xx"
;;
"Gateworks Ventana i.MX6 Dual/Quad GW551X" |\
"Gateworks Ventana i.MX6 DualLite/Solo GW551X")
name="gw551x"
;;
"Gateworks Ventana i.MX6 DualLite/Solo GW552X" |\
"Gateworks Ventana i.MX6 Dual/Quad GW552X")
name="gw552x"
;;
"Gateworks Ventana i.MX6 DualLite/Solo GW553X" |\
"Gateworks Ventana i.MX6 Dual/Quad GW553X")
name="gw553x"
;;
"Gateworks Ventana i.MX6 DualLite/Solo GW5904" |\
"Gateworks Ventana i.MX6 Dual/Quad GW5904")
name="gw5904"
;;
"Gateworks Ventana i.MX6 DualLite/Solo GW5907" |\
"Gateworks Ventana i.MX6 Dual/Quad GW5907")
name="gw5907"
;;
"Gateworks Ventana i.MX6 DualLite/Solo GW5910" |\
"Gateworks Ventana i.MX6 Dual/Quad GW5910")
name="gw5910"
;;
"Gateworks Ventana i.MX6 DualLite/Solo GW5912" |\
"Gateworks Ventana i.MX6 Dual/Quad GW5912")
name="gw5912"
;;
"Gateworks Ventana i.MX6 DualLite/Solo GW5913" |\
"Gateworks Ventana i.MX6 Dual/Quad GW5913")
name="gw5913"
;;
"SolidRun Cubox-i Solo/DualLite" |\
"SolidRun Cubox-i Dual/Quad")
name="cubox-i"
;;
"Toradex Apalis iMX6Q/D Module on Ixora Carrier Board" |\
"Toradex Apalis iMX6Q/D Module on Ixora Carrier Board V1.1")
name="apalis,ixora"
;;
"Toradex Apalis iMX6Q/D Module on Apalis Evaluation Board")
name="apalis,eval"
;;
"Wandboard i.MX6 Dual Lite Board")
name="wandboard"
;;
*)
name="generic"
;;
esac
[ -z "$IMX6_BOARD_NAME" ] && IMX6_BOARD_NAME="$name"
[ -z "$IMX6_MODEL" ] && IMX6_MODEL="$machine"
[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
echo "$IMX6_BOARD_NAME" > /tmp/sysinfo/board_name
echo "$IMX6_MODEL" > /tmp/sysinfo/model
}

View File

@ -1,7 +0,0 @@
do_sysinfo_imx6() {
. /lib/imx6.sh
imx6_board_detect
}
boot_hook_add preinit_main do_sysinfo_imx6

View File

@ -6,7 +6,9 @@ move_config() {
local board=$(board_name)
case "$board" in
apalis*)
toradex,apalis_imx6q-eval |\
toradex,apalis_imx6q-ixora |\
toradex,apalis_imx6q-ixora-v1.1 )
if [ -b $(bootpart_from_uuid) ]; then
apalis_mount_boot
[ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" /

View File

@ -8,7 +8,9 @@ RAMFS_COPY_BIN='blkid jffs2reset'
enable_image_metadata_check() {
case "$(board_name)" in
apalis*)
toradex,apalis_imx6q-eval |\
toradex,apalis_imx6q-ixora |\
toradex,apalis_imx6q-ixora-v1.1 )
REQUIRE_IMAGE_METADATA=1
;;
esac
@ -34,13 +36,39 @@ platform_check_image() {
local board=$(board_name)
case "$board" in
apalis*)
return 0
;;
*gw5*)
gw,imx6dl-gw51xx |\
gw,imx6dl-gw52xx |\
gw,imx6dl-gw53xx |\
gw,imx6dl-gw54xx |\
gw,imx6dl-gw551x |\
gw,imx6dl-gw552x |\
gw,imx6dl-gw553x |\
gw,imx6dl-gw5904 |\
gw,imx6dl-gw5907 |\
gw,imx6dl-gw5910 |\
gw,imx6dl-gw5912 |\
gw,imx6dl-gw5913 |\
gw,imx6q-gw51xx |\
gw,imx6q-gw52xx |\
gw,imx6q-gw53xx |\
gw,imx6q-gw5400-a |\
gw,imx6q-gw54xx |\
gw,imx6q-gw551x |\
gw,imx6q-gw552x |\
gw,imx6q-gw553x |\
gw,imx6q-gw5904 |\
gw,imx6q-gw5907 |\
gw,imx6q-gw5910 |\
gw,imx6q-gw5912 |\
gw,imx6q-gw5913 )
nand_do_platform_check $board $1
return $?;
;;
toradex,apalis_imx6q-eval |\
toradex,apalis_imx6q-ixora |\
toradex,apalis_imx6q-ixora-v1.1 )
return 0
;;
esac
echo "Sysupgrade is not yet supported on $board."
@ -51,12 +79,38 @@ platform_do_upgrade() {
local board=$(board_name)
case "$board" in
apalis*)
apalis_do_upgrade "$1"
;;
*gw5*)
gw,imx6dl-gw51xx |\
gw,imx6dl-gw52xx |\
gw,imx6dl-gw53xx |\
gw,imx6dl-gw54xx |\
gw,imx6dl-gw551x |\
gw,imx6dl-gw552x |\
gw,imx6dl-gw553x |\
gw,imx6dl-gw5904 |\
gw,imx6dl-gw5907 |\
gw,imx6dl-gw5910 |\
gw,imx6dl-gw5912 |\
gw,imx6dl-gw5913 |\
gw,imx6q-gw51xx |\
gw,imx6q-gw52xx |\
gw,imx6q-gw53xx |\
gw,imx6q-gw5400-a |\
gw,imx6q-gw54xx |\
gw,imx6q-gw551x |\
gw,imx6q-gw552x |\
gw,imx6q-gw553x |\
gw,imx6q-gw5904 |\
gw,imx6q-gw5907 |\
gw,imx6q-gw5910 |\
gw,imx6q-gw5912 |\
gw,imx6q-gw5913 )
nand_do_upgrade "$1"
;;
toradex,apalis_imx6q-eval |\
toradex,apalis_imx6q-ixora |\
toradex,apalis_imx6q-ixora-v1.1 )
apalis_do_upgrade "$1"
;;
esac
}
@ -64,7 +118,9 @@ platform_copy_config() {
local board=$(board_name)
case "$board" in
apalis*)
toradex,apalis_imx6q-eval |\
toradex,apalis_imx6q-ixora |\
toradex,apalis_imx6q-ixora-v1.1 )
apalis_copy_config
;;
esac
@ -74,7 +130,9 @@ platform_pre_upgrade() {
local board=$(board_name)
case "$board" in
apalis*)
toradex,apalis_imx6q-eval |\
toradex,apalis_imx6q-ixora |\
toradex,apalis_imx6q-ixora-v1.1 )
[ -z "$UPGRADE_BACKUP" ] && {
jffs2reset -y
umount /overlay

View File

@ -14,8 +14,6 @@ CONFIG_GPIO_GENERIC_PLATFORM=y
CONFIG_LANTIQ_ETOP=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_NLS=y
# CONFIG_PSB6970_PHY is not set
# CONFIG_RTL8366_SMI is not set
CONFIG_SGL_ALLOC=y
CONFIG_SOC_AMAZON_SE=y
# CONFIG_SOC_XWAY is not set

View File

@ -194,13 +194,10 @@ CONFIG_PINCTRL_LANTIQ=y
CONFIG_PINCTRL_XWAY=y
CONFIG_POWER_RESET=y
CONFIG_POWER_RESET_SYSCON=y
CONFIG_PSB6970_PHY=y
CONFIG_REGMAP=y
CONFIG_REGMAP_MMIO=y
CONFIG_RESET_CONTROLLER=y
CONFIG_RESET_LANTIQ=y
CONFIG_RTL8366RB_PHY=y
CONFIG_RTL8366_SMI=y
# CONFIG_SERIAL_8250 is not set
CONFIG_SERIAL_LANTIQ=y
# CONFIG_SOC_AMAZON_SE is not set

View File

@ -4,8 +4,6 @@ CONFIG_MTD_NAND_ECC_SW_HAMMING=y
CONFIG_MTD_RAW_NAND=y
CONFIG_MTD_SPLIT_FIRMWARE_NAME="linux"
CONFIG_PINCTRL_FALCON=y
# CONFIG_PSB6970_PHY is not set
# CONFIG_RTL8366_SMI is not set
CONFIG_SOC_FALCON=y
# CONFIG_SOC_XWAY is not set
CONFIG_SPI_FALCON=y

View File

@ -136,8 +136,8 @@
read-only;
};
partition@500000 {
reg = <0x50000 0x003a0000>;
partition@50000 {
reg = <0x50000 0x3a0000>;
label = "kernel";
};
};

View File

@ -155,7 +155,7 @@
reg = <0x20000 0x3d0000>;
};
boardconfig: partition@400000 {
boardconfig: partition@3f0000 {
label = "boardconfig";
reg = <0x3f0000 0x10000>;
read-only;

View File

@ -126,7 +126,7 @@
reg = <0x20000 0x3d0000>;
};
boardconfig: partition@400000 {
boardconfig: partition@3f0000 {
label = "boardconfig";
reg = <0x3f0000 0x10000>;
read-only;

View File

@ -181,7 +181,7 @@
reg = <0x20000 0x7d0000>;
};
boardconfig: partition@400000 {
boardconfig: partition@7f0000 {
label = "boardconfig";
reg = <0x7f0000 0x10000>;
read-only;

View File

@ -119,7 +119,7 @@
reg = <0x20000 0x3d0000>;
};
boardconfig: partition@400000 {
boardconfig: partition@3f0000 {
label = "board_config";
reg = <0x3f0000 0x10000>;
read-only;

View File

@ -245,8 +245,8 @@
read-only;
};
partition@500000 {
reg = <0x50000 0x003a0000>;
partition@50000 {
reg = <0x50000 0x3a0000>;
label = "kernel";
};
};

View File

@ -29,10 +29,13 @@ CONFIG_PCI=y
# CONFIG_PCIE_LANTIQ is not set
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_LANTIQ=y
CONFIG_PSB6970_PHY=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_RTL8306_PHY=y
CONFIG_RTL8366RB_PHY=y
CONFIG_RTL8366S_PHY=y
CONFIG_RTL8366_SMI=y
CONFIG_RTL8367B_PHY=y
CONFIG_RTL8367_PHY=y
CONFIG_SGL_ALLOC=y

View File

@ -22,10 +22,13 @@ CONFIG_PCI=y
# CONFIG_PCIE_LANTIQ is not set
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_LANTIQ=y
CONFIG_PSB6970_PHY=y
CONFIG_REGULATOR=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_RTL8306_PHY=y
CONFIG_RTL8366RB_PHY=y
CONFIG_RTL8366S_PHY=y
CONFIG_RTL8366_SMI=y
CONFIG_RTL8367B_PHY=y
CONFIG_RTL8367_PHY=y
CONFIG_SGL_ALLOC=y

View File

@ -13,18 +13,19 @@ define Device/Default
KERNEL_NAME := zImage
KERNEL_LOADADDR := 0x80008000
KERNEL_ENTRY_POINT := 0x80008000
DEVICE_DTS = $(lastword $(subst _, ,$(1)))
SUPPORTED_DEVICES = $(subst _,$(comma),$(1))
IMAGE_SIZE := 64m
IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \
append-rootfs | pad-rootfs | \
check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata
endef
define Device/ls1021atwr
define Device/fsl_ls1021a-twr
DEVICE_VENDOR := NXP
DEVICE_MODEL := TWR-LS1021A
DEVICE_VARIANT := Default
DEVICE_PACKAGES += layerscape-rcw
DEVICE_DTS := ls1021a-twr
IMAGE/firmware.bin := \
ls-clean | \
ls-append $(1)-rcw.bin | pad-to 1M | \
@ -33,11 +34,10 @@ define Device/ls1021atwr
ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
append-kernel | pad-to 32M | \
append-rootfs | pad-rootfs | check-size
SUPPORTED_DEVICES := fsl,ls1021a-twr
endef
TARGET_DEVICES += ls1021atwr
TARGET_DEVICES += fsl_ls1021a-twr
define Device/ls1021atwr-sdboot
define Device/fsl_ls1021a-twr-sdboot
DEVICE_VENDOR := NXP
DEVICE_MODEL := TWR-LS1021A
DEVICE_VARIANT := SD Card Boot
@ -57,16 +57,16 @@ define Device/ls1021atwr-sdboot
ls-append-sdhead $(1) | pad-to 16M | \
append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata
SUPPORTED_DEVICES := fsl,ls1021a-twr-sdboot
endef
TARGET_DEVICES += ls1021atwr-sdboot
TARGET_DEVICES += fsl_ls1021a-twr-sdboot
define Device/ls1021aiot-sdboot
define Device/fsl_ls1021a-iot-sdboot
DEVICE_VENDOR := NXP
DEVICE_MODEL := LS1021A-IoT
DEVICE_VARIANT := SD Card Boot
DEVICE_DTS := ls1021a-iot
FILESYSTEMS := ext4
SUPPORTED_DEVICES :=
IMAGES := sdcard.img
IMAGE/sdcard.img := \
ls-clean | \
@ -77,4 +77,4 @@ define Device/ls1021aiot-sdboot
append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
append-rootfs | check-size $(LS_SD_IMAGE_SIZE)
endef
TARGET_DEVICES += ls1021aiot-sdboot
TARGET_DEVICES += fsl_ls1021a-iot-sdboot

View File

@ -12,20 +12,21 @@ define Device/Default
KERNEL := kernel-bin | gzip | uImage gzip
KERNEL_LOADADDR := 0x80080000
KERNEL_ENTRY_POINT := 0x80080000
DEVICE_DTS = freescale/$(subst _,-,$(1))
SUPPORTED_DEVICES = $(subst _,$(comma),$(1))
IMAGE_SIZE := 64m
IMAGE/sysupgrade.bin := append-kernel | pad-to 16M | \
append-rootfs | pad-rootfs | \
check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata
endef
define Device/ls1012afrdm
define Device/fsl_ls1012a-frdm
DEVICE_VENDOR := NXP
DEVICE_MODEL := FRDM-LS1012A
DEVICE_PACKAGES += \
layerscape-ppfe \
tfa-ls1012afrdm \
tfa-ls1012a-frdm \
kmod-ppfe
DEVICE_DTS := freescale/fsl-ls1012a-frdm
BLOCKSIZE := 256KiB
IMAGE/firmware.bin := \
ls-clean | \
@ -41,18 +42,16 @@ define Device/ls1012afrdm
check-size $(LS_SYSUPGRADE_IMAGE_SIZE) | append-metadata
KERNEL := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
KERNEL_INITRAMFS := kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb
SUPPORTED_DEVICES := fsl,ls1012a-frdm
endef
TARGET_DEVICES += ls1012afrdm
TARGET_DEVICES += fsl_ls1012a-frdm
define Device/ls1012ardb
define Device/fsl_ls1012a-rdb
DEVICE_VENDOR := NXP
DEVICE_MODEL := LS1012A-RDB
DEVICE_PACKAGES += \
layerscape-ppfe \
tfa-ls1012ardb \
tfa-ls1012a-rdb \
kmod-ppfe
DEVICE_DTS := freescale/fsl-ls1012a-rdb
IMAGE/firmware.bin := \
ls-clean | \
ls-append $(1)-bl2.pbl | pad-to 1M | \
@ -62,16 +61,15 @@ define Device/ls1012ardb
ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
append-kernel | pad-to 32M | \
append-rootfs | pad-rootfs | check-size
SUPPORTED_DEVICES := fsl,ls1012a-rdb
endef
TARGET_DEVICES += ls1012ardb
TARGET_DEVICES += fsl_ls1012a-rdb
define Device/ls1012afrwy
define Device/fsl_ls1012a-frwy-sdboot
DEVICE_VENDOR := NXP
DEVICE_MODEL := FRWY-LS1012A
DEVICE_PACKAGES += \
layerscape-ppfe \
tfa-ls1012afrwy \
tfa-ls1012a-frwy-sdboot \
kmod-ppfe
DEVICE_DTS := freescale/fsl-ls1012a-frwy
FILESYSTEMS := ext4
@ -94,17 +92,16 @@ define Device/ls1012afrwy
ls-append-sdhead $(1) | pad-to 16M | \
append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata
SUPPORTED_DEVICES := fsl,ls1012a-frwy-sdboot
endef
TARGET_DEVICES += ls1012afrwy
TARGET_DEVICES += fsl_ls1012a-frwy-sdboot
define Device/ls1043ardb
define Device/fsl_ls1043a-rdb
DEVICE_VENDOR := NXP
DEVICE_MODEL := LS1043A-RDB
DEVICE_VARIANT := Default
DEVICE_PACKAGES += \
layerscape-fman \
tfa-ls1043ardb \
tfa-ls1043a-rdb \
fmc fmc-eth-config
DEVICE_DTS := freescale/fsl-ls1043a-rdb-sdk
IMAGE/firmware.bin := \
@ -116,17 +113,16 @@ define Device/ls1043ardb
ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
append-kernel | pad-to 32M | \
append-rootfs | pad-rootfs | check-size
SUPPORTED_DEVICES := fsl,ls1043a-rdb
endef
TARGET_DEVICES += ls1043ardb
TARGET_DEVICES += fsl_ls1043a-rdb
define Device/ls1043ardb-sdboot
define Device/fsl_ls1043a-rdb-sdboot
DEVICE_VENDOR := NXP
DEVICE_MODEL := LS1043A-RDB
DEVICE_VARIANT := SD Card Boot
DEVICE_PACKAGES += \
layerscape-fman \
tfa-ls1043ardb-sdboot \
tfa-ls1043a-rdb-sdboot \
fmc fmc-eth-config
DEVICE_DTS := freescale/fsl-ls1043a-rdb-sdk
FILESYSTEMS := ext4
@ -137,7 +133,7 @@ define Device/ls1043ardb-sdboot
ls-append $(1)-bl2.pbl | pad-to 1M | \
ls-append $(1)-fip.bin | pad-to 5M | \
ls-append $(1)-uboot-env.bin | pad-to 9M | \
ls-append ls1043ardb-fman.bin | pad-to 15M | \
ls-append fsl_ls1043a-rdb-fman.bin | pad-to 15M | \
ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
append-rootfs | check-size $(LS_SD_IMAGE_SIZE)
@ -146,17 +142,16 @@ define Device/ls1043ardb-sdboot
ls-append-sdhead $(1) | pad-to 16M | \
append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata
SUPPORTED_DEVICES := fsl,ls1043a-rdb-sdboot
endef
TARGET_DEVICES += ls1043ardb-sdboot
TARGET_DEVICES += fsl_ls1043a-rdb-sdboot
define Device/ls1046ardb
define Device/fsl_ls1046a-rdb
DEVICE_VENDOR := NXP
DEVICE_MODEL := LS1046A-RDB
DEVICE_VARIANT := Default
DEVICE_PACKAGES += \
layerscape-fman \
tfa-ls1046ardb \
tfa-ls1046a-rdb \
fmc fmc-eth-config
DEVICE_DTS := freescale/fsl-ls1046a-rdb-sdk
IMAGE/firmware.bin := \
@ -168,17 +163,16 @@ define Device/ls1046ardb
ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
append-kernel | pad-to 32M | \
append-rootfs | pad-rootfs | check-size
SUPPORTED_DEVICES := fsl,ls1046a-rdb
endef
TARGET_DEVICES += ls1046ardb
TARGET_DEVICES += fsl_ls1046a-rdb
define Device/ls1046ardb-sdboot
define Device/fsl_ls1046a-rdb-sdboot
DEVICE_VENDOR := NXP
DEVICE_MODEL := LS1046A-RDB
DEVICE_VARIANT := SD Card Boot
DEVICE_PACKAGES += \
layerscape-fman \
tfa-ls1046ardb-sdboot \
tfa-ls1046a-rdb-sdboot \
fmc fmc-eth-config
DEVICE_DTS := freescale/fsl-ls1046a-rdb-sdk
FILESYSTEMS := ext4
@ -189,7 +183,7 @@ define Device/ls1046ardb-sdboot
ls-append $(1)-bl2.pbl | pad-to 1M | \
ls-append $(1)-fip.bin | pad-to 5M | \
ls-append $(1)-uboot-env.bin | pad-to 9M | \
ls-append ls1046ardb-fman.bin | pad-to 15M | \
ls-append fsl_ls1046a-rdb-fman.bin | pad-to 15M | \
ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
append-rootfs | check-size $(LS_SD_IMAGE_SIZE)
@ -198,20 +192,18 @@ define Device/ls1046ardb-sdboot
ls-append-sdhead $(1) | pad-to 16M | \
append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata
SUPPORTED_DEVICES := fsl,ls1046a-rdb-sdboot
endef
TARGET_DEVICES += ls1046ardb-sdboot
TARGET_DEVICES += fsl_ls1046a-rdb-sdboot
define Device/ls1088ardb
define Device/fsl_ls1088a-rdb
DEVICE_VENDOR := NXP
DEVICE_MODEL := LS1088A-RDB
DEVICE_VARIANT := Default
DEVICE_PACKAGES += \
layerscape-mc \
layerscape-dpl \
tfa-ls1088ardb \
tfa-ls1088a-rdb \
restool
DEVICE_DTS := freescale/fsl-ls1088a-rdb
IMAGE/firmware.bin := \
ls-clean | \
ls-append $(1)-bl2.pbl | pad-to 1M | \
@ -223,18 +215,17 @@ define Device/ls1088ardb
ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
append-kernel | pad-to 32M | \
append-rootfs | pad-rootfs | check-size
SUPPORTED_DEVICES := fsl,ls1088a-rdb
endef
TARGET_DEVICES += ls1088ardb
TARGET_DEVICES += fsl_ls1088a-rdb
define Device/ls1088ardb-sdboot
define Device/fsl_ls1088a-rdb-sdboot
DEVICE_VENDOR := NXP
DEVICE_MODEL := LS1088A-RDB
DEVICE_VARIANT := SD Card Boot
DEVICE_PACKAGES += \
layerscape-mc \
layerscape-dpl \
tfa-ls1088ardb-sdboot \
tfa-ls1088a-rdb-sdboot \
restool
DEVICE_DTS := freescale/fsl-ls1088a-rdb
FILESYSTEMS := ext4
@ -245,9 +236,9 @@ define Device/ls1088ardb-sdboot
ls-append $(1)-bl2.pbl | pad-to 1M | \
ls-append $(1)-fip.bin | pad-to 5M | \
ls-append $(1)-uboot-env.bin | pad-to 10M | \
ls-append ls1088ardb-mc.itb | pad-to 13M | \
ls-append ls1088ardb-dpl.dtb | pad-to 14M | \
ls-append ls1088ardb-dpc.dtb | pad-to 15M | \
ls-append fsl_ls1088a-rdb-mc.itb | pad-to 13M | \
ls-append fsl_ls1088a-rdb-dpl.dtb | pad-to 14M | \
ls-append fsl_ls1088a-rdb-dpc.dtb | pad-to 15M | \
ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
append-rootfs | check-size $(LS_SD_IMAGE_SIZE)
@ -256,19 +247,17 @@ define Device/ls1088ardb-sdboot
ls-append-sdhead $(1) | pad-to 16M | \
append-kernel | pad-to $(LS_SD_ROOTFSPART_OFFSET)M | \
append-rootfs | check-size $(LS_SD_IMAGE_SIZE) | append-metadata
SUPPORTED_DEVICES := fsl,ls1088a-rdb-sdboot
endef
TARGET_DEVICES += ls1088ardb-sdboot
TARGET_DEVICES += fsl_ls1088a-rdb-sdboot
define Device/ls2088ardb
define Device/fsl_ls2088a-rdb
DEVICE_VENDOR := NXP
DEVICE_MODEL := LS2088ARDB
DEVICE_PACKAGES += \
layerscape-mc \
layerscape-dpl \
tfa-ls2088ardb \
tfa-ls2088a-rdb \
restool
DEVICE_DTS := freescale/fsl-ls2088a-rdb
IMAGE/firmware.bin := \
ls-clean | \
ls-append $(1)-bl2.pbl | pad-to 1M | \
@ -280,11 +269,10 @@ define Device/ls2088ardb
ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
append-kernel | pad-to 32M | \
append-rootfs | pad-rootfs | check-size
SUPPORTED_DEVICES := fsl,ls2088a-rdb
endef
TARGET_DEVICES += ls2088ardb
TARGET_DEVICES += fsl_ls2088a-rdb
define Device/traverse-ls1043
define Device/traverse_ls1043
DEVICE_VENDOR := Traverse
DEVICE_MODEL := LS1043 Boards
KERNEL_NAME := Image
@ -314,4 +302,4 @@ define Device/traverse-ls1043
MKUBIFS_OPTS := -m 2048 -e 124KiB -c 4096
SUPPORTED_DEVICES := traverse,ls1043s traverse,ls1043v
endef
TARGET_DEVICES += traverse-ls1043
TARGET_DEVICES += traverse_ls1043

View File

@ -1,4 +1,4 @@
config BANANA_PI_BOOT_PARTSIZE
int "Boot (SD Card) filesystem partition size (in MiB)"
depends on TARGET_mediatek_mt7623_DEVICE_bpi_bananapi-r2 || TARGET_DEVICE_mediatek_mt7623_DEVICE_bpi_bananapi-r2
config MTK_BOOT_PARTSIZE
int "Boot (SD Card/eMMC) filesystem partition size (in MiB)"
depends on TARGET_mediatek_mt7623_DEVICE_bpi_bananapi-r2 || TARGET_DEVICE_mediatek_mt7623_DEVICE_bpi_bananapi-r2 || TARGET_mediatek_mt7623_DEVICE_unielec_u7623-emmc || TARGET_DEVICE_mediatek_mt7623_DEVICE_unielec_u7623-emmc
default 32

View File

@ -21,21 +21,17 @@ endef
# default all platform image(fit) build
define Device/Default
PROFILES = Default $$(DEVICE_NAME)
KERNEL_NAME := zImage
KERNEL_NAME := Image
KERNEL = kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
KERNEL_INITRAMFS = kernel-bin | lzma | \
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
FILESYSTEMS := squashfs
DEVICE_DTS_DIR := $(DTS_DIR)
IMAGES := sysupgrade.bin
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | pad-rootfs | append-metadata
IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | \
pad-rootfs | append-metadata
SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
ifeq ($(SUBTARGET),mt7623)
KERNEL_NAME := zImage
KERNEL := kernel-bin | append-dtb | uImage none
KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none
else
KERNEL_NAME := Image
KERNEL = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
KERNEL_INITRAMFS = kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
endif
endef
include $(SUBTARGET).mk

View File

@ -1,5 +1,8 @@
#!/bin/sh
#
# This script is used only to create the "legacy" image for UniElec U7623,
# suitable for upgrading from the vendor OpenWrt or from OpenWrt 19.07.
#
OUTPUT_FILE=$1
KERNEL_FILE=$2
RECOVERY_FILE=$3
@ -7,10 +10,19 @@ ROOTFS_FILE=$4
BS=512
#These to offsets are relative to the absolute location of the kernel on the mmc
#(0xA00), so their position in the image is -2560 blocks
RECOVERY_OFFSET=67072
ROOTFS_OFFSET=87552
# These two offsets are relative to the absolute location of the kernel on the mmc
# (0xA00), so their position in the image is -2560 blocks
#
# They must be kept in sync with the default command line for U7623.
# blkdevparts=mmcblk0:3M@6M(recovery),256M@9M(root)"
#
# For upgrading from the vendor firmware, the total image must fit in its
# MTD 'firmware' partition, which is typically 36MiB.
# In the legacy image, the uImage starts at block 0xa00. Allow 4864 KiB (9728) blocks.
RECOVERY_OFFSET=9728
# The recovery image is 3MiB, or 6144 blocks.
ROOTFS_OFFSET=15872
dd bs="$BS" of="$OUTPUT_FILE" if="$KERNEL_FILE"
dd bs="$BS" of="$OUTPUT_FILE" if="$RECOVERY_FILE" seek="$RECOVERY_OFFSET"

View File

@ -27,7 +27,7 @@
# The second partition is a FAT file system containing the kernel
# image and a uboot.env file, which is provided to this script as
# $4 (bootfs image). Its size is configurable with the
# CONFIG_BANANA_PI_BOOT_PARTSIZE option; by default 32MiB.
# CONFIG_MTK_BOOT_PARTSIZE option; by default 32MiB.
#
# The root filesystem comes next in the third partition.
#
@ -56,7 +56,7 @@
# |----------------------|
# | MBR partition #2 |
# | |
# | FAT partition | ( BANANA_PI_BOOT_PARTSIZE
# | FAT partition | ( MTK_BOOT_PARTSIZE
# . . default 32MiB )
# . (kernel, uEnv) .
# | |
@ -79,7 +79,7 @@
# with the preloader loading 512KiB of U-Boot starting at 0x50000.
usage() {
echo "SYNTAX: $0 sd <file> <preloader image> <u-boot image> <bootfs image> <rootfs image> <bootfs size> <rootfs size>"
echo "SYNTAX: $0 sd <file> <preloader image> <u-boot image> <u-boot offset> <bootfs image> <rootfs image> <bootfs size> <rootfs size>"
echo " OR: $0 emmc <file> <preloader image>"
exit 1
}
@ -96,20 +96,21 @@ BRLYT="BRLYT\x00\x00\x00\x01\x00\x00\x00\x00\x08\x00\x00\
case $1 in
sd)
[ $# -eq 8 ] || usage
[ $# -eq 9 ] || usage
OUTPUT="$2"
PRELOADER="$3"
UBOOT="$4"
BOOTFS="$5"
ROOTFS="$6"
BOOTFSSIZE="$7"
ROOTFSSIZE="$8"
UBOOTOFS="$5"
BOOTFS="$6"
ROOTFS="$7"
BOOTFSSIZE="$8"
ROOTFSSIZE="$9"
head=4
sect=63
set $(ptgen -o $OUTPUT -h $head -s $sect -a 0 -l 1024 \
-t 41 -p 512k@320k \
-t 41 -p 512k@${UBOOTOFS} \
-t c -p ${BOOTFSSIZE}M \
-t 83 -p ${ROOTFSSIZE}M )
@ -123,7 +124,11 @@ case $1 in
echo -en "${SDMMC_BOOT}" | dd bs=1 of="${OUTPUT}" seek=0 conv=notrunc
echo -en "${BRLYT}" | dd bs=1 of="${OUTPUT}" seek=512 conv=notrunc
dd bs=1024 if="${PRELOADER}" of="${OUTPUT}" seek="${PRELOADER_OFFSET}" conv=notrunc
# For eMMC-only boards like U7623 the preloader doesn't need to be included in the
# main image as it's only ever needed in the eMMC boot partition.
if [ -r ${PRELOADER} ]; then
dd bs=1024 if="${PRELOADER}" of="${OUTPUT}" seek="${PRELOADER_OFFSET}" conv=notrunc
fi
dd bs=512 if="${UBOOT}" of="${OUTPUT}" seek="${UBOOT_OFFSET}" conv=notrunc
dd bs=512 if="${BOOTFS}" of="${OUTPUT}" seek="${BOOTFS_OFFSET}" conv=notrunc
dd bs=512 if="${ROOTFS}" of="${OUTPUT}" seek="${ROOTFS_OFFSET}" conv=notrunc

View File

@ -0,0 +1,75 @@
#!/bin/sh
#
# Copyright © 2020 David Woodhouse <dwmw2@infradead.org>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# Generate as "scatter file" for use with the MediaTek SP Flash tool for
# writing images to MediaTek boards. This can be used to write images
# even on a bricked board which has no preloader installed, or broken
# U-Boot.
#
# NOTE: At the time of writing (2020-07-20), the Linux tool linked from
# the front page of https://spflashtool.com/ is out of date and does not
# support MT7623. The newer v5.1916 found on the download page at
# https://spflashtool.com/download/ has been tested on UniElec U7623 and
# Banana Pi R2 from Linux, and does work.
#
SOC=$1
IMAGE=${2%.gz}
PROJECT=${3%-scatter.txt}
DEVICENAME="$4"
cat <<EOF
# OpenWrt eMMC scatter file for ${DEVICENAME}
# For use with SP Flash Tool: https://spflashtool.com/download/
#
# Unzip the file system file ${PROJECT}-${IMAGE}.gz before flashing.
# Connect the device's USB port, although it won't appear to the host yet.
# Load this scatter file into the SP Flash Tool, select 'Format All + Download'
# After pressing the 'Download' button, power on the board.
# The /dev/ttyACM0 device should appear on USB and the tool should find it.
- general: MTK_PLATFORM_CFG
info:
- config_version: V1.1.2
platform: ${SOC}
project: ${PROJECT}
storage: EMMC
boot_channel: MSDC_0
block_size: 0x20000
- partition_index: SYS0
partition_name: PRELOADER
file_name: ${PROJECT}-preloader.bin
is_download: true
type: SV5_BL_BIN
linear_start_addr: 0x0
physical_start_addr: 0x0
partition_size: 0x40000
region: EMMC_BOOT_1
storage: HW_STORAGE_EMMC
boundary_check: true
is_reserved: false
operation_type: BOOTLOADERS
d_type: FALSE
reserve: 0x00
- partition_index: SYS1
partition_name: OPENWRT
file_name: ${PROJECT}-${IMAGE}
is_download: true
type: NORMAL_ROM
linear_start_addr: 0x00000
physical_start_addr: 0x00000
partition_size: 0x4000000
region: EMMC_USER
storage: HW_STORAGE_EMMC
boundary_check: true
is_reserved: false
operation_type: UPDATE
d_type: FALSE
reserve: 0x00
EOF

View File

@ -1,53 +1,95 @@
KERNEL_LOADADDR := 0x80008000
DEVICE_VARS += UBOOT_TARGET UBOOT_OFFSET UBOOT_ENVSIZE
ifneq ($(CONFIG_BANANA_PI_BOOT_PARTSIZE),)
ifneq ($(CONFIG_MTK_BOOT_PARTSIZE),)
BOOTFS_BLOCK_SIZE := 1024
BOOTFS_BLOCKS := $(shell echo $$(($(CONFIG_BANANA_PI_BOOT_PARTSIZE)*1024*1024/$(BOOTFS_BLOCK_SIZE))))
BOOTFS_BLOCKS := $(shell echo $$(($(CONFIG_MTK_BOOT_PARTSIZE)*1024*1024/$(BOOTFS_BLOCK_SIZE))))
endif
define Build/banana-pi-sdcard
define Build/mtk-mmc-img
rm -f $@.boot
mkfs.fat -C $@.boot $(BOOTFS_BLOCKS)
./gen_banana_pi_img.sh emmc $@.emmc \
$(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-preloader.bin
mkenvimage -s 0x2000 -o $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-uboot.env $(UBOOT_TARGET)-uEnv.txt
if [ -r $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-preloader.bin ]; then \
./gen_mtk_mmc_img.sh emmc $@.emmc \
$(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-preloader.bin; \
mcopy -i $@.boot $@.emmc ::eMMCboot.bin; \
fi
mkenvimage -s $(UBOOT_ENVSIZE) -o $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-uboot.env $(UBOOT_TARGET)-uEnv.txt
mcopy -i $@.boot $(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-uboot.env ::uboot.env
mcopy -i $@.boot $(IMAGE_KERNEL) ::uImage
mcopy -i $@.boot $@.emmc ::eMMCboot.bin
./gen_banana_pi_img.sh sd $@ \
./gen_mtk_mmc_img.sh sd $@ \
$(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-preloader.bin \
$(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-u-boot.bin \
$(STAGING_DIR_IMAGE)/$(UBOOT_TARGET)-u-boot*.bin \
$(UBOOT_OFFSET) \
$@.boot \
$(IMAGE_ROOTFS) \
$(CONFIG_BANANA_PI_BOOT_PARTSIZE) \
$(CONFIG_MTK_BOOT_PARTSIZE) \
$(CONFIG_TARGET_ROOTFS_PARTSIZE)
endef
define Build/preloader
$(CP) $(STAGING_DIR_IMAGE)/$1-preloader.bin $@
endef
define Build/scatterfile
./gen_scatterfile.sh $(subst mt,MT,$(SUBTARGET)) "$1" \
$(subst -scatter.txt,,$(notdir $@)) "$(DEVICE_TITLE)" > $@
endef
define Device/bpi_bananapi-r2
DEVICE_VENDOR := Bpi
DEVICE_MODEL := Banana Pi R2
DEVICE_DTS := mt7623n-bananapi-bpi-r2
SUPPORTED_DEVICES := bananapi,bpi-r2
DEVICE_PACKAGES := kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 kmod-mmc \
mkf2fs e2fsprogs kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-ata-ahci-mtk
UBOOT_ENVSIZE := 0x2000
UBOOT_OFFSET := 320k
UBOOT_TARGET := mt7623n_bpir2
IMAGES := img.gz
IMAGE/img.gz := banana-pi-sdcard | gzip | append-metadata
KERNEL := kernel-bin | fit none $$(DTS_DIR)/$$(DEVICE_DTS).dtb
KERNEL_INITRAMFS :=
IMAGE/img.gz := mtk-mmc-img | gzip | append-metadata
ARTIFACT/preloader.bin := preloader $$(UBOOT_TARGET)
ARTIFACT/scatter.txt := scatterfile $$(firstword $$(FILESYSTEMS))-$$(firstword $$(IMAGES))
ARTIFACTS = preloader.bin scatter.txt
SUPPORTED_DEVICES := bananapi,bpi-r2
endef
TARGET_DEVICES += bpi_bananapi-r2
define Device/unielec_u7623-02-emmc-512m
# Full eMMC image including U-Boot and partition table
define Device/unielec_u7623-emmc
DEVICE_VENDOR := UniElec
DEVICE_MODEL := U7623
DEVICE_VARIANT := eMMC
# When we use FIT images, U-Boot will populate the /memory node with the correct
# memory size discovered from the preloader, so we don't need separate builds.
DEVICE_DTS := mt7623a-unielec-u7623-02-emmc-512m
SUPPORTED_DEVICES := unielec,u7623-02-emmc-512m
UBOOT_ENVSIZE := 0x1000
UBOOT_OFFSET := 256k
UBOOT_TARGET := mt7623a_unielec_u7623
IMAGES := img.gz
IMAGE/img.gz := mtk-mmc-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 kmod-mmc \
mkf2fs e2fsprogs kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-ata-ahci-mtk
ARTIFACT/scatter.txt := scatterfile $$(firstword $$(FILESYSTEMS))-$$(firstword $$(IMAGES))
ARTIFACTS := scatter.txt
endef
TARGET_DEVICES += unielec_u7623-emmc
# Legacy partial image for U7623
# This preserves the vendor U-Boot and starts with a uImage at 0xA00
define Device/unielec_u7623-02-emmc-512m-legacy
DEVICE_VENDOR := UniElec
DEVICE_MODEL := U7623-02
DEVICE_VARIANT := eMMC/512MB RAM
DEVICE_VARIANT := eMMC/512MiB RAM (legacy image)
DEVICE_DTS := mt7623a-unielec-u7623-02-emmc-512m
IMAGES := sysupgrade-emmc.bin.gz
IMAGE/sysupgrade-emmc.bin.gz := sysupgrade-emmc | gzip | append-metadata
KERNEL_NAME := zImage
KERNEL := kernel-bin | append-dtb | uImage none
KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none
DEVICE_PACKAGES := kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 kmod-mmc \
mkf2fs e2fsprogs kmod-usb-ohci kmod-usb2 kmod-usb3 kmod-ata-ahci-mtk
IMAGES := sysupgrade-emmc.bin.gz
IMAGE/sysupgrade-emmc.bin.gz := sysupgrade-emmc | gzip | append-metadata
SUPPORTED_DEVICES := unielec,u7623-02-emmc-512m
endef
TARGET_DEVICES += unielec_u7623-02-emmc-512m
TARGET_DEVICES += unielec_u7623-02-emmc-512m-legacy

View File

@ -0,0 +1,20 @@
# Boot menu for UniElec U7623
# Copyright © 2020 David Woodhouse <dwmw2@infradead.org>
kernel=uImage
loadaddr=0x88000000
dtaddr=0x83f00000
fdt_high=0xafffffff
console=ttyS0,115200
bootopts=rootfstype=squashfs,ext4 rootwait
# Create the command line (with appropriate root=) and boot the Linux FIT image.
boot1=setenv bootargs "console=${console} root=${rootdev} ${bootopts}";printenv bootargs;\
fatload mmc ${partition} ${loadaddr} ${kernel}; bootm
bootmenu_0=Boot from eMMC.=setenv partition 0:2;setenv rootdev /dev/mmcblk0p3;run boot1
bootmenu_default=0
bootdelay=0
bootcmd=bootmenu

View File

@ -42,16 +42,22 @@ preinit_set_mac_address() {
local rootpart
case $(board_name) in
bananapi,bpi-r2)
bananapi,bpi-r2|\
unielec,u7623-02-emmc-512m)
rootpart=$(cat /proc/cmdline)
rootpart="${rootpart##*root=}"
rootpart="${rootpart%%p3 *}"
if [ "$rootpart" = "/dev/mmcblk0" -o "$rootpart" = "/dev/mmcblk1" ]; then
set_recovery_mac_address ${rootpart}p2
fi
;;
unielec,u7623-02-emmc-512m)
set_recovery_mac_address /dev/mmcblk0p1
rootpart="${rootpart%% *}"
case $rootpart in
/dev/mmcblk0p2) # Legacy U7623 image
set_recovery_mac_address /dev/mmcblk0p1
;;
/dev/mmcblk0p3) # U7623 or Banana Pi R2 eMMC
set_recovery_mac_address /dev/mmcblk0p2
;;
/dev/mmcblk1p3) # Banana Pi R2 SD
set_recovery_mac_address /dev/mmcblk1p2
;;
esac
;;
esac
}

View File

@ -10,7 +10,11 @@ move_config() {
partnum=2
;;
unielec,u7623-02-emmc-512m)
partnum=1
if grep -q root=/dev/mmcblk0p2 /proc/cmdline; then
partnum=1;
else
partnum=2;
fi
;;
*)
return 1

View File

@ -1,92 +1,113 @@
REQUIRE_IMAGE_METADATA=1
# Full system upgrade including preloader for MediaTek SoCs on eMMC or SD
mtk_mmc_full_upgrade() {
local diskdev partdev diff oldrecovery
if grep -q root=/dev/mmcblk0p2 /proc/cmdline; then
oldrecovery=1
else
oldrecovery=2
fi
export_bootdevice && export_partdevice diskdev 0 || {
echo "Unable to determine upgrade device"
return 1
}
#Keep the persistent random mac address (if it exists)
mkdir -p /tmp/recovery
export_partdevice recoverydev $oldrecovery
if mount -o rw,noatime "/dev/$recoverydev" -tvfat /tmp/recovery; then
[ -f "/tmp/recovery/mac_addr" ] && cp /tmp/recovery/mac_addr /tmp/
umount /tmp/recovery
fi
sync
if [ "$SAVE_PARTITIONS" = "1" ]; then
get_partitions "/dev/$diskdev" bootdisk
#extract the boot sector from the image
get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b
get_partitions /tmp/image.bs image
#compare tables
diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)"
else
diff=1
fi
if [ -n "$diff" ]; then
get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync
# Separate removal and addition is necessary; otherwise, partition 1
# will be missing if it overlaps with the old partition 2
partx -d - "/dev/$diskdev"
partx -a - "/dev/$diskdev"
else
# iterate over each partition from the image and write it to the boot disk
while read part start size; do
part="$(($part - 2))"
if export_partdevice partdev $part; then
echo "Writing image to /dev/$partdev..."
get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync
else
echo "Unable to find partition $part device, skipped."
fi
done < /tmp/partmap.image
#copy partition uuid
echo "Writing new UUID to /dev/$diskdev..."
get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync
fi
export_partdevice recoverydev 2
if mount -o rw,noatime "/dev/$recoverydev" -t vfat /tmp/recovery; then
[ -f "/tmp/mac_addr" ] && cp /tmp/mac_addr /tmp/recovery
if [ "$diskdev" = "mmcblk0" -a -r /tmp/recovery/eMMCboot.bin ]; then
echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=/tmp/recovery/eMMCboot.bin of=/dev/mmcblk0boot0 conv=fsync
sync
echo 1 > /sys/block/mmcblk0boot0/force_ro
fi
sync
umount /tmp/recovery
fi
}
platform_do_upgrade() {
local board=$(board_name)
case "$board" in
bananapi,bpi-r2)
local diskdev partdev diff
export_bootdevice && export_partdevice diskdev 0 || {
echo "Unable to determine upgrade device"
return 1
}
#Keep the persistent random mac address (if it exists)
mkdir -p /tmp/recovery
export_partdevice recoverydev 2
if mount -o rw,noatime "/dev/$recoverydev" -tvfat /tmp/recovery; then
[ -f "/tmp/recovery/mac_addr" ] && cp /tmp/recovery/mac_addr /tmp/
umount /tmp/recovery
fi
sync
if [ "$SAVE_PARTITIONS" = "1" ]; then
get_partitions "/dev/$diskdev" bootdisk
#extract the boot sector from the image
get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b
get_partitions /tmp/image.bs image
#compare tables
diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)"
else
diff=1
fi
if [ -n "$diff" ]; then
get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync
# Separate removal and addtion is necessary; otherwise, partition 1
# will be missing if it overlaps with the old partition 2
partx -d - "/dev/$diskdev"
partx -a - "/dev/$diskdev"
else
#iterate over each partition from the image and write it to the boot disk
while read part start size; do
part="$(($part - 2))"
if export_partdevice partdev $part; then
echo "Writing image to /dev/$partdev..."
get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync
else
echo "Unable to find partition $part device, skipped."
fi
done < /tmp/partmap.image
#copy partition uuid
echo "Writing new UUID to /dev/$diskdev..."
get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync
fi
if mount -o rw,noatime "/dev/$recoverydev" -t vfat /tmp/recovery; then
[ -f "/tmp/mac_addr" ] && cp /tmp/mac_addr /tmp/recovery
if [ "$diskdev" = "mmcblk0" -a -r /tmp/recovery/eMMCboot.bin ]; then
echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=/tmp/recovery/eMMCboot.bin of=/dev/mmcblk0boot0 conv=fsync
sync
echo 1 > /sys/block/mmcblk0boot0/force_ro
fi
sync
umount /tmp/recovery
fi
mtk_mmc_full_upgrade "$1"
;;
unielec,u7623-02-emmc-512m)
#Keep the persisten random mac address (if it exists)
mkdir -p /tmp/recovery
mount -o rw,noatime /dev/mmcblk0p1 /tmp/recovery
[ -f "/tmp/recovery/mac_addr" ] && \
mv -f /tmp/recovery/mac_addr /tmp/
umount /tmp/recovery
local magic="$(get_magic_long "$1")"
if [ "$magic" = "53444d4d" ]; then
mtk_mmc_full_upgrade "$1"
else # Old partial image starting with uImage
# Keep the persistent random mac address (if it exists)
recoverydev=mmcblk0p1
mkdir -p /tmp/recovery
mount -o rw,noatime /dev/$recoverydev /tmp/recovery
[ -f "/tmp/recovery/mac_addr" ] && \
mv -f /tmp/recovery/mac_addr /tmp/
umount /tmp/recovery
#1310720 is the offset in bytes from the start of eMMC and to
#the location of the kernel (2560 512 byte sectors)
get_image "$1" | dd of=/dev/mmcblk0 bs=1310720 seek=1 conv=fsync
# 1310720 is the offset in bytes from the start of eMMC and to
# the location of the kernel (2560 512 byte sectors)
get_image "$1" | dd of=/dev/mmcblk0 bs=1310720 seek=1 conv=fsync
mount -o rw,noatime /dev/mmcblk0p1 /tmp/recovery
[ -f "/tmp/mac_addr" ] && mv -f /tmp/mac_addr /tmp/recovery
sync
umount /tmp/recovery
mount -o rw,noatime /dev/$recoverydev /tmp/recovery
[ -f "/tmp/mac_addr" ] && mv -f /tmp/mac_addr /tmp/recovery
sync
umount /tmp/recovery
fi
;;
*)
default_do_upgrade "$1"
@ -133,10 +154,21 @@ platform_check_image() {
fi
;;
unielec,u7623-02-emmc-512m)
# Can always upgrade to the new-style full image
[ "$magic" = "53444d4d" ] && return 0
# Legacy uImage directly at 0xA00 on the eMMC.
[ "$magic" != "27051956" ] && {
echo "Invalid image type."
return 1
}
rootpart=$(cat /proc/cmdline)
rootpart="${rootpart##*root=}"
rootpart="${rootpart%% *}"
[ "$rootpart" != "/dev/mmcblk0p2" ] && {
echo "Cannot downgrade to legacy image."
return 1
}
return 0
;;
*)
@ -148,25 +180,18 @@ platform_check_image() {
return 0
}
platform_copy_config_emmc() {
local partdev
if export_bootdevice && export_partdevice partdev $1; then
mkdir -p /recovery
mount -o rw,noatime "/dev/$partdev" -t vfat /recovery
cp -af "$UPGRADE_BACKUP" "/recovery/$BACKUP_FILE"
sync
umount /recovery
fi
}
platform_copy_config() {
case "$(board_name)" in
bananapi,bpi-r2)
platform_copy_config_emmc 2
;;
bananapi,bpi-r2|\
unielec,u7623-02-emmc-512m)
platform_copy_config_emmc 1
# platform_do_upgrade() will have set $recoverydev
if [ -n "$recoverydev" ]; then
mkdir -p /tmp/recovery
mount -o rw,noatime "/dev/$recoverydev" -t vfat /tmp/recovery
cp -af "$UPGRADE_BACKUP" "/tmp/recovery/$BACKUP_FILE"
sync
umount /tmp/recovery
fi
;;
esac
}

View File

@ -70,6 +70,7 @@ CONFIG_CLKSRC_MMIO=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_CMDLINE="earlyprintk console=ttyS0,115200 rootfstype=squashfs,jffs2"
CONFIG_CMDLINE_FROM_BOOTLOADER=y
CONFIG_CMDLINE_PARTITION=y
CONFIG_COMMON_CLK=y
CONFIG_COMMON_CLK_MEDIATEK=y
CONFIG_COMMON_CLK_MT2701=y

View File

@ -44,7 +44,7 @@ Subject: [PATCH] arm: dts: Add Unielec U7623 DTS
+};
--- /dev/null
+++ b/arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc.dtsi
@@ -0,0 +1,349 @@
@@ -0,0 +1,343 @@
+/*
+ * Copyright 2018 Kristian Evensen <kristian.evensen@gmail.com>
+ *
@ -63,7 +63,7 @@ Subject: [PATCH] arm: dts: Add Unielec U7623 DTS
+ };
+
+ chosen {
+ bootargs = "root=/dev/mmcblk0p2 rootfstype=squashfs,f2fs";
+ bootargs = "root=/dev/mmcblk0p2 rootfstype=squashfs,f2fs console=ttyS0,115200 blkdevparts=mmcblk0:3M@6M(recovery),256M@9M(root)";
+ stdout-path = "serial2:115200n8";
+ };
+
@ -141,12 +141,6 @@ Subject: [PATCH] arm: dts: Add Unielec U7623 DTS
+ default-state = "off";
+ };
+ };
+
+ mt7530: switch@0 {
+ compatible = "mediatek,mt7530";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+};
+
+&crypto {
@ -171,9 +165,9 @@ Subject: [PATCH] arm: dts: Add Unielec U7623 DTS
+ mdio: mdio-bus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ phy5: ethernet-phy@5 {
+ reg = <5>;
+ phy-mode = "rgmii-rxid";
+
+ mt7530: switch@0 {
+ compatible = "mediatek,mt7530";
+ };
+ };
+};

View File

@ -0,0 +1,62 @@
In-Reply-To: <trinity-fb0cdf15-dfcf-4d60-9144-87d8fbfad5ba-1586179542451@3c-app-gmx-bap62>
References: <trinity-fb0cdf15-dfcf-4d60-9144-87d8fbfad5ba-1586179542451@3c-app-gmx-bap62>
Subject: [PATCH] net: ethernet: mtk_eth_soc: Always call mtk_gmac0_rgmii_adjust() for mt7623
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: René van Dorst <opensource@vdorst.com>
Modify mtk_gmac0_rgmii_adjust() so it can always be called.
mtk_gmac0_rgmii_adjust() sets-up the TRGMII clocks.
Signed-off-by: René van Dorst <opensource@vdorst.com>
Signed-off-By: David Woodhouse <dwmw2@infradead.org>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index b5408c5b954a..f89f225ab144 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -171,11 +171,21 @@ static int mt7621_gmac0_rgmii_adjust(struct mtk_eth *eth,
return 0;
}
-static void mtk_gmac0_rgmii_adjust(struct mtk_eth *eth, int speed)
+static void mtk_gmac0_rgmii_adjust(struct mtk_eth *eth,
+ phy_interface_t interface, int speed)
{
u32 val;
int ret;
+ if (interface == PHY_INTERFACE_MODE_TRGMII) {
+ mtk_w32(eth, TRGMII_MODE, INTF_MODE);
+ val = 500000000;
+ ret = clk_set_rate(eth->clks[MTK_CLK_TRGPLL], val);
+ if (ret)
+ dev_err(eth->dev, "Failed to set trgmii pll: %d\n", ret);
+ return;
+ }
+
val = (speed == SPEED_1000) ?
INTF_MODE_RGMII_1000 : INTF_MODE_RGMII_10_100;
mtk_w32(eth, val, INTF_MODE);
@@ -262,10 +272,9 @@ static void mtk_mac_config(struct phylink_config *config, unsigned int mode,
state->interface))
goto err_phy;
} else {
- if (state->interface !=
- PHY_INTERFACE_MODE_TRGMII)
- mtk_gmac0_rgmii_adjust(mac->hw,
- state->speed);
+ mtk_gmac0_rgmii_adjust(mac->hw,
+ state->interface,
+ state->speed);
/* mt7623_pad_clk_setup */
for (i = 0 ; i < NUM_TRGMII_CTRL; i++)
--
2.26.2

View File

@ -97,7 +97,7 @@
0x00004 0x07600000 /* PAD0_MODE */
0x00008 0x00000000 /* PAD5_MODE */
0x0000c 0x01000000 /* PAD6_MODE */
0x00010 0x40000000 /* POWER_ON_STRIP */
0x00010 0x40000000 /* POWER_ON_STRAP */
0x00050 0xcf35cf35 /* LED_CTRL0 */
0x00054 0xcf35cf35 /* LED_CTRL1 */
0x00058 0xcf35cf35 /* LED_CTRL2 */

View File

@ -108,6 +108,7 @@ define Device/linksys_wrt1900ac-v1
DEVICE_DTS := armada-xp-linksys-mamba
DEVICE_PACKAGES += mwlwifi-firmware-88w8864
KERNEL_SIZE := 3072k
DEFAULT := n
endef
TARGET_DEVICES += linksys_wrt1900ac-v1
@ -141,6 +142,7 @@ define Device/linksys_wrt32x
DEVICE_PACKAGES += kmod-btmrvl kmod-mwifiex-sdio mwlwifi-firmware-88w8964
KERNEL_SIZE := 3072k
KERNEL := kernel-bin | append-dtb
DEFAULT := n
endef
TARGET_DEVICES += linksys_wrt32x

View File

@ -6,15 +6,16 @@ define Device/Default
KERNEL_INSTALL := 1
FILESYSTEMS := squashfs ext4
PROFILES := Default
SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
DEVICE_DTS := ox810se-$(subst _,-,$(1))
IMAGES := sysupgrade.tar
IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
endef
define Device/wd-mbwe
DEVICE_DTS := ox810se-wd-mbwe
define Device/wd_mbwe
DEVICE_VENDOR := Western Digital
DEVICE_MODEL := My Book
DEVICE_VARIANT := World Edition
KERNEL := kernel-bin | append-dtb | uImage none
endef
TARGET_DEVICES += wd-mbwe
TARGET_DEVICES += wd_mbwe

View File

@ -0,0 +1,57 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7621_dlink_dir-xx60-a1.dtsi"
/ {
compatible = "dlink,dir-1960-a1", "mediatek,mt7621-soc";
model = "D-Link DIR-1960 A1";
aliases {
led-boot = &led_power_orange;
led-failsafe = &led_power_white;
led-running = &led_power_white;
led-upgrade = &led_net_orange;
};
leds {
compatible = "gpio-leds";
led_power_orange: power_orange {
label = "dir-1960-a1:orange:power";
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
};
led_power_white: power_white {
label = "dir-1960-a1:white:power";
gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
};
led_net_orange: net_orange {
label = "dir-1960-a1:orange:net";
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
};
net_white {
label = "dir-1960-a1:white:net";
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
};
usb_white {
label = "dir-1960-a1:white:usb";
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
trigger-sources = <&xhci_ehci_port1>;
linux,default-trigger = "usbport";
};
};
};
&wifi0 {
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <1>;
};
&wifi1 {
mtd-mac-address = <&factory 0xe000>;
mtd-mac-address-increment = <2>;
};

View File

@ -0,0 +1,163 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
aliases {
label-mac-device = &gmac0;
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
};
&nand {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "Bootloader";
reg = <0x0 0x80000>;
read-only;
};
partition@80000 {
label = "config";
reg = <0x80000 0x80000>;
read-only;
};
factory: partition@100000 {
label = "factory";
reg = <0x100000 0x40000>;
read-only;
};
partition@140000 {
label = "config2";
reg = <0x140000 0x40000>;
read-only;
};
partition@180000 {
label = "firmware";
compatible = "sge,uimage";
reg = <0x180000 0x2800000>;
};
partition@2980000 {
label = "private";
reg = <0x2980000 0x2000000>;
read-only;
};
partition@4980000 {
label = "firmware2";
compatible = "sge,uimage";
reg = <0x4980000 0x2800000>;
};
partition@7180000 {
label = "mydlink";
reg = <0x7180000 0x600000>;
read-only;
};
partition@7780000 {
label = "reserved";
reg = <0x7780000 0x880000>;
read-only;
};
};
};
&pcie {
status = "okay";
};
&pcie0 {
wifi0: wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x0000>;
ieee80211-freq-limit = <2400000 2500000>;
led {
led-active-low;
};
};
};
&pcie1 {
wifi1: wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
led {
led-active-low;
};
};
};
&gmac0 {
mtd-mac-address = <&factory 0xe000>;
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "lan4";
};
port@1 {
status = "okay";
label = "lan3";
};
port@2 {
status = "okay";
label = "lan2";
};
port@3 {
status = "okay";
label = "lan1";
};
port@4 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
};
};
&state_default {
gpio {
groups = "i2c", "uart3", "jtag", "wdt";
function = "gpio";
};
};

View File

@ -0,0 +1,150 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "winstars,ws-wn583a6", "mediatek,mt7621-soc";
model = "Winstars WS-WN583A6";
aliases {
led-boot = &led_status_red;
led-failsafe = &led_status_red;
led-running = &led_status_blue;
led-upgrade = &led_status_red;
};
leds {
compatible = "gpio-leds";
night_light_white {
label = "ws-wn583a6:white:night_light";
gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
};
led_status_blue: status_blue {
label = "ws-wn583a6:blue:status";
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
};
status_amber {
label = "ws-wn583a6:amber:status";
gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
};
led_status_red: status_red {
label = "ws-wn583a6:red:status";
gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <104000000>;
m25p,fast-read;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "bootloader";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "config";
reg = <0x30000 0x10000>;
read-only;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x50000 0x7b0000>;
};
};
};
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x0000>;
};
};
&pcie1 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
};
};
&gmac0 {
mtd-mac-address = <&factory 0xe000>;
};
&switch0 {
ports {
port@0 {
status = "okay";
label = "wan";
mtd-mac-address = <&factory 0xe006>;
};
port@1 {
status = "okay";
label = "lan";
};
};
};
&state_default {
gpio {
groups = "jtag", "wdt", "rgmii2";
function = "gpio";
};
};
&xhci {
status = "disabled";
};

View File

@ -232,6 +232,29 @@ define Device/dlink_dir-8xx-a1
check-size
endef
define Device/dlink_dir-xx60-a1
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_SIZE := 4096k
IMAGE_SIZE := 40960k
UBINIZE_OPTS := -E 5
DEVICE_VENDOR := D-Link
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware wpad-basic \
kmod-usb3 kmod-usb-ledtrig-usbport
KERNEL := $$(KERNEL) | uimage-padhdr 96
IMAGES += factory.bin
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size
endef
define Device/dlink_dir-1960-a1
$(Device/dlink_dir-xx60-a1)
DEVICE_MODEL := DIR-1960
DEVICE_VARIANT := A1
endef
TARGET_DEVICES += dlink_dir-1960-a1
define Device/dlink_dir-860l-b1
$(Device/seama)
BLOCKSIZE := 64k
@ -1018,6 +1041,18 @@ define Device/wevo_w2914ns-v2
endef
TARGET_DEVICES += wevo_w2914ns-v2
define Device/winstars_ws-wn583a6
$(Device/uimage-lzma-loader)
IMAGE_SIZE := 7872k
DEVICE_VENDOR := Winstars
DEVICE_MODEL := WS-WN583A6
DEVICE_ALT0_VENDOR := Gemeita
DEVICE_ALT0_MODEL := AC2100
KERNEL_INITRAMFS_SUFFIX := -WN583A6$$(KERNEL_SUFFIX)
DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware wpad-basic
endef
TARGET_DEVICES += winstars_ws-wn583a6
define Device/xiaomi-ac2100
$(Device/uimage-lzma-loader)
BLOCKSIZE := 128k

View File

@ -26,6 +26,9 @@ d-team,pbr-m1|\
gehua,ghl-r-001)
ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "wan"
;;
dlink,dir-1960-a1)
ucidef_set_led_netdev "wan" "wan" "$boardname:white:net" "wan"
;;
dlink,dir-860l-b1|\
dlink,dir-867-a1|\
dlink,dir-878-a1|\

View File

@ -9,7 +9,8 @@ ramips_setup_interfaces()
local board="$1"
case $board in
asiarf,ap7621-001)
asiarf,ap7621-001|\
winstars,ws-wn583a6)
ucidef_set_interfaces_lan_wan "lan" "wan"
;;
asiarf,ap7621-nv1|\
@ -119,6 +120,7 @@ ramips_setup_macs()
wan_mac=$label_mac
lan_mac=$(macaddr_add $label_mac 1)
;;
winstars,ws-wn583a6|\
zbtlink,zbt-we1326|\
zbtlink,zbt-wg3526-16m|\
zbtlink,zbt-wg3526-32m)

View File

@ -7,9 +7,6 @@ board_config_update
board=$(board_name)
case "$board" in
mikrotik,routerboard-750gr3)
ucidef_add_gpio_switch "poe_passthrough" "PoE Passthrough" "17"
;;
telco-electronics,x1)
ucidef_add_gpio_switch "modem_reset" "Modem Reset" "16"
;;

View File

@ -44,6 +44,7 @@ platform_do_upgrade() {
case "$board" in
asus,rt-ac65p|\
asus,rt-ac85p|\
dlink,dir-1960-a1|\
hiwifi,hc5962|\
linksys,ea7300-v1|\
linksys,ea7500-v2|\