diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile index 63caffec17..a354c9b5c8 100644 --- a/package/boot/arm-trusted-firmware-mediatek/Makefile +++ b/package/boot/arm-trusted-firmware-mediatek/Makefile @@ -464,6 +464,17 @@ define Trusted-Firmware-A/mt7988-ram-comb DEFAULT:=TARGET_mediatek_filogic endef +define Trusted-Firmware-A/mt7988-ram-ddr4 + NAME:=MediaTek MT7988 (RAM/ddr4) + BOOT_DEVICE:=ram + BUILD_SUBTARGET:=filogic + PLAT:=mt7988 + RAM_BOOT_UART_DL:=1 + HIDDEN:= + DEFAULT:=TARGET_mediatek_filogic + DDR_TYPE:=ddr4 +endef + define Trusted-Firmware-A/mt7988-nor-comb NAME:=MediaTek MT7988 (SPI-NOR) BOOT_DEVICE:=nor @@ -522,6 +533,15 @@ define Trusted-Firmware-A/mt7988-spim-nand-ubi-comb USE_UBI:=1 endef +define Trusted-Firmware-A/mt7988-spim-nand-ubi-ddr4 + NAME:=MediaTek MT7988 (SPI-NAND via SPIM, DDR4) + BOOT_DEVICE:=spim-nand + BUILD_SUBTARGET:=filogic + PLAT:=mt7988 + DDR_TYPE:=ddr4 + USE_UBI:=1 +endef + TFA_TARGETS:= \ mt7622-nor-1ddr \ mt7622-nor-2ddr \ @@ -573,13 +593,15 @@ TFA_TARGETS:= \ mt7988-snand-ddr4 \ mt7988-spim-nand-ddr4 \ mt7988-ram-comb \ + mt7988-ram-ddr4 \ mt7988-emmc-comb \ mt7988-nor-comb \ mt7988-sdmmc-comb \ mt7988-snand-comb \ mt7988-snand-ubi-comb \ mt7988-spim-nand-comb \ - mt7988-spim-nand-ubi-comb + mt7988-spim-nand-ubi-comb \ + mt7988-spim-nand-ubi-ddr4 TFA_MAKE_FLAGS += \ BOOT_DEVICE=$(BOOT_DEVICE) \ @@ -609,6 +631,7 @@ Package/trusted-firmware-a-mt7981-ram-ddr4/install = $(Package/trusted-firmware- Package/trusted-firmware-a-mt7986-ram-ddr3/install = $(Package/trusted-firmware-a-ram/install) Package/trusted-firmware-a-mt7986-ram-ddr4/install = $(Package/trusted-firmware-a-ram/install) Package/trusted-firmware-a-mt7988-ram-comb/install = $(Package/trusted-firmware-a-ram/install) +Package/trusted-firmware-a-mt7988-ram-ddr4/install = $(Package/trusted-firmware-a-ram/install) define Package/trusted-firmware-a/install $(INSTALL_DIR) $(STAGING_DIR_IMAGE) diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index b7c1f317a5..b9541b2460 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -822,6 +822,18 @@ define U-Boot/mt7988_arcadyan_mozart DEPENDS:=+trusted-firmware-a-mt7988-emmc-comb endef +define U-Boot/mt7988_asus_zenwifi-bt8 + NAME:=Asus ZenWiFi BT8 + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=asus_zenwifi-bt8-ubootmod + UBOOT_CONFIG:=mt7988a_asus_zenwifi-bt8 + UBOOT_IMAGE:=u-boot.fip + BL2_BOOTDEV:=spim-nand-ubi + BL2_SOC:=mt7988 + BL2_DDRTYPE:=ddr4 + DEPENDS:=+trusted-firmware-a-mt7988-spim-nand-ubi-ddr4 +endef + define U-Boot/mt7988_bananapi_bpi-r4-emmc NAME:=BananaPi BPi-R4 BUILD_SUBTARGET:=filogic @@ -1025,6 +1037,7 @@ UBOOT_TARGETS := \ mt7986_zyxel_ex5601-t0 \ mt7986_rfb \ mt7988_arcadyan_mozart \ + mt7988_asus_zenwifi-bt8 \ mt7988_bananapi_bpi-r4-emmc \ mt7988_bananapi_bpi-r4-sdmmc \ mt7988_bananapi_bpi-r4-snand \ diff --git a/package/boot/uboot-mediatek/patches/461-add-asus-zenwifi-bt8.patch b/package/boot/uboot-mediatek/patches/461-add-asus-zenwifi-bt8.patch new file mode 100644 index 0000000000..ff7487313f --- /dev/null +++ b/package/boot/uboot-mediatek/patches/461-add-asus-zenwifi-bt8.patch @@ -0,0 +1,338 @@ +--- /dev/null ++++ b/configs/mt7988a_asus_zenwifi-bt8_defconfig +@@ -0,0 +1,133 @@ ++CONFIG_ARM=y ++CONFIG_SYS_HAS_NONCACHED_MEMORY=y ++CONFIG_POSITION_INDEPENDENT=y ++CONFIG_ARCH_MEDIATEK=y ++CONFIG_TEXT_BASE=0x41e00000 ++CONFIG_SYS_MALLOC_F_LEN=0x4000 ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_DEFAULT_DEVICE_TREE="mt7988a-asus-zenwifi-bt8" ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_TARGET_MT7988=y ++CONFIG_PRE_CON_BUF_ADDR=0x4007EF00 ++CONFIG_DEBUG_UART_BASE=0x11000000 ++CONFIG_DEBUG_UART_CLOCK=40000000 ++CONFIG_SYS_LOAD_ADDR=0x50000000 ++CONFIG_PCI=y ++CONFIG_DEBUG_UART=y ++CONFIG_AHCI=y ++CONFIG_FIT=y ++CONFIG_BOOTDELAY=30 ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_AUTOBOOT_MENU_SHOW=y ++CONFIG_OF_SYSTEM_SETUP=y ++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7988a-asus-zenwifi-bt8.dtb" ++CONFIG_SYS_CBSIZE=512 ++CONFIG_SYS_PBSIZE=1049 ++CONFIG_LOGLEVEL=7 ++CONFIG_PRE_CONSOLE_BUFFER=y ++CONFIG_LOG=y ++CONFIG_BOARD_LATE_INIT=y ++CONFIG_HUSH_PARSER=y ++CONFIG_SYS_PROMPT="MT7988> " ++CONFIG_CMD_CPU=y ++CONFIG_CMD_LICENSE=y ++# CONFIG_CMD_BOOTEFI_BOOTMGR is not set ++CONFIG_CMD_BOOTMENU=y ++CONFIG_CMD_ASKENV=y ++CONFIG_CMD_ERASEENV=y ++CONFIG_CMD_ENV_FLAGS=y ++CONFIG_CMD_STRINGS=y ++CONFIG_CMD_DM=y ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_PWM=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_MMC=y ++CONFIG_CMD_MTD=y ++CONFIG_CMD_PART=y ++CONFIG_CMD_PCI=y ++CONFIG_CMD_SF_TEST=y ++CONFIG_CMD_USB=y ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_TFTPSRV=y ++CONFIG_CMD_RARP=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_CDP=y ++CONFIG_CMD_SNTP=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_LINK_LOCAL=y ++CONFIG_CMD_PXE=y ++CONFIG_CMD_CACHE=y ++CONFIG_CMD_PSTORE=y ++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 ++CONFIG_CMD_UUID=y ++CONFIG_CMD_HASH=y ++CONFIG_CMD_SMC=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FAT=y ++CONFIG_CMD_FS_GENERIC=y ++CONFIG_CMD_FS_UUID=y ++CONFIG_CMD_UBI=y ++CONFIG_CMD_UBI_RENAME=y ++CONFIG_OF_EMBED=y ++CONFIG_ENV_OVERWRITE=y ++CONFIG_ENV_IS_IN_UBI=y ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++CONFIG_ENV_UBI_PART="ubi" ++CONFIG_ENV_UBI_VOLUME="ubootenv" ++CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2" ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_USE_DEFAULT_ENV_FILE=y ++CONFIG_DEFAULT_ENV_FILE="asus_zenwifi-bt8_env" ++CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y ++CONFIG_VERSION_VARIABLE=y ++CONFIG_NETCONSOLE=y ++CONFIG_USE_IPADDR=y ++CONFIG_IPADDR="192.168.1.1" ++CONFIG_USE_SERVERIP=y ++CONFIG_SERVERIP="192.168.1.254" ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_BUTTON=y ++CONFIG_BUTTON_GPIO=y ++CONFIG_CLK=y ++CONFIG_GPIO_HOG=y ++CONFIG_LED=y ++CONFIG_LED_BLINK=y ++CONFIG_LED_GPIO=y ++CONFIG_MTD=y ++CONFIG_DM_MTD=y ++CONFIG_MTD_SPI_NAND=y ++CONFIG_DM_SPI_FLASH=y ++CONFIG_SPI_FLASH_WINBOND=y ++# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set ++CONFIG_SPI_FLASH_MTD=y ++CONFIG_MTD_UBI_FASTMAP=y ++CONFIG_PHY_FIXED=y ++CONFIG_MEDIATEK_ETH=y ++CONFIG_PCIE_MEDIATEK=y ++CONFIG_PHY=y ++CONFIG_PHY_MTK_TPHY=y ++CONFIG_PINCTRL=y ++CONFIG_PINCONF=y ++CONFIG_PINCTRL_MT7988=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_MTK_POWER_DOMAIN=y ++CONFIG_DM_REGULATOR=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_DM_REGULATOR_GPIO=y ++CONFIG_DM_PWM=y ++CONFIG_PWM_MTK=y ++CONFIG_RAM=y ++CONFIG_SCSI=y ++CONFIG_DM_SERIAL=y ++CONFIG_MTK_SERIAL=y ++CONFIG_SPI=y ++CONFIG_DM_SPI=y ++CONFIG_MTK_SPIM=y ++CONFIG_USB=y ++CONFIG_USB_XHCI_HCD=y ++CONFIG_USB_XHCI_MTK=y ++CONFIG_USB_STORAGE=y ++CONFIG_ZSTD=y ++CONFIG_HEXDUMP=y ++CONFIG_LMB_MAX_REGIONS=64 +--- /dev/null ++++ b/asus_zenwifi-bt8_env +@@ -0,0 +1,56 @@ ++ethaddr_factory=ubi read 0x46000000 factory && env readmem -b ethaddr 0x46000004 0x6 ; setenv ethaddr_factory ++ipaddr=192.168.1.1 ++serverip=192.168.1.254 ++loadaddr=0x50000000 ++bootargs=console=ttyS0,115200n1 pci=pcie_bus_perf root=/dev/fit0 rootwait ubi.block=0,fit ++bootconf=config-1 ++bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi ++bootdelay=0 ++bootfile=immortalwrt-mediatek-filogic-asus_zenwifi-bt8-ubootmod-initramfs-recovery.itb ++bootfile_bl2=immortalwrt-mediatek-filogic-asus_zenwifi-bt8-ubootmod-preloader.bin ++bootfile_fip=immortalwrt-mediatek-filogic-asus_zenwifi-bt8-ubootmod-bl31-uboot.fip ++bootfile_upg=immortalwrt-mediatek-filogic-asus_zenwifi-bt8-ubootmod-squashfs-sysupgrade.itb ++bootled_pwr=green:status ++bootled_rec=red:status ++bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60 ++bootmenu_default=0 ++bootmenu_delay=0 ++bootmenu_title= ( ( ( OpenWrt ) ) ) ++bootmenu_0=Initialize environment.=run _firstboot ++bootmenu_0d=Run default boot command.=run boot_default ++bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return ++bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return ++bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return ++bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return ++bootmenu_7=Load BL2 preloader via TFTP then write to NAND.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return ++bootmenu_8=Reboot.=reset ++bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset ++boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu ++boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever ++boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off ++boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off ++boot_ubi=run boot_production ; run boot_recovery ++boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done ++boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf ++boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run ubi_write_fip && run reset_factory ++boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run snand_write_bl2 ++part_default=production ++part_recovery=recovery ++reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800 ++snand_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr 0x0 0x80000 && mtd write bl2 $loadaddr 0x80000 0x80000 && mtd write bl2 $loadaddr 0x100000 0x80000 && mtd write bl2 $loadaddr 0x180000 0x80000 ++ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic ++ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi ++ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs ++ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery ++ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data ++ubi_write_fip=run ubi_remove_rootfs ; ubi check fip && ubi remove fip ; ubi create fip 0x200000 static ; ubi write $loadaddr fip 0x200000 ++ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic && ubi write $loadaddr fit $filesize ++ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic && ubi write $loadaddr recovery $filesize ++_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv ++_firstboot=setenv _firstboot ; run ethaddr_factory ; run _switch_to_menu ; run _init_env ; run boot_first ++_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title ++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" +--- /dev/null ++++ b/arch/arm/dts/mt7988a-asus-zenwifi-bt8.dts +@@ -0,0 +1,140 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Copyright (c) 2022 MediaTek Inc. ++ * Author: Sam Shih ++ */ ++ ++/dts-v1/; ++#include "mt7988.dtsi" ++#include ++#include ++ ++/ { ++ model = "Asus ZenWiFi BT8"; ++ compatible = "asus,zenwifi-bt8", "mediatek,mt7988"; ++ ++ chosen { ++ stdout-path = &uart0; ++ }; ++ ++ memory@40000000 { ++ device_type = "memory"; ++ reg = <0 0x40000000 0 0x10000000>; ++ }; ++ ++ 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_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; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ reset { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&gpio 13 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wps { ++ label = "wps"; ++ linux,code = ; ++ gpios = <&gpio 14 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led_status_red: led-red { ++ label = "red:status"; ++ gpios = <&gpio 57 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led_status_green: led-green { ++ label = "green:status"; ++ gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ led_status_blue: led-blue { ++ label = "blue:status"; ++ gpios = <&gpio 59 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++}; ++ ++&uart0 { ++ status = "okay"; ++}; ++ ++ð0 { ++ status = "okay"; ++ mediatek,gmac-id = <0>; ++ phy-mode = "usxgmii"; ++ mediatek,switch = "mt7988"; ++ ++ fixed-link { ++ speed = <1000>; ++ full-duplex; ++ pause; ++ }; ++}; ++ ++&pinctrl { ++ spi0_pins: spi0-pins { ++ mux { ++ function = "spi"; ++ groups = "spi0", "spi0_wp_hold"; ++ }; ++ }; ++}; ++ ++&spi0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi0_pins>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ must_tx; ++ enhance_timing; ++ dma_ext; ++ ipm_design; ++ support_quad; ++ tick_dly = <2>; ++ sample_sel = <0>; ++ ++ spi_nand@0 { ++ compatible = "spi-nand"; ++ reg = <0>; ++ spi-max-frequency = <52000000>; ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "bl2"; ++ reg = <0x0 0x200000>; ++ }; ++ ++ partition@200000 { ++ label = "ubi"; ++ reg = <0x200000 0x7e00000>; ++ compatible = "linux,ubi"; ++ }; ++ }; ++ }; ++}; diff --git a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic index 68b8fcffa6..554e7acf03 100644 --- a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic @@ -34,6 +34,7 @@ ubootenv_add_ubi_default() { case "$board" in abt,asr3000|\ +asus,zenwifi-bt8-ubootmod|\ cetron,ct3003-ubootmod|\ cmcc,a10-ubootmod|\ cudy,tr3000-v1-ubootmod|\ diff --git a/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8-ubootmod.dts b/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8-ubootmod.dts new file mode 100644 index 0000000000..bee997f3db --- /dev/null +++ b/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8-ubootmod.dts @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +#include "mt7988d-asus-zenwifi-bt8.dtsi" + +/ { + model = "ASUS ZenWiFi BT8 (U-Boot mod)"; + compatible = "asus,zenwifi-bt8-ubootmod", "mediatek,mt7988a"; + + chosen { + rootdisk = <&ubi_fit_volume>; + stdout-path = "serial0:115200n8"; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand: spi_nand@0 { + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <52000000>; + spi-tx-buswidth = <4>; + spi-rx-buswidth = <4>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x200000>; + label = "bl2"; + read-only; + }; + + partition@200000 { + reg = <0x200000 0x7e00000>; + compatible = "linux,ubi"; + label = "UBI_DEV"; + + volumes { + ubi_factory: ubi-volume-factory { + volname = "factory"; + }; + + ubi_fit_volume: ubi-volume-fit { + volname = "fit"; + }; + }; + }; + }; + }; +}; + +&ubi_factory { + ASUS_BT8_NVMEM_LAYOUT; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + nvmem-cells = <&macaddr_factory_a>; + nvmem-cell-names = "mac-address"; +}; + +&gmac2 { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; +}; + +&mt7996_wifi { + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + + band@0 { + /* 2.4 GHz */ + reg = <0>; + nvmem-cells = <&macaddr_factory_fffee>; + nvmem-cell-names = "mac-address"; + }; + + band@1 { + /* 5 GHz */ + reg = <1>; + nvmem-cells = <&macaddr_factory_ffff4>; + nvmem-cell-names = "mac-address"; + }; + + band@2 { + /* 6 GHz */ + reg = <2>; + nvmem-cells = <&macaddr_factory_ffffa>; + nvmem-cell-names = "mac-address"; + }; +}; diff --git a/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dts b/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dts new file mode 100644 index 0000000000..b2cb1ceb72 --- /dev/null +++ b/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dts @@ -0,0 +1,96 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +#include "mt7988d-asus-zenwifi-bt8.dtsi" + +/ { + model = "ASUS ZenWiFi BT8"; + compatible = "asus,zenwifi-bt8", "mediatek,mt7988a"; + + chosen { + bootargs-override = "earlycon=uart8250,mmio32,0x11000000 console=ttyS0,115200n8"; + stdout-path = "serial0:115200n8"; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand: spi_nand@0 { + compatible = "u-boot-dont-touch-spi-nand"; + reg = <0>; + spi-max-frequency = <52000000>; + spi-tx-buswidth = <4>; + spi-rx-buswidth = <4>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + reg = <0x0 0x400000>; + label = "Bootloader"; + read-only; + }; + + partition@400000 { + reg = <0x400000 0x7c00000>; + compatible = "linux,ubi"; + label = "UBI_DEV"; + + volumes { + ubi_factory: ubi-volume-factory { + volname = "Factory"; + }; + }; + }; + }; + }; +}; + +&ubi_factory { + ASUS_BT8_NVMEM_LAYOUT; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + nvmem-cells = <&macaddr_factory_a>; + nvmem-cell-names = "mac-address"; +}; + +&gmac2 { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; +}; + +&mt7996_wifi { + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + + band@0 { + /* 2.4 GHz */ + reg = <0>; + nvmem-cells = <&macaddr_factory_fffee>; + nvmem-cell-names = "mac-address"; + }; + + band@1 { + /* 5 GHz */ + reg = <1>; + nvmem-cells = <&macaddr_factory_ffff4>; + nvmem-cell-names = "mac-address"; + }; + + band@2 { + /* 6 GHz */ + reg = <2>; + nvmem-cells = <&macaddr_factory_ffffa>; + nvmem-cell-names = "mac-address"; + }; +}; diff --git a/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dtsi b/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dtsi new file mode 100644 index 0000000000..a8de1ee99a --- /dev/null +++ b/target/linux/mediatek/dts/mt7988d-asus-zenwifi-bt8.dtsi @@ -0,0 +1,369 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; + +#include "mt7988a.dtsi" +#include +#include +#include +#include +#include + +#define ASUS_BT8_NVMEM_LAYOUT \ + nvmem-layout { \ + compatible = "fixed-layout"; \ + #address-cells = <1>; \ + #size-cells = <1>; \ + \ + eeprom_factory_0: eeprom@0 { \ + reg = <0x0 0x1e00>; \ + }; \ + \ + macaddr_factory_4: macaddr@4 { \ + reg = <0x4 0x6>; \ + }; \ + \ + macaddr_factory_a: macaddr@a { \ + reg = <0xa 0x6>; \ + }; \ + \ + macaddr_factory_fffee: macaddr@fffee { \ + reg = <0xfffee 0x6>; \ + }; \ + \ + macaddr_factory_ffff4: macaddr@ffff4 { \ + reg = <0xffff4 0x6>; \ + }; \ + \ + macaddr_factory_ffffa: macaddr@ffffa { \ + reg = <0xffffa 0x6>; \ + }; \ + \ + pin@101180 { \ + reg = <0x101180 0x8>; \ + }; \ + \ + hwid@110e00 { \ + reg = <0x110e00 0x1>; \ + }; \ + \ + hwrev@110e04 { \ + reg = <0x110e04 0x4>; \ + }; \ + \ + board@110e0c { \ + reg = <0x110e0c 0x20>; \ + }; \ + \ + mfgdate@110e3e { \ + reg = <0x110e3e 0x8>; \ + }; \ + \ + market@110f90 { \ + reg = <0x110f90 0x5>; \ + }; \ + \ + model@110fb0 { \ + reg = <0x110fb0 0x10>; \ + }; \ + \ + serial@110ff0 { \ + reg = <0x110ff0 0x10>; \ + }; \ + \ + eeprom-version@15480f { \ + reg = <0x15480f 0x1>; \ + }; \ + } + +/ { + aliases { + serial0 = &uart0; + label-mac-device = &gmac0; + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_green; + led-upgrade = &led_status_blue; + }; + + memory { + reg = <0x0 0x40000000 0x0 0x40000000>; + }; + + cpus { + /delete-node/ cpu@3; + }; + + 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; + }; + + gpio-keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&button_pins>; + + factory { + label = "reset"; + linux,code = ; + gpios = <&pio 13 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "sync"; + linux,code = ; + gpios = <&pio 14 GPIO_ACTIVE_LOW>; + }; + }; + + pwm-leds { + compatible = "pwm-leds"; + + led_status_red: led-0 { + color = ; + function = LED_FUNCTION_STATUS; + pwms = <&pwm 0 10000>; + }; + + led_status_green: led-1 { + color = ; + function = LED_FUNCTION_STATUS; + pwms = <&pwm 1 10000>; + }; + + led_status_blue: led-2 { + color = ; + function = LED_FUNCTION_STATUS; + pwms = <&pwm 3 10000>; + }; + }; +}; + +&cpu0 { + proc-supply = <&rt5190_buck3>; +}; + +&cpu1 { + proc-supply = <&rt5190_buck3>; +}; + +&cpu2 { + proc-supply = <&rt5190_buck3>; +}; + +&cci { + proc-supply = <&rt5190_buck3>; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&mdio0_pins>; + status = "okay"; +}; + +&gmac0 { + status = "okay"; +}; + +&gmac1 { + phy-mode = "internal"; + phy-connection-type = "internal"; + phy = <&int_2p5g_phy>; + + openwrt,netdev-name = "wan"; + + status = "okay"; +}; + +&int_2p5g_phy { + pinctrl-names = "i2p5gbe-led"; + pinctrl-0 = <&i2p5gbe_led0_pins>; +}; + +&gmac2 { + phy-mode = "2500base-x"; + phy = <&phy5>; + + openwrt,netdev-name = "lan3"; + + status = "okay"; +}; + +&gsw_phy0 { + status = "disabled"; +}; + +&i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + status = "okay"; + + rt5190a_64: rt5190a@64 { + compatible = "richtek,rt5190a"; + reg = <0x64>; + /*interrupts-extended = <&gpio26 0 IRQ_TYPE_LEVEL_LOW>;*/ + vin2-supply = <&rt5190_buck1>; + vin3-supply = <&rt5190_buck1>; + vin4-supply = <&rt5190_buck1>; + + regulators { + rt5190_buck1: buck1 { + regulator-name = "rt5190a-buck1"; + regulator-min-microvolt = <5090000>; + regulator-max-microvolt = <5090000>; + regulator-allowed-modes = + ; + regulator-boot-on; + regulator-always-on; + }; + + buck2 { + regulator-name = "vcore"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1400000>; + regulator-boot-on; + regulator-always-on; + }; + + rt5190_buck3: buck3 { + regulator-name = "vproc"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1400000>; + regulator-boot-on; + }; + + buck4 { + regulator-name = "rt5190a-buck4"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <850000>; + regulator-allowed-modes = + ; + regulator-boot-on; + regulator-always-on; + }; + + ldo { + regulator-name = "rt5190a-ldo"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-boot-on; + regulator-always-on; + }; + }; + }; +}; + +&mdio_bus { + phy5: ethernet-phy@5 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <5>; + + reset-gpios = <&pio 0 GPIO_ACTIVE_LOW>; + reset-assert-us = <200000>; + reset-deassert-us = <2000000>; + }; +}; + +&pcie0 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie0_1_pins>; + reset-gpios = <&pio 7 GPIO_ACTIVE_LOW>; + status = "okay"; + + pcie@0,0 { + reg = <0x0000 0 0 0 0>; + + mt7996_wifi: mt7996@0,0 { + reg = <0x0000 0 0 0 0>; + }; + }; +}; + +&pcie3 { + pinctrl-names = "default"; + pinctrl-0 = <&pcie3_pins>; + status = "okay"; +}; + +&pio { + button_pins: button-pins { + pins = "GPIO_RESET", "GPIO_WPS"; + mediatek,pull-down-adv = <0>; /* bias-disable */ + }; + + pcie0_1_pins: pcie0-pins-g1 { + mux { + function = "pcie"; + groups = "pcie_2l_0_pereset", "pcie_clk_req_n0_0"; + }; + }; + + pwm_pins: pwm-pins { + mux { + function = "pwm"; + groups = "pwm0", "pwm1", "pwm3_0"; + }; + }; +}; + +&ssusb1 { + status = "okay"; +}; + +&switch { + status = "okay"; + + ports { + port@0 { + status = "disabled"; + }; + + port@1 { + label = "lan2"; + }; + + port@2 { + label = "lan1"; + }; + + port@3 { + status = "disabled"; + }; + }; +}; + +&tphy { + status = "okay"; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&xphy { + status = "okay"; +}; + +&pwm { + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pins>; + status = "okay"; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 239de40895..53a2eeb79f 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -33,6 +33,8 @@ mediatek_setup_interfaces() ucidef_set_interfaces_lan_wan "lan0 eth1" eth2 ;; asus,rt-ax59u|\ + asus,zenwifi-bt8|\ + asus,zenwifi-bt8-ubootmod|\ cetron,ct3003|\ cetron,ct3003-ubootmod|\ cmcc,a10-stock|\ diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index 3b741b5d19..d2eb9b9a49 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -67,6 +67,7 @@ platform_do_upgrade() { case "$board" in abt,asr3000|\ + asus,zenwifi-bt8-ubootmod|\ bananapi,bpi-r3|\ bananapi,bpi-r3-mini|\ bananapi,bpi-r4|\ @@ -124,7 +125,8 @@ platform_do_upgrade() { ;; asus,rt-ax59u|\ asus,tuf-ax4200|\ - asus,tuf-ax6000) + asus,tuf-ax6000|\ + asus,zenwifi-bt8) CI_UBIPART="UBI_DEV" CI_KERNPART="linux" nand_do_upgrade "$1" @@ -198,6 +200,7 @@ platform_check_image() { [ "$#" -gt 1 ] && return 1 case "$board" in + asus,zenwifi-bt8-ubootmod|\ bananapi,bpi-r3|\ bananapi,bpi-r3-mini|\ bananapi,bpi-r4|\ @@ -272,7 +275,8 @@ platform_pre_upgrade() { case "$board" in asus,rt-ax59u|\ asus,tuf-ax4200|\ - asus,tuf-ax6000) + asus,tuf-ax6000|\ + asus,zenwifi-bt8) asus_initial_setup ;; xiaomi,mi-router-ax3000t|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 9b665e8cbc..26ef80ab50 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -294,6 +294,50 @@ define Device/asus_tuf-ax6000 endef TARGET_DEVICES += asus_tuf-ax6000 +define Device/asus_zenwifi-bt8 + DEVICE_VENDOR := ASUS + DEVICE_MODEL := ZenWiFi BT8 + DEVICE_DTS := mt7988d-asus-zenwifi-bt8 + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-usb3 mt7988-2p5g-phy-firmware kmod-mt7996-firmware mt7988-wo-firmware + KERNEL := kernel-bin | gzip | \ + fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + KERNEL_LOADADDR := 0x48080000 + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + ARTIFACTS := factory.bin + ARTIFACT/factory.bin := append-image initramfs-kernel.bin | uImage lzma +endif +endef +TARGET_DEVICES += asus_zenwifi-bt8 + +define Device/asus_zenwifi-bt8-ubootmod + DEVICE_VENDOR := ASUS + DEVICE_MODEL := ZenWiFi BT8 + DEVICE_VARIANT := U-Boot mod + DEVICE_DTS := mt7988d-asus-zenwifi-bt8-ubootmod + DEVICE_DTS_DIR := ../dts + DEVICE_DTS_LOADADDR := 0x45f00000 + DEVICE_PACKAGES := kmod-usb3 mt7988-2p5g-phy-firmware kmod-mt7996-firmware mt7988-wo-firmware + ARTIFACTS := preloader.bin bl31-uboot.fip + ARTIFACT/preloader.bin := mt7988-bl2 spim-nand-ubi-ddr4 + ARTIFACT/bl31-uboot.fip := mt7988-bl31-uboot asus_zenwifi-bt8 + KERNEL := kernel-bin | gzip + KERNEL_INITRAMFS := kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k + KERNEL_INITRAMFS_SUFFIX := -recovery.itb + KERNEL_LOADADDR := 0x46000000 + KERNEL_IN_UBI := 1 + UBOOTENV_IN_UBI := 1 + IMAGES := sysupgrade.itb + IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | pad-rootfs | append-metadata +endef +TARGET_DEVICES += asus_zenwifi-bt8-ubootmod + + define Device/bananapi_bpi-r3 DEVICE_VENDOR := Bananapi DEVICE_MODEL := BPi-R3 diff --git a/tools/libressl/Makefile b/tools/libressl/Makefile index 45d5c73aee..f2de5e28be 100644 --- a/tools/libressl/Makefile +++ b/tools/libressl/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libressl -PKG_VERSION:=4.0.0 -PKG_HASH:=4d841955f0acc3dfc71d0e3dd35f283af461222350e26843fea9731c0246a1e4 +PKG_VERSION:=3.7.3 +PKG_HASH:=7948c856a90c825bd7268b6f85674a8dcd254bae42e221781b24e3f8dc335db3 PKG_CPE_ID:=cpe:/a:openbsd:libressl diff --git a/tools/libressl/patches/010-static.patch b/tools/libressl/patches/010-static.patch deleted file mode 100644 index f5a8711fe3..0000000000 --- a/tools/libressl/patches/010-static.patch +++ /dev/null @@ -1,99 +0,0 @@ ---- a/crypto/ec/ec_kmeth.c -+++ b/crypto/ec/ec_kmeth.c -@@ -74,12 +74,12 @@ static const EC_KEY_METHOD openssl_ec_ke - .keygen = ec_key_gen, - .compute_key = ecdh_compute_key, - -- .sign = ecdsa_sign, -- .sign_setup = ecdsa_sign_setup, -- .sign_sig = ecdsa_sign_sig, -+ .sign = libressl_ecdsa_sign, -+ .sign_setup = libressl_ecdsa_sign_setup, -+ .sign_sig = libressl_ecdsa_sign_sig, - -- .verify = ecdsa_verify, -- .verify_sig = ecdsa_verify_sig, -+ .verify = libressl_ecdsa_verify, -+ .verify_sig = libressl_ecdsa_verify_sig, - }; - - const EC_KEY_METHOD *default_ec_key_meth = &openssl_ec_key_method; ---- a/crypto/ec/ec_local.h -+++ b/crypto/ec/ec_local.h -@@ -342,9 +342,9 @@ struct ec_key_method_st { - int ec_key_gen(EC_KEY *eckey); - int ecdh_compute_key(unsigned char **out, size_t *out_len, - const EC_POINT *pub_key, const EC_KEY *ecdh); --int ecdsa_verify(int type, const unsigned char *dgst, int dgst_len, -+int libressl_ecdsa_verify(int type, const unsigned char *dgst, int dgst_len, - const unsigned char *sigbuf, int sig_len, EC_KEY *eckey); --int ecdsa_verify_sig(const unsigned char *dgst, int dgst_len, -+int libressl_ecdsa_verify_sig(const unsigned char *dgst, int dgst_len, - const ECDSA_SIG *sig, EC_KEY *eckey); - - /* ---- a/crypto/ecdsa/ecdsa.c -+++ b/crypto/ecdsa/ecdsa.c -@@ -217,7 +217,7 @@ ecdsa_prepare_digest(const unsigned char - } - - int --ecdsa_sign(int type, const unsigned char *digest, int digest_len, -+libressl_ecdsa_sign(int type, const unsigned char *digest, int digest_len, - unsigned char *signature, unsigned int *signature_len, const BIGNUM *kinv, - const BIGNUM *r, EC_KEY *key) - { -@@ -266,7 +266,7 @@ LCRYPTO_ALIAS(ECDSA_sign); - */ - - int --ecdsa_sign_setup(EC_KEY *key, BN_CTX *in_ctx, BIGNUM **out_kinv, BIGNUM **out_r) -+libressl_ecdsa_sign_setup(EC_KEY *key, BN_CTX *in_ctx, BIGNUM **out_kinv, BIGNUM **out_r) - { - const EC_GROUP *group; - EC_POINT *point = NULL; -@@ -517,7 +517,7 @@ ecdsa_compute_s(BIGNUM **out_s, const BI - */ - - ECDSA_SIG * --ecdsa_sign_sig(const unsigned char *digest, int digest_len, -+libressl_ecdsa_sign_sig(const unsigned char *digest, int digest_len, - const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *key) - { - BN_CTX *ctx = NULL; -@@ -600,7 +600,7 @@ ECDSA_do_sign(const unsigned char *diges - LCRYPTO_ALIAS(ECDSA_do_sign); - - int --ecdsa_verify(int type, const unsigned char *digest, int digest_len, -+libressl_ecdsa_verify(int type, const unsigned char *digest, int digest_len, - const unsigned char *sigbuf, int sig_len, EC_KEY *key) - { - ECDSA_SIG *s; -@@ -649,7 +649,7 @@ LCRYPTO_ALIAS(ECDSA_verify); - */ - - int --ecdsa_verify_sig(const unsigned char *digest, int digest_len, -+libressl_ecdsa_verify_sig(const unsigned char *digest, int digest_len, - const ECDSA_SIG *sig, EC_KEY *key) - { - const EC_GROUP *group; ---- a/crypto/ecdsa/ecdsa_local.h -+++ b/crypto/ecdsa/ecdsa_local.h -@@ -68,12 +68,12 @@ struct ECDSA_SIG_st { - BIGNUM *s; - }; - --int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *in_ctx, BIGNUM **out_kinv, -+int libressl_ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *in_ctx, BIGNUM **out_kinv, - BIGNUM **out_r); --int ecdsa_sign(int type, const unsigned char *digest, int digest_len, -+int libressl_ecdsa_sign(int type, const unsigned char *digest, int digest_len, - unsigned char *signature, unsigned int *signature_len, const BIGNUM *kinv, - const BIGNUM *r, EC_KEY *eckey); --ECDSA_SIG *ecdsa_sign_sig(const unsigned char *digest, int digest_len, -+ECDSA_SIG *libressl_ecdsa_sign_sig(const unsigned char *digest, int digest_len, - const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *eckey); - - __END_HIDDEN_DECLS