mirror of
https://github.com/VIKINGYFY/immortalwrt.git
synced 2025-12-16 09:10:38 +00:00
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
d3fac62966
@ -471,6 +471,18 @@ define U-Boot/mt7981_livinet_zr-3020
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_netis_nx30v2
|
||||
NAME:=Netis NX30V2
|
||||
BUILD_SUBTARGET:=filogic
|
||||
BUILD_DEVICES:=netis_nx30v2
|
||||
UBOOT_CONFIG:=mt7981_netis_nx30v2
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_BOOTDEV:=spim-nand
|
||||
BL2_SOC:=mt7981
|
||||
BL2_DDRTYPE:=ddr3
|
||||
DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3
|
||||
endef
|
||||
|
||||
define U-Boot/mt7981_netis_nx31
|
||||
NAME:=netis NX31
|
||||
BUILD_SUBTARGET:=filogic
|
||||
@ -1202,6 +1214,7 @@ UBOOT_TARGETS := \
|
||||
mt7981_konka_komi-a31-emmc \
|
||||
mt7981_konka_komi-a31-nor \
|
||||
mt7981_livinet_zr-3020 \
|
||||
mt7981_netis_nx30v2 \
|
||||
mt7981_netis_nx31 \
|
||||
mt7981_nokia_ea0326gmp \
|
||||
mt7981_openwrt_one-snand \
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
+U_BOOT_CMD_COMPLETE(
|
||||
+ readmem, CONFIG_SYS_MAXARGS, 3, do_env_readmem,
|
||||
+ "get environment variable from memory address",
|
||||
+ "name [-b] address size\n"
|
||||
+ "[-b] name address size\n"
|
||||
+ " - store memory address to env variable\n"
|
||||
+ " \"-b\": read binary ethaddr",
|
||||
+ var_complete
|
||||
|
||||
390
package/boot/uboot-mediatek/patches/461-add-netis-nx30v2.patch
Normal file
390
package/boot/uboot-mediatek/patches/461-add-netis-nx30v2.patch
Normal file
@ -0,0 +1,390 @@
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/dts/mt7981-netis-nx30v2.dts
|
||||
@@ -0,0 +1,160@@
|
||||
+// SPDX-License-Identifier: GPL-2.0
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "mt7981.dtsi"
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/input.h>
|
||||
+
|
||||
+/ {
|
||||
+ model = "Netis NX30V2";
|
||||
+ compatible = "mediatek,mt7981", "mediatek,mt7981-rfb";
|
||||
+ chosen {
|
||||
+ stdout-path = &uart0;
|
||||
+ tick-timer = &timer0;
|
||||
+ };
|
||||
+
|
||||
+ memory@40000000 {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x40000000 0x10000000>;
|
||||
+ };
|
||||
+
|
||||
+ gpio-keys {
|
||||
+ compatible = "gpio-keys";
|
||||
+
|
||||
+ reset {
|
||||
+ label = "reset";
|
||||
+ linux,code = <KEY_RESTART>;
|
||||
+ gpios = <&pio 1 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ wps {
|
||||
+ label = "wps";
|
||||
+ linux,code = <KEY_WPS_BUTTON>;
|
||||
+ gpios = <&pio 0 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+
|
||||
+ internet {
|
||||
+ label = "internet";
|
||||
+ gpios = <&pio 7 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ power {
|
||||
+ label = "power";
|
||||
+ gpios = <&pio 4 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ wifi {
|
||||
+ label = "wifi";
|
||||
+ gpios = <&pio 34 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ wps {
|
||||
+ label = "wps";
|
||||
+ gpios = <&pio 5 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ wan {
|
||||
+ label = "wan";
|
||||
+ gpios = <&pio 8 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ };
|
||||
+
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+ð {
|
||||
+ status = "okay";
|
||||
+ mediatek,gmac-id = <0>;
|
||||
+ phy-mode = "2500base-x";
|
||||
+ mediatek,switch = "auto";
|
||||
+ reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
|
||||
+
|
||||
+ fixed-link {
|
||||
+ speed = <2500>;
|
||||
+ full-duplex;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pio {
|
||||
+ spi_flash_pins: spi0-pins-func-1 {
|
||||
+ mux {
|
||||
+ function = "flash";
|
||||
+ groups = "spi0", "spi0_wp_hold";
|
||||
+ };
|
||||
+
|
||||
+ conf-pu {
|
||||
+ pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
|
||||
+ };
|
||||
+
|
||||
+ conf-pd {
|
||||
+ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
|
||||
+ drive-strength = <MTK_DRIVE_8mA>;
|
||||
+ bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&spi0 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ pinctrl-names = "default";
|
||||
+ pinctrl-0 = <&spi_flash_pins>;
|
||||
+ status = "okay";
|
||||
+ 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 0x100000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@100000 {
|
||||
+ label = "u-boot-env";
|
||||
+ reg = <0x100000 0x80000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@180000 {
|
||||
+ label = "Factory";
|
||||
+ reg = <0x180000 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@380000 {
|
||||
+ label = "FIP";
|
||||
+ reg = <0x380000 0x200000>;
|
||||
+ };
|
||||
+
|
||||
+ partition@580000 {
|
||||
+ label = "ubi";
|
||||
+ reg = <0x580000 0x7280000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&watchdog {
|
||||
+ status = "disabled";
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/configs/mt7981_netis_nx30v2_defconfig
|
||||
@@ -0,0 +1,156 @@
|
||||
+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="mt7981-netis-nx30v2"
|
||||
+CONFIG_TARGET_MT7981=y
|
||||
+CONFIG_DEBUG_UART_BASE=0x11002000
|
||||
+CONFIG_DEBUG_UART_CLOCK=40000000
|
||||
+CONFIG_SYS_LOAD_ADDR=0x46000000
|
||||
+CONFIG_DEBUG_UART=y
|
||||
+CONFIG_OF_LIBFDT_OVERLAY=y
|
||||
+CONFIG_SMBIOS_PRODUCT_NAME=""
|
||||
+CONFIG_CFB_CONSOLE_ANSI=y
|
||||
+CONFIG_BOARD_LATE_INIT=y
|
||||
+CONFIG_BUTTON_CMD=y
|
||||
+CONFIG_BUTTON=y
|
||||
+CONFIG_BUTTON_GPIO=y
|
||||
+CONFIG_GPIO_HOG=y
|
||||
+CONFIG_CMD_ENV_FLAGS=y
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_BLINK=y
|
||||
+CONFIG_LED_SW_BLINK=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+CONFIG_SPI_BOOT=y
|
||||
+CONFIG_BOOTSTD_DEFAULTS=y
|
||||
+CONFIG_BOOTSTD_FULL=y
|
||||
+CONFIG_USE_PREBOOT=y
|
||||
+CONFIG_SYS_CBSIZE=512
|
||||
+CONFIG_SYS_PBSIZE=1049
|
||||
+CONFIG_AUTOBOOT_MENU_SHOW=y
|
||||
+CONFIG_LOGLEVEL=7
|
||||
+CONFIG_LOG=y
|
||||
+# CONFIG_BOARD_INIT is not set
|
||||
+CONFIG_SYS_PROMPT="MT7981> "
|
||||
+# CONFIG_BOOTM_NETBSD is not set
|
||||
+# CONFIG_BOOTM_PLAN9 is not set
|
||||
+# CONFIG_BOOTM_RTEMS is not set
|
||||
+# CONFIG_BOOTM_VXWORKS is not set
|
||||
+# CONFIG_CMD_UNLZ4 is not set
|
||||
+# CONFIG_CMD_UNZIP is not set
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+CONFIG_CMD_BOOTP=y
|
||||
+CONFIG_CMD_BUTTON=y
|
||||
+CONFIG_CMD_CACHE=y
|
||||
+CONFIG_CMD_CDP=y
|
||||
+CONFIG_CMD_CPU=y
|
||||
+CONFIG_CMD_DHCP=y
|
||||
+CONFIG_CMD_DFU=y
|
||||
+CONFIG_CMD_DM=y
|
||||
+CONFIG_CMD_ELF=y
|
||||
+CONFIG_CMD_DNS=y
|
||||
+CONFIG_CMD_ECHO=y
|
||||
+CONFIG_CMD_ENV_READMEM=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_FDT=y
|
||||
+CONFIG_CMD_FS_GENERIC=y
|
||||
+CONFIG_CMD_FS_UUID=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_HASH=y
|
||||
+CONFIG_CMD_ITEST=y
|
||||
+CONFIG_CMD_LED=y
|
||||
+CONFIG_CMD_LICENSE=y
|
||||
+CONFIG_CMD_LINK_LOCAL=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_NAND=y
|
||||
+# CONFIG_MTD_RAW_NAND is not set
|
||||
+CONFIG_CMD_NAND_TRIMFFS=y
|
||||
+CONFIG_CMD_PCI=y
|
||||
+CONFIG_CMD_PSTORE=y
|
||||
+CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_PXE=y
|
||||
+CONFIG_CMD_SF=y
|
||||
+CONFIG_CMD_SF_TEST=y
|
||||
+CONFIG_CMD_SMC=y
|
||||
+CONFIG_CMD_UBI=y
|
||||
+CONFIG_CMD_UBI_RENAME=y
|
||||
+CONFIG_CMD_UBIFS=y
|
||||
+CONFIG_CMD_TFTPBOOT=y
|
||||
+CONFIG_CMD_TFTPPUT=y
|
||||
+CONFIG_CMD_TFTPSRV=y
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_RARP=y
|
||||
+CONFIG_CMD_SETEXPR=y
|
||||
+CONFIG_CMD_SLEEP=y
|
||||
+CONFIG_CMD_SNTP=y
|
||||
+CONFIG_CMD_SOURCE=y
|
||||
+CONFIG_CMD_STRINGS=y
|
||||
+CONFIG_CMD_UUID=y
|
||||
+CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_IS_IN_UBI=y
|
||||
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||
+CONFIG_ENV_UBI_PART="ubi"
|
||||
+CONFIG_ENV_SIZE=0x1f000
|
||||
+CONFIG_ENV_SIZE_REDUND=0x1f000
|
||||
+CONFIG_ENV_UBI_VOLUME="ubootenv"
|
||||
+CONFIG_ENV_UBI_VOLUME_REDUND="ubootenv2"
|
||||
+CONFIG_ENV_UBI_VOLUME_CREATE=y
|
||||
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
+CONFIG_ENV_USE_DEFAULT_ENV_TEXT_FILE=y
|
||||
+CONFIG_ENV_DEFAULT_ENV_TEXT_FILE="defenvs/netis_nx30v2.env"
|
||||
+CONFIG_NET_RANDOM_ETHADDR=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_REGEX=y
|
||||
+CONFIG_REGMAP=y
|
||||
+CONFIG_SYSCON=y
|
||||
+CONFIG_CLK=y
|
||||
+# CONFIG_MMC is not set
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+CONFIG_MTD=y
|
||||
+CONFIG_DM_MTD=y
|
||||
+CONFIG_MTD_SPI_NAND=y
|
||||
+CONFIG_DM_SPI_FLASH=y
|
||||
+CONFIG_SPI_FLASH_SFDP_SUPPORT=y
|
||||
+CONFIG_SPI_FLASH_EON=y
|
||||
+CONFIG_SPI_FLASH_GIGADEVICE=y
|
||||
+CONFIG_SPI_FLASH_ISSI=y
|
||||
+CONFIG_SPI_FLASH_MACRONIX=y
|
||||
+CONFIG_SPI_FLASH_SPANSION=y
|
||||
+CONFIG_SPI_FLASH_STMICRO=y
|
||||
+CONFIG_SPI_FLASH_WINBOND=y
|
||||
+CONFIG_SPI_FLASH_XMC=y
|
||||
+CONFIG_SPI_FLASH_XTX=y
|
||||
+CONFIG_SPI_FLASH_MTD=y
|
||||
+CONFIG_PHY_FIXED=y
|
||||
+CONFIG_MEDIATEK_ETH=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_PINCTRL_MT7981=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_MTK_POWER_DOMAIN=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_SERIAL_RX_BUFFER=y
|
||||
+CONFIG_SERIAL_RX_BUFFER_SIZE=256
|
||||
+CONFIG_MTK_SERIAL=y
|
||||
+CONFIG_SPI=y
|
||||
+CONFIG_DM_SPI=y
|
||||
+CONFIG_MTK_SPIM=y
|
||||
+CONFIG_HEXDUMP=y
|
||||
+# CONFIG_EFI_LOADER is not set
|
||||
+CONFIG_LMB_MAX_REGIONS=64
|
||||
+CONFIG_OF_SYSTEM_SETUP=y
|
||||
+CONFIG_UPDATE_COMMON=y
|
||||
+CONFIG_UPDATE_FIT=y
|
||||
+CONFIG_CONSOLE_MUX=y
|
||||
--- /dev/null
|
||||
+++ b/defenvs/netis_nx30v2.env
|
||||
@@ -0,0 +1,64 @@
|
||||
+#misc settings
|
||||
+serverip=192.168.1.254
|
||||
+ipaddr=192.168.1.1
|
||||
+ncip=192.168.1.254
|
||||
+loadaddr=0x46000000
|
||||
+return_bootmenu=askenv - Press ENTER to return to menu ; bootmenu 60
|
||||
+
|
||||
+#file name defines
|
||||
+bootfile_bl2=openwrt-mediatek-filogic-netis_nx30v2-spim-nand-preloader.bin
|
||||
+bootfile_fip=openwrt-mediatek-filogic-netis_nx30v2-spim-nand-bl31-uboot.fip
|
||||
+bootfile_rec=openwrt-mediatek-filogic-netis_nx30v2-initramfs.itb
|
||||
+bootfile_fw=openwrt-mediatek-filogic-netis_nx30v2-squashfs-sysupgrade.itb
|
||||
+
|
||||
+#boot commands
|
||||
+bootconf=config-1
|
||||
+boot_recovery=tftpboot $bootfile_rec && iminfo && bootm $loadaddr#$bootconf
|
||||
+boot_nand=ubi read $loadaddr fit;bootm $loadaddr#$bootconf
|
||||
+bootcmd=run boot_nand; while true; do run boot_recovery; done
|
||||
+
|
||||
+#bootmenu
|
||||
+bootmenu_default=0
|
||||
+bootmenu_0=Startup system (Default)=run bootcmd
|
||||
+bootmenu_1=Upgrade firmware via TFTP=run upgrade_fw ; run return_bootmenu
|
||||
+bootmenu_2=Startup recovery image via TFTP=run boot_recovery ; run return_bootmenu
|
||||
+bootmenu_3=Upgrade BL2 preloader via TFTP=run upgrade_bl2 ; run return_bootmenu
|
||||
+bootmenu_4=Upgrade BL31+U-Boot FIP via TFTP=run upgrade_fip ; run return_bootmenu
|
||||
+bootmenu_5=Reset all settings to factory default.=run reset_all; reset
|
||||
+bootmenu_6=Reboot.=reset
|
||||
+
|
||||
+#upgrade commands
|
||||
+upgrade_bl2=run led_blink_downloading && tftpboot $bootfile_bl2 && run led_blink_writing && nand erase BL2 && nand write $loadaddr BL2; run led_on
|
||||
+upgrade_fip=run led_blink_downloading && tftpboot $bootfile_fip && run led_blink_writing && nand erase FIP && nand write $loadaddr FIP; run led_on
|
||||
+upgrade_fw=run led_blink_downloading && tftpboot $bootfile_fw && iminfo && run led_blink_writing && if ubi check fit; then ubi remove fit; else true; fi && ubi create fit $filesize && ubi write $loadaddr fit $filesize; run led_on
|
||||
+
|
||||
+#restore offical bootloader
|
||||
+offical_download=run led_blink_downloading; setenv failed 1; while test $failed -eq 1; do setenv bl2addr 0x46000000 && tftpboot $bl2addr bl2.img && setenv fipaddr 0x46380000 && tftpboot $fipaddr fip.bin && setenv failed 0; done; setenv customer 0; setenv customeraddr 0x46580000 && tftpboot $customeraddr customer && setenv customer 1; test $failed -eq 0
|
||||
+offical_write=run led_blink_writing; nand erase BL2 && nand write $bl2addr BL2 && nand erase FIP && nand write $fipaddr FIP; ubi detach; mtd erase ubi; ubi part ubi; if test $customer -eq 1; then ubi create customer $filesize; ubi write $customeraddr customer $filesize; fi; true
|
||||
+offical_upgrade=run offical_download offical_write led_on; echo upgrade offical bootloader done; while true; do sleep 10; done
|
||||
+
|
||||
+#factory default
|
||||
+reset_env=env default -a && saveenv
|
||||
+reset_usr=ubi check rootfs_data && ubi remove rootfs_data; run create_rootfs_data
|
||||
+reset_all=run reset_env reset_usr
|
||||
+
|
||||
+#prepare ethaddr and rootfs_data at preload
|
||||
+rootfs_data_max=0x5300000
|
||||
+create_rootfs_data=if env exists rootfs_data_max; then ubi create rootfs_data $rootfs_data_max; else ubi create rootfs_data -; fi
|
||||
+set_ethaddr=mtd read Factory $loadaddr 0x1fe000 0x1000 && setexpr tmpaddr $loadaddr + 0xf20 && mw.b $loadaddr 0 6 && cmp.b $loadaddr $tmpaddr 6 || readmem -b ethaddr $tmpaddr 0x6
|
||||
+preboot=run set_ethaddr; if ubi part; then else mtd erase ubi; ubi part ubi; fi; ubi check rootfs_data || run create_rootfs_data
|
||||
+
|
||||
+#led
|
||||
+led_blink_downloading=led internet blink 100; led wifi blink 100; led wps blink 100
|
||||
+led_blink_writing=led internet blink 1000; led wifi blink 1000; led wps blink 1000
|
||||
+led_on=led internet on; led wifi on; led wps on
|
||||
+
|
||||
+#netconsole
|
||||
+netconsole=setenv stdout serial,nc;setenv stdin serial,nc
|
||||
+nonetconcole=setenv stdout serial;setenv stdin serial
|
||||
+
|
||||
+# button commands
|
||||
+button_cmd_0=run netconsole led_on; sleep 5; if button wps; then run nonetconcole offical_upgrade; fi
|
||||
+button_cmd_0_name=wps
|
||||
+button_cmd_1=run netconsole led_on reset_all; sleep 5; if button reset; then run nonetconcole; while true; do run upgrade_fw && run boot_nand; done; fi
|
||||
+button_cmd_1_name=reset
|
||||
@ -11,25 +11,6 @@ touch /etc/config/ubootenv
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
ubootenv_mtdinfo () {
|
||||
UBOOTENV_PART=$(cat /proc/mtd | grep APPSBLENV)
|
||||
mtd_dev=$(echo $UBOOTENV_PART | awk '{print $1}' | sed 's/:$//')
|
||||
mtd_size=$(echo $UBOOTENV_PART | awk '{print "0x"$2}')
|
||||
mtd_erase=$(echo $UBOOTENV_PART | awk '{print "0x"$3}')
|
||||
nor_flash=$(find /sys/bus/spi/devices/*/mtd -name ${mtd_dev})
|
||||
|
||||
if [ -n "$nor_flash" ]; then
|
||||
ubootenv_size=$mtd_size
|
||||
else
|
||||
# size is fixed to 0x40000 in u-boot
|
||||
ubootenv_size=0x40000
|
||||
fi
|
||||
|
||||
sectors=$(( $ubootenv_size / $mtd_erase ))
|
||||
sectors=$(printf "0x%x" $sectors )
|
||||
echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors
|
||||
}
|
||||
|
||||
case "$board" in
|
||||
alfa-network,ap120c-ac|\
|
||||
devolo,magic-2-wifi-next|\
|
||||
|
||||
@ -12,15 +12,13 @@ touch /etc/config/ubootenv
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
bt,homehub-v2b)
|
||||
bt,homehub-v2b|\
|
||||
siemens,gigaset-sx76x)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1"
|
||||
;;
|
||||
bt,homehub-v3a)
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x4000" "1"
|
||||
;;
|
||||
siemens,gigaset-sx76x)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1"
|
||||
;;
|
||||
zyxel,p-2812hnu-f1)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2000" "0x20000" "1"
|
||||
;;
|
||||
|
||||
@ -36,8 +36,10 @@ livinet,zr-3020-ubootmod|\
|
||||
mercusys,mr90x-v1-ubi|\
|
||||
netcore,n60|\
|
||||
netcore,n60-pro|\
|
||||
netis,nx30v2|\
|
||||
netis,nx31|\
|
||||
nokia,ea0326gmp|\
|
||||
openwrt,one|\
|
||||
qihoo,360t7|\
|
||||
routerich,ax3000-ubootmod|\
|
||||
snr,snr-cpe-ax2|\
|
||||
@ -65,6 +67,16 @@ huasifei,wh3000-emmc|\
|
||||
nradio,c8-668gl)
|
||||
ubootenv_add_mmc "u-boot-env" "" "0x0" "0x80000"
|
||||
;;
|
||||
asiarf,ap7986-003|\
|
||||
cetron,ct3003|\
|
||||
comfast,cf-wr632ax|\
|
||||
edgecore,eap111|\
|
||||
livinet,zr-3020|\
|
||||
netgear,wax220|\
|
||||
zbtlink,zbt-z8102ax|\
|
||||
zbtlink,zbt-z8103ax)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
asus,rt-ax59u)
|
||||
ubootenv_add_uci_config "/dev/mtd0" "0x100000" "0x20000" "0x20000"
|
||||
;;
|
||||
@ -102,16 +114,6 @@ tenbay,wr3000k|\
|
||||
tplink,re6000xd)
|
||||
ubootenv_add_mtd "u-boot-env" "0x0" "0x20000" "0x20000" "1"
|
||||
;;
|
||||
asiarf,ap7986-003|\
|
||||
cetron,ct3003|\
|
||||
comfast,cf-wr632ax|\
|
||||
edgecore,eap111|\
|
||||
livinet,zr-3020|\
|
||||
netgear,wax220|\
|
||||
zbtlink,zbt-z8102ax|\
|
||||
zbtlink,zbt-z8103ax)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
comfast,cf-e393ax|\
|
||||
iptime,ax3000m)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x80000"
|
||||
@ -130,14 +132,14 @@ openembed,som7981)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x80000"
|
||||
ubootenv_add_uci_sys_config "/dev/mtd3" "0x0" "0x100000" "0x100000"
|
||||
;;
|
||||
openwrt,one)
|
||||
ubootenv_add_ubi_default
|
||||
;;
|
||||
smartrg,sdg-8733|\
|
||||
smartrg,sdg-8733a|\
|
||||
smartrg,sdg-8734)
|
||||
ubootenv_add_mmc "u-boot-env" "mmcblk0" "0x0" "0x8000" "0x8000"
|
||||
;;
|
||||
teltonika,rutc50)
|
||||
ubootenv_add_mtd "u-boot-env" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
tplink,archer-ax80-v1|\
|
||||
tplink,be450)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" "8"
|
||||
@ -145,9 +147,6 @@ tplink,be450)
|
||||
ubnt,unifi-6-plus)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x10000"
|
||||
;;
|
||||
teltonika,rutc50)
|
||||
ubootenv_add_mtd "u-boot-env" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
xiaomi,mi-router-ax3000t|\
|
||||
xiaomi,mi-router-wr30u-stock|\
|
||||
xiaomi,redmi-router-ax6000-stock)
|
||||
|
||||
@ -20,10 +20,6 @@ case "$board" in
|
||||
asiarf,ap7622-wh1)
|
||||
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x10000"
|
||||
;;
|
||||
dlink,eagle-pro-ai-m32-a1|\
|
||||
dlink,eagle-pro-ai-r32-a1)
|
||||
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x2000" "0x2000"
|
||||
;;
|
||||
bananapi,bpi-r64|\
|
||||
linksys,e8450-ubi)
|
||||
. /lib/upgrade/fit.sh
|
||||
@ -41,6 +37,10 @@ linksys,e8450-ubi)
|
||||
buffalo,wsr-2533dhp2)
|
||||
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x1000" "0x20000"
|
||||
;;
|
||||
dlink,eagle-pro-ai-m32-a1|\
|
||||
dlink,eagle-pro-ai-r32-a1)
|
||||
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x2000" "0x2000"
|
||||
;;
|
||||
ruijie,rg-ew3200gx-pro)
|
||||
ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
|
||||
@ -15,6 +15,10 @@ zyxel,nbg7815|\
|
||||
zyxel,nwa210ax)
|
||||
ubootenv_add_mtd "0:appsblenv" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
asus,rt-ax89x|\
|
||||
qnap,301w)
|
||||
ubootenv_add_mtd "0:appsblenv" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
dynalink,dl-wrx36|\
|
||||
netgear,rax120v2|\
|
||||
netgear,sxr80|\
|
||||
@ -43,6 +47,9 @@ linksys,mx8500)
|
||||
linksys,mx4300)
|
||||
ubootenv_add_mtd "u_env" "0x0" "0x40000" "0x40000"
|
||||
;;
|
||||
prpl,haze)
|
||||
ubootenv_add_mmc "0:APPSBLENV" "" "0x0" "0x40000" "0x400" "0x100"
|
||||
;;
|
||||
redmi,ax6|\
|
||||
redmi,ax6-stock|\
|
||||
xiaomi,ax3600|\
|
||||
@ -52,13 +59,6 @@ xiaomi,ax9000-stock)
|
||||
ubootenv_add_mtd "0:appsblenv" "0x0" "0x10000" "0x20000"
|
||||
ubootenv_add_sys_mtd "bdata" "0x0" "0x10000" "0x20000"
|
||||
;;
|
||||
prpl,haze)
|
||||
ubootenv_add_mmc "0:APPSBLENV" "" "0x0" "0x40000" "0x400" "0x100"
|
||||
;;
|
||||
asus,rt-ax89x|\
|
||||
qnap,301w)
|
||||
ubootenv_add_mtd "0:appsblenv" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
spectrum,sax1v1k)
|
||||
ubootenv_add_mmc "0:APPSBLENV" "" "0x0" "0x40000" "0x40000" "1"
|
||||
;;
|
||||
|
||||
@ -38,39 +38,13 @@ plasmacloud,pax1800-lite|\
|
||||
yuncore,ax820)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
|
||||
;;
|
||||
arcadyan,we420223-99|\
|
||||
dlink,dir-806a-b1)
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x1000" "0x1000"
|
||||
;;
|
||||
ampedwireless,ally-00x19k|\
|
||||
ampedwireless,ally-r1900k)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
|
||||
;;
|
||||
beeline,smartbox-giga|\
|
||||
beeline,smartbox-turbo|\
|
||||
beeline,smartbox-turbo-plus|\
|
||||
etisalat,s3|\
|
||||
rostelecom,rt-fe-1a|\
|
||||
rostelecom,rt-sf-1)
|
||||
ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
|
||||
;;
|
||||
beeline,smartbox-pro|\
|
||||
tplink,ec330-g5u-v1|\
|
||||
wifire,s1500-nbn)
|
||||
ubootenv_add_mtd "u-boot-env" "0x0" "0x1000" "0x20000"
|
||||
;;
|
||||
buffalo,wsr-1166dhp|\
|
||||
buffalo,wsr-600dhp|\
|
||||
kroks,kndrt31r16|\
|
||||
kroks,kndrt31r19|\
|
||||
mediatek,linkit-smart-7688|\
|
||||
samknows,whitebox-v8|\
|
||||
xiaomi,mi-router-4c|\
|
||||
xiaomi,miwifi-3a|\
|
||||
xiaomi,miwifi-nano|\
|
||||
zbtlink,zbt-wg2626|\
|
||||
zte,mf283plus)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
|
||||
arcadyan,we420223-99|\
|
||||
dlink,dir-806a-b1)
|
||||
ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x1000" "0x1000"
|
||||
;;
|
||||
asus,rt-ax53u|\
|
||||
asus,rt-ax54|\
|
||||
@ -91,16 +65,6 @@ netis,n6|\
|
||||
zyxel,wsm20)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
;;
|
||||
haier,har-20s2u1|\
|
||||
sim,simax1800t|\
|
||||
sim,simax1800u)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
ubootenv_add_uci_sys_config "/dev/mtd1" "0x40000" "0x40000" "0x20000"
|
||||
;;
|
||||
hootoo,ht-tm05|\
|
||||
ravpower,rp-wd03)
|
||||
ubootenv_add_mtd "u-boot-env" "0x4000" "0x1000" "0x1000"
|
||||
;;
|
||||
beeline,smartbox-flash|\
|
||||
iptime,t5004|\
|
||||
linksys,ea6350-v4|\
|
||||
@ -114,14 +78,69 @@ ubnt,edgerouter-x|\
|
||||
ubnt,edgerouter-x-sfp)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
|
||||
;;
|
||||
beeline,smartbox-giga|\
|
||||
beeline,smartbox-turbo|\
|
||||
beeline,smartbox-turbo-plus|\
|
||||
etisalat,s3|\
|
||||
rostelecom,rt-fe-1a|\
|
||||
rostelecom,rt-sf-1)
|
||||
ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
|
||||
;;
|
||||
beeline,smartbox-pro|\
|
||||
tplink,ec330-g5u-v1|\
|
||||
wifire,s1500-nbn)
|
||||
ubootenv_add_mtd "u-boot-env" "0x0" "0x1000" "0x20000"
|
||||
;;
|
||||
bolt,arion|\
|
||||
xiaomi,mi-router-cr6606|\
|
||||
xiaomi,mi-router-cr6608|\
|
||||
xiaomi,mi-router-cr6609)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
|
||||
;;
|
||||
buffalo,wsr-1166dhp|\
|
||||
buffalo,wsr-600dhp|\
|
||||
kroks,kndrt31r16|\
|
||||
kroks,kndrt31r19|\
|
||||
mediatek,linkit-smart-7688|\
|
||||
samknows,whitebox-v8|\
|
||||
xiaomi,mi-router-4c|\
|
||||
xiaomi,miwifi-3a|\
|
||||
xiaomi,miwifi-nano|\
|
||||
zbtlink,zbt-wg2626|\
|
||||
zte,mf283plus)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
|
||||
;;
|
||||
dna,valokuitu-plus-ex400|\
|
||||
genexis,pulse-ex400)
|
||||
ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
|
||||
ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
|
||||
;;
|
||||
haier,har-20s2u1|\
|
||||
sim,simax1800t|\
|
||||
sim,simax1800u)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
ubootenv_add_uci_sys_config "/dev/mtd1" "0x40000" "0x40000" "0x20000"
|
||||
;;
|
||||
hootoo,ht-tm05|\
|
||||
ravpower,rp-wd03)
|
||||
ubootenv_add_mtd "u-boot-env" "0x4000" "0x1000" "0x1000"
|
||||
;;
|
||||
netgear,wax214v2)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
ubootenv_add_uci_sys_config "/dev/mtd1" "0x20000" "0x8000" "0x20000"
|
||||
;;
|
||||
snr,snr-cpe-me1|\
|
||||
snr,snr-cpe-me2-sfp|\
|
||||
snr,cpe-w4n-mt)
|
||||
ubootenv_add_mtd "uboot-env" "0x0" "0x1000" "0x1000"
|
||||
;;
|
||||
xiaomi,miwifi-mini)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
|
||||
ubootenv_add_uci_sys_config "/dev/mtd9" "0x0" "0x4000" "0x10000"
|
||||
xiaomi,mi-router-3-pro|\
|
||||
xiaomi,mi-router-3g|\
|
||||
xiaomi,mi-router-4|\
|
||||
xiaomi,mi-router-ac2100|\
|
||||
xiaomi,redmi-router-ac2100)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
|
||||
ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000"
|
||||
;;
|
||||
xiaomi,mi-router-3g-v2|\
|
||||
xiaomi,mi-router-4a-gigabit|\
|
||||
@ -129,13 +148,9 @@ xiaomi,miwifi-3c)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
|
||||
ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x10000"
|
||||
;;
|
||||
xiaomi,mi-router-3g|\
|
||||
xiaomi,mi-router-3-pro|\
|
||||
xiaomi,mi-router-4|\
|
||||
xiaomi,mi-router-ac2100|\
|
||||
xiaomi,redmi-router-ac2100)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
|
||||
ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000"
|
||||
xiaomi,miwifi-mini)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
|
||||
ubootenv_add_uci_sys_config "/dev/mtd9" "0x0" "0x4000" "0x10000"
|
||||
;;
|
||||
zyxel,lte3301-plus)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x80000"
|
||||
@ -145,21 +160,6 @@ zyxel,lte7490-m904|\
|
||||
zyxel,nr7101)
|
||||
ubootenv_add_mtd "Config" "0x0" "0x1000" "0x80000"
|
||||
;;
|
||||
bolt,arion|\
|
||||
xiaomi,mi-router-cr6606|\
|
||||
xiaomi,mi-router-cr6608|\
|
||||
xiaomi,mi-router-cr6609)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
|
||||
;;
|
||||
dna,valokuitu-plus-ex400|\
|
||||
genexis,pulse-ex400)
|
||||
ubootenv_add_uci_config "/dev/ubi0_0" "0x0" "0x1f000" "0x1f000" "1"
|
||||
ubootenv_add_uci_config "/dev/ubi0_1" "0x0" "0x1f000" "0x1f000" "1"
|
||||
;;
|
||||
netgear,wax214v2)
|
||||
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
|
||||
ubootenv_add_uci_sys_config "/dev/mtd1" "0x20000" "0x8000" "0x20000"
|
||||
;;
|
||||
esac
|
||||
|
||||
config_load ubootenv
|
||||
|
||||
@ -31,15 +31,15 @@ zyxel,gs1900-48-a1)
|
||||
ubootenv_add_mtd "u-boot-env" "0x0" "0x400" "0x10000"
|
||||
ubootenv_add_sys_mtd "u-boot-env2" "0x0" "0x1000" "0x10000"
|
||||
;;
|
||||
iodata,bsh-g24mb)
|
||||
ubootenv_add_mtd "u-boot-env" "0x0" "0x10000" "0x10000"
|
||||
ubootenv_add_sys_mtd "u-boot-env2" "0x0" "0x3800" "0x10000"
|
||||
;;
|
||||
tplink,sg2008p-v1|\
|
||||
tplink,sg2210p-v3|\
|
||||
tplink,sg2452p-v4)
|
||||
ubootenv_add_mtd "u-boot-env" "0x0" "0x20000" "0x10000"
|
||||
;;
|
||||
iodata,bsh-g24mb)
|
||||
ubootenv_add_mtd "u-boot-env" "0x0" "0x10000" "0x10000"
|
||||
ubootenv_add_sys_mtd "u-boot-env2" "0x0" "0x3800" "0x10000"
|
||||
;;
|
||||
*)
|
||||
ubootenv_add_mtd "u-boot-env" "0x0" "0x10000" "0x10000"
|
||||
ubootenv_add_sys_mtd "u-boot-env2" "0x0" "0x1000" "0x10000"
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
From: Shiji Yang <yangshiji66@outlook.com>
|
||||
Date: Fri, 28 Mar 2025 19:56:06 +0800
|
||||
Subject: [PATCH] Revert "wifi: ath10k: Use iommu_paging_domain_alloc()"
|
||||
|
||||
IPQ4019 wireless can't start after upstream commit d5b7485588df[1].
|
||||
|
||||
[1] https://github.com/torvalds/linux/commit/d5b7485588dffb39c5687e965623124ab7ebcd51
|
||||
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
---
|
||||
ath10k-6.18/snoc.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/ath10k-6.18/snoc.c
|
||||
+++ b/ath10k-6.18/snoc.c
|
||||
@@ -1630,10 +1630,10 @@ static int ath10k_fw_init(struct ath10k
|
||||
|
||||
ar_snoc->fw.dev = &pdev->dev;
|
||||
|
||||
- iommu_dom = iommu_paging_domain_alloc(ar_snoc->fw.dev);
|
||||
- if (IS_ERR(iommu_dom)) {
|
||||
+ iommu_dom = iommu_domain_alloc(&platform_bus_type);
|
||||
+ if (!iommu_dom) {
|
||||
ath10k_err(ar, "failed to allocate iommu domain\n");
|
||||
- ret = PTR_ERR(iommu_dom);
|
||||
+ ret = -ENOMEM;
|
||||
goto err_unregister;
|
||||
}
|
||||
|
||||
@ -363,38 +363,34 @@ static irqreturn_t button_handle_irq(int irq, void *_bdata)
|
||||
static struct gpio_keys_platform_data *
|
||||
gpio_keys_get_devtree_pdata(struct device *dev)
|
||||
{
|
||||
struct device_node *node, *pp;
|
||||
struct device_node *node = dev->of_node;
|
||||
struct gpio_keys_platform_data *pdata;
|
||||
struct gpio_keys_button *button;
|
||||
int nbuttons;
|
||||
int i = 0;
|
||||
|
||||
node = dev->of_node;
|
||||
if (!node)
|
||||
return NULL;
|
||||
|
||||
nbuttons = of_get_available_child_count(node);
|
||||
if (nbuttons == 0)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
pdata = devm_kzalloc(dev, sizeof(*pdata) + nbuttons * (sizeof *button),
|
||||
GFP_KERNEL);
|
||||
pdata = devm_kzalloc(dev, sizeof(struct gpio_keys_platform_data), GFP_KERNEL);
|
||||
if (!pdata)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
pdata->buttons = (struct gpio_keys_button *)(pdata + 1);
|
||||
pdata->buttons = devm_kmalloc_array(dev, nbuttons, sizeof(struct gpio_keys_button), GFP_KERNEL);
|
||||
if (!pdata->buttons)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
pdata->nbuttons = nbuttons;
|
||||
|
||||
pdata->rep = !!of_get_property(node, "autorepeat", NULL);
|
||||
pdata->rep = of_property_present(node, "autorepeat");
|
||||
of_property_read_u32(node, "poll-interval", &pdata->poll_interval);
|
||||
|
||||
for_each_available_child_of_node(node, pp) {
|
||||
button = (struct gpio_keys_button *)(&pdata->buttons[i++]);
|
||||
for_each_available_child_of_node_scoped(node, pp) {
|
||||
struct gpio_keys_button *button = (struct gpio_keys_button *)&pdata->buttons[i++];
|
||||
|
||||
if (of_property_read_u32(pp, "linux,code", &button->code)) {
|
||||
dev_err(dev, "Button node '%s' without keycode\n",
|
||||
pp->full_name);
|
||||
of_node_put(pp);
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
@ -403,7 +399,7 @@ gpio_keys_get_devtree_pdata(struct device *dev)
|
||||
if (of_property_read_u32(pp, "linux,input-type", &button->type))
|
||||
button->type = EV_KEY;
|
||||
|
||||
button->wakeup = !!of_get_property(pp, "gpio-key,wakeup", NULL);
|
||||
button->wakeup = of_property_present(pp, "gpio-key,wakeup");
|
||||
|
||||
if (of_property_read_u32(pp, "debounce-interval",
|
||||
&button->debounce_interval))
|
||||
@ -470,9 +466,7 @@ static int gpio_keys_button_probe(struct platform_device *pdev,
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
bdev = devm_kzalloc(dev, sizeof(struct gpio_keys_button_dev) +
|
||||
pdata->nbuttons * sizeof(struct gpio_keys_button_data),
|
||||
GFP_KERNEL);
|
||||
bdev = devm_kzalloc(dev, struct_size(bdev, data, pdata->nbuttons), GFP_KERNEL);
|
||||
if (!bdev) {
|
||||
dev_err(dev, "no memory for private data\n");
|
||||
return -ENOMEM;
|
||||
|
||||
@ -0,0 +1,69 @@
|
||||
From 88f17c87ddc9ee7467acdc322d383e5a443a55ab Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Mon, 8 Dec 2025 20:50:47 +0100
|
||||
Subject: [PATCH 1/2] wifi: ath11k: fix wrong usage of resource_size() causing
|
||||
firmware panic
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
On converting to the of_reserved_mem_region_to_resource() helper with
|
||||
commit 900730dc4705 ("wifi: ath: Use
|
||||
of_reserved_mem_region_to_resource() for "memory-region"") a logic error
|
||||
was introduced in the ath11k_core_coldboot_cal_support() if condition.
|
||||
|
||||
The original code checked for hremote_node presence and skipped
|
||||
ath11k_core_coldboot_cal_support() in the other switch case but now
|
||||
everything is driven entirely on the values of the resource struct.
|
||||
|
||||
resource_size() (in this case) is wrongly assumed to return a size of
|
||||
zero if the passed resource struct is init to zero. This is not the case
|
||||
as a resource struct should be always init with correct values (or at
|
||||
best set the end value to -1 to signal it's not configured)
|
||||
(the return value of resource_size() for a resource struct with start
|
||||
and end set to zero is 1)
|
||||
|
||||
On top of this, using resource_size() to check if a resource struct is
|
||||
initialized or not is generally wrong and other measure should be used
|
||||
instead.
|
||||
|
||||
To better handle this, use the DEFINE_RES macro to initialize the
|
||||
resource struct and set the IORESOURCE_UNSET flag by default.
|
||||
|
||||
Replace the resource_size() check with checking for the resource struct
|
||||
flags and check if it's IORESOURCE_UNSET.
|
||||
|
||||
This change effectively restore the original logic and restore correct
|
||||
loading of the ath11k firmware (restoring correct functionality of
|
||||
Wi-Fi)
|
||||
|
||||
Cc: stable@vger.kernel.org
|
||||
Fixes: 900730dc4705 ("wifi: ath: Use of_reserved_mem_region_to_resource() for "memory-region"")
|
||||
Link: https://lore.kernel.org/all/20251207215359.28895-1-ansuelsmth@gmail.com/T/#m990492684913c5a158ff0e5fc90697d8ad95351b
|
||||
Cc: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath11k/qmi.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
@@ -2039,8 +2039,8 @@ static int ath11k_qmi_alloc_target_mem_c
|
||||
|
||||
static int ath11k_qmi_assign_target_mem_chunk(struct ath11k_base *ab)
|
||||
{
|
||||
+ struct resource res = DEFINE_RES_NAMED(0, 0, NULL, IORESOURCE_UNSET);
|
||||
struct device *dev = ab->dev;
|
||||
- struct resource res = {};
|
||||
u32 host_ddr_sz;
|
||||
int i, idx, ret;
|
||||
|
||||
@@ -2086,7 +2086,7 @@ static int ath11k_qmi_assign_target_mem_
|
||||
}
|
||||
|
||||
if (ath11k_core_coldboot_cal_support(ab)) {
|
||||
- if (resource_size(&res)) {
|
||||
+ if (res.flags != IORESOURCE_UNSET) {
|
||||
ab->qmi.target_mem[idx].paddr =
|
||||
res.start + host_ddr_sz;
|
||||
ab->qmi.target_mem[idx].iaddr =
|
||||
@ -11,8 +11,8 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
|
||||
--- a/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
@@ -2042,6 +2042,7 @@ static int ath11k_qmi_assign_target_mem_
|
||||
struct resource res = DEFINE_RES_NAMED(0, 0, NULL, IORESOURCE_UNSET);
|
||||
struct device *dev = ab->dev;
|
||||
struct resource res = {};
|
||||
u32 host_ddr_sz;
|
||||
+ u32 addr;
|
||||
int i, idx, ret;
|
||||
|
||||
@ -107,9 +107,7 @@ define KernelPackage/rt2800-soc
|
||||
$(call KernelPackage/rt2x00/Default)
|
||||
DEPENDS += @(TARGET_ramips_rt288x||TARGET_ramips_rt305x||TARGET_ramips_rt3883||TARGET_ramips_mt7620) +kmod-rt2800-mmio +kmod-rt2800-lib
|
||||
TITLE += (RT28xx/RT3xxx SoC)
|
||||
FILES := \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2x00soc.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2800soc.ko
|
||||
FILES := $(PKG_BUILD_DIR)/drivers/net/wireless/ralink/rt2x00/rt2800soc.ko
|
||||
AUTOLOAD:=$(call AutoProbe,rt2800soc)
|
||||
endef
|
||||
|
||||
|
||||
@ -12,9 +12,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/libnl-tiny.git
|
||||
PKG_SOURCE_DATE:=2025-11-03
|
||||
PKG_SOURCE_VERSION:=532ac744dedcf83c06e2f4a8320fcc8089f23b72
|
||||
PKG_MIRROR_HASH:=f6f6432b0aa859ffe3012f5b57590823cb4540d97fd6a13ccd8d8f5572a0ca3f
|
||||
PKG_SOURCE_DATE:=2025-12-02
|
||||
PKG_SOURCE_VERSION:=40493a655d8caa2ccf5206dde1e733abe2920432
|
||||
PKG_MIRROR_HASH:=b45c72c26961fa6eafc14f73693c2fe463912c4cb0488ccea232d61b425c60d5
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1
|
||||
|
||||
@ -5,9 +5,9 @@ PKG_RELEASE=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git
|
||||
PKG_MIRROR_HASH:=5bd17ef3e681529fda6992d76a7104f2fef81002c2d776c11217e3b99426a669
|
||||
PKG_SOURCE_DATE:=2025-11-14
|
||||
PKG_SOURCE_VERSION:=a75209f62982f7218f73b9b4fd9b705e19f5f94a
|
||||
PKG_MIRROR_HASH:=59cebd566db9013497e2094011f37eef9dcf5b3399b81be3e7c5217d646b82ee
|
||||
PKG_SOURCE_DATE:=2025-12-08
|
||||
PKG_SOURCE_VERSION:=7928f1711703767b0ac5ce916c7231d0e1af1ca2
|
||||
PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
|
||||
@ -12,9 +12,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git
|
||||
PKG_SOURCE_DATE:=2025-12-06
|
||||
PKG_SOURCE_VERSION:=1d6c4e794cdb86963e29b7dc332d0bc20ba6306c
|
||||
PKG_MIRROR_HASH:=b7c8fb6c76a7c2f2ef3d9bb9e867e8b9f54b4ecb535d6715c0da1fdaebb6ce51
|
||||
PKG_SOURCE_DATE:=2025-12-09
|
||||
PKG_SOURCE_VERSION:=5212a1019d75db47a03c95c12e385e4625dda3d0
|
||||
PKG_MIRROR_HASH:=9c6501ea995c685e4e1b65ae74cbaecb6f787a493fdd5f8d3d095aeb0466b418
|
||||
|
||||
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
@ -6,3 +6,5 @@ config dropbear main
|
||||
option Port '22'
|
||||
option Interface 'lan'
|
||||
# option BannerFile '/etc/banner'
|
||||
# option LocalPortForward 'off'
|
||||
# option RemotePortForward 'off'
|
||||
|
||||
@ -178,6 +178,8 @@ validate_section_dropbear()
|
||||
'IdleTimeout:uinteger:0' \
|
||||
'MaxAuthTries:uinteger:3' \
|
||||
'RecvWindowSize:uinteger:0' \
|
||||
'LocalPortForward:bool:1' \
|
||||
'RemotePortForward:bool:1' \
|
||||
'mdns:bool:1'
|
||||
}
|
||||
|
||||
@ -317,6 +319,8 @@ dropbear_instance()
|
||||
fi
|
||||
[ "${PasswordAuth}" -eq 0 ] && procd_append_param command -s
|
||||
[ "${GatewayPorts}" -eq 1 ] && procd_append_param command -a
|
||||
[ "${LocalPortForward}" -eq 0 ] && procd_append_param command -j
|
||||
[ "${RemotePortForward}" -eq 0 ] && procd_append_param command -k
|
||||
[ -n "${ForceCommand}" ] && procd_append_param command -c "${ForceCommand}"
|
||||
[ "${RootPasswordAuth}" -eq 0 ] && procd_append_param command -g
|
||||
[ "${RootLogin}" -eq 0 ] && procd_append_param command -w
|
||||
|
||||
@ -476,6 +476,7 @@ hostapd_bss_del_client(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
struct blob_attr *msg)
|
||||
{
|
||||
struct blob_attr *tb[__DEL_CLIENT_MAX];
|
||||
const u8 bcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj);
|
||||
struct sta_info *sta;
|
||||
bool deauth = false;
|
||||
@ -496,15 +497,19 @@ hostapd_bss_del_client(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
if (tb[DEL_CLIENT_DEAUTH])
|
||||
deauth = blobmsg_get_bool(tb[DEL_CLIENT_DEAUTH]);
|
||||
|
||||
if (deauth)
|
||||
hostapd_drv_sta_deauth(hapd, addr, reason);
|
||||
else
|
||||
hostapd_drv_sta_disassoc(hapd, addr, reason);
|
||||
|
||||
sta = ap_get_sta(hapd, addr);
|
||||
if (sta) {
|
||||
if (deauth) {
|
||||
hostapd_drv_sta_deauth(hapd, addr, reason);
|
||||
if (deauth)
|
||||
ap_sta_deauthenticate(hapd, sta, reason);
|
||||
} else {
|
||||
hostapd_drv_sta_disassoc(hapd, addr, reason);
|
||||
else
|
||||
ap_sta_disassociate(hapd, sta, reason);
|
||||
}
|
||||
} else if (memcmp(addr, bcast, ETH_ALEN) == 0) {
|
||||
hostapd_free_stas(hapd);
|
||||
}
|
||||
|
||||
if (tb[DEL_CLIENT_BAN_TIME])
|
||||
@ -1844,6 +1849,7 @@ ubus_event_cb(struct ubus_notify_request *req, int idx, int ret)
|
||||
int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req)
|
||||
{
|
||||
struct ubus_banned_client *ban;
|
||||
const u8 bcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
const char *types[HOSTAPD_UBUS_TYPE_MAX] = {
|
||||
[HOSTAPD_UBUS_PROBE_REQ] = "probe",
|
||||
[HOSTAPD_UBUS_AUTH_REQ] = "auth",
|
||||
@ -1862,6 +1868,10 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req
|
||||
if (ban)
|
||||
return WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
|
||||
|
||||
ban = avl_find_element(&hapd->ubus.banned, bcast, ban, avl);
|
||||
if (ban)
|
||||
return WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
|
||||
|
||||
if (!hapd->ubus.obj.has_subscribers)
|
||||
return WLAN_STATUS_SUCCESS;
|
||||
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=apk
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL=https://gitlab.alpinelinux.org/alpine/apk-tools.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2025-11-10
|
||||
PKG_SOURCE_VERSION:=2c027261492169783f6aaa2b7731a4e90dc7a5b0
|
||||
PKG_MIRROR_HASH:=177769a6b7a4b0a2117ed4326060eb08b19c1b930a8a92b7c25d2f56154f497e
|
||||
PKG_SOURCE_DATE:=2025-12-03
|
||||
PKG_SOURCE_VERSION:=982c9961ad9e71b4068911329c9d8121cedfd9f7
|
||||
PKG_MIRROR_HASH:=4fc89e2bbbe10edfaa199b1ca9ace139aa39b43d3de6236e8be8b421d81b334b
|
||||
|
||||
PKG_VERSION=3.0.0_pre$(subst -,,$(PKG_SOURCE_DATE))
|
||||
PKG_VERSION=3.0.1
|
||||
|
||||
PKG_MAINTAINER:=Paul Spooren <mail@aparcar.org>
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
@ -54,13 +54,12 @@ MESON_VARS+=VERSION=$(PKG_VERSION)
|
||||
|
||||
MESON_COMMON_ARGS = \
|
||||
-Db_lto=true \
|
||||
-Dcompressed-help=false \
|
||||
-Ddocs=disabled \
|
||||
-Dhelp=enabled \
|
||||
-Dlua_version=5.1 \
|
||||
-Ddefault_library=static \
|
||||
-Durl_backend=wget \
|
||||
-Dzstd=false \
|
||||
-Dzstd=disabled \
|
||||
-Dpython=disabled \
|
||||
-Dtests=disabled
|
||||
|
||||
@ -70,7 +69,8 @@ MESON_HOST_ARGS += \
|
||||
|
||||
MESON_ARGS += \
|
||||
$(MESON_COMMON_ARGS) \
|
||||
-Dcrypto_backend=$(BUILD_VARIANT)
|
||||
-Dcrypto_backend=$(BUILD_VARIANT) \
|
||||
-Dminimal=true
|
||||
|
||||
define Package/apk/conffiles
|
||||
/etc/apk/repositories.d/customfeeds.list
|
||||
|
||||
@ -10,7 +10,7 @@ Signed-off-by: Paul Spooren <mail@aparcar.org>
|
||||
|
||||
--- a/src/database.c
|
||||
+++ b/src/database.c
|
||||
@@ -1937,7 +1937,7 @@ const char *apk_db_layer_name(int layer)
|
||||
@@ -1918,7 +1918,7 @@ const char *apk_db_layer_name(int layer)
|
||||
{
|
||||
switch (layer) {
|
||||
case APK_DB_LAYER_ROOT: return "lib/apk/db";
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
From 54385e6dc02ada9ec827b6b79b9359951197fee5 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Donald <newtwen+gitlab@gmail.com>
|
||||
Date: Tue, 9 Dec 2025 00:31:27 +0100
|
||||
Subject: [PATCH] apk: fix compile when using C89
|
||||
|
||||
The older standard is more strict, and gives rise to errors:
|
||||
|
||||
../src/apk.c: In function 'parse_options':
|
||||
../src/apk.c:584:4: error: a label can only be part of a statement and a declaration is not a statement
|
||||
584 | char *arg = opt_parse_arg(&st);
|
||||
| ^~~~
|
||||
|
||||
So move the *arg declaration to function start.
|
||||
|
||||
../src/app_mkpkg.c: In function 'mkpkg_setup_compat':
|
||||
../src/app_mkpkg.c:423:2: error: label at end of compound statement
|
||||
423 | default:
|
||||
| ^~~~~~~
|
||||
|
||||
add break;
|
||||
|
||||
Signed-off-by: Paul Donald <newtwen+gitlab@gmail.com>
|
||||
---
|
||||
src/apk.c | 3 ++-
|
||||
src/app_mkpkg.c | 1 +
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/src/apk.c
|
||||
+++ b/src/apk.c
|
||||
@@ -556,6 +556,7 @@ static int parse_options(int argc, char
|
||||
struct apk_opt_match m;
|
||||
bool applet_arg_pending = false;
|
||||
int r;
|
||||
+ char *arg;
|
||||
|
||||
applet = applet_from_arg0(argv[0]);
|
||||
if (!applet) {
|
||||
@@ -581,7 +582,7 @@ static int parse_options(int argc, char
|
||||
case 0:
|
||||
break;
|
||||
case OPT_MATCH_NON_OPTION:
|
||||
- char *arg = opt_parse_arg(&st);
|
||||
+ arg = opt_parse_arg(&st);
|
||||
if (applet_arg_pending && strcmp(arg, applet->name) == 0)
|
||||
applet_arg_pending = false;
|
||||
else if (arg[0] || !applet || !applet->remove_empty_arguments)
|
||||
--- a/src/app_mkpkg.c
|
||||
+++ b/src/app_mkpkg.c
|
||||
@@ -421,6 +421,7 @@ static void mkpkg_setup_compat(struct mk
|
||||
case 0: ctx->compat_rootnode = 1; // fallthrough
|
||||
case 1: ctx->compat_dirnode = 1; // fallthrough
|
||||
default:
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
From aa71510f843d5cce5f75b6abfa3a70caeacbe36d Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Thu, 20 Nov 2025 18:26:52 -0800
|
||||
Subject: [PATCH] fix usage under LibreSSL > 3
|
||||
|
||||
crypto needs to be initialized as the context relies on it.
|
||||
|
||||
Fixes crash in EVP_DigestInit_ex being called with a NULL digest.
|
||||
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
---
|
||||
src/apk.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/src/apk.c
|
||||
+++ b/src/apk.c
|
||||
@@ -571,6 +571,7 @@ int main(int argc, char **argv)
|
||||
apk_argv[argc] = NULL;
|
||||
apk_argv[argc+1] = NULL;
|
||||
|
||||
+ apk_crypto_init();
|
||||
apk_ctx_init(&ctx);
|
||||
umask(0);
|
||||
setup_terminal();
|
||||
@@ -583,7 +584,6 @@ int main(int argc, char **argv)
|
||||
if (applet->parse) applet->parse(applet_ctx, &ctx, APK_OPTIONS_INIT, NULL);
|
||||
}
|
||||
|
||||
- apk_crypto_init();
|
||||
apk_io_url_init(&ctx.out);
|
||||
apk_io_url_set_timeout(60);
|
||||
apk_io_url_set_redirect_callback(redirect_callback);
|
||||
@ -1,49 +0,0 @@
|
||||
--- a/doc/apk.8.scd
|
||||
+++ b/doc/apk.8.scd
|
||||
@@ -462,7 +462,8 @@ timeout 120
|
||||
*/lib/apk/db/installed*
|
||||
Database of installed packages and their contents.
|
||||
|
||||
-*/lib/apk/db/scripts.tar*
|
||||
+*/lib/apk/db/scripts.tar*++
|
||||
+*/lib/apk/db/scripts.tar.gz*
|
||||
Collection of all package scripts from currently installed packages.
|
||||
|
||||
*/lib/apk/db/triggers*
|
||||
--- a/src/apk_database.h
|
||||
+++ b/src/apk_database.h
|
||||
@@ -210,6 +210,7 @@ struct apk_database {
|
||||
unsigned int compat_depversions : 1;
|
||||
unsigned int sorted_names : 1;
|
||||
unsigned int sorted_installed_packages : 1;
|
||||
+ unsigned int scripts_tar : 1;
|
||||
|
||||
struct apk_dependency_array *world;
|
||||
struct apk_id_cache *id_cache;
|
||||
--- a/src/database.c
|
||||
+++ b/src/database.c
|
||||
@@ -1338,8 +1338,11 @@ static int apk_db_read_layer(struct apk_
|
||||
}
|
||||
|
||||
if (!(flags & APK_OPENF_NO_SCRIPTS)) {
|
||||
- r = apk_tar_parse(apk_istream_from_file(fd, "scripts.tar"),
|
||||
- apk_read_script_archive_entry, db, db->id_cache);
|
||||
+ struct apk_istream *is = apk_istream_from_file(fd, "scripts.tar");
|
||||
+ if (!IS_ERR(is) || PTR_ERR(is) != -ENOENT) db->scripts_tar = 1;
|
||||
+ else is = apk_istream_gunzip(apk_istream_from_file(fd, "scripts.tar.gz"));
|
||||
+
|
||||
+ r = apk_tar_parse(is, apk_read_script_archive_entry, db, db->id_cache);
|
||||
if (!ret && r != -ENOENT) ret = r;
|
||||
}
|
||||
|
||||
@@ -2214,8 +2217,9 @@ static int apk_db_write_layers(struct ap
|
||||
continue;
|
||||
}
|
||||
ld->installed = apk_ostream_to_file(ld->fd, "installed", 0644);
|
||||
- ld->scripts = apk_ostream_to_file(ld->fd, "scripts.tar", 0644);
|
||||
ld->triggers = apk_ostream_to_file(ld->fd, "triggers", 0644);
|
||||
+ if (db->scripts_tar) ld->scripts = apk_ostream_to_file(ld->fd, "scripts.tar", 0644);
|
||||
+ else ld->scripts = apk_ostream_gzip(apk_ostream_to_file(ld->fd, "scripts.tar.gz", 0644));
|
||||
|
||||
if (i == APK_DB_LAYER_ROOT)
|
||||
os = apk_ostream_to_file(db->root_fd, apk_world_file, 0644);
|
||||
@ -5,9 +5,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git
|
||||
PKG_SOURCE_DATE:=2025-11-18
|
||||
PKG_SOURCE_VERSION:=2737da3819fefafa5b63d5f82efb77ff0032a5d8
|
||||
PKG_MIRROR_HASH:=6044e9bde877ee585a69386ab377e3bc1924e15b7343db8df8234b1d76f870ec
|
||||
PKG_SOURCE_DATE:=2025-12-02
|
||||
PKG_SOURCE_VERSION:=3cc98db1a422dcf560f2d6347fd410f17565a89d
|
||||
PKG_MIRROR_HASH:=25a204888b41e9a432ee0b8d03c1e0f09ae9aaae6a306c41781d680b632b82ae
|
||||
PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
|
||||
@ -13,9 +13,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/uci.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2025-11-18
|
||||
PKG_SOURCE_VERSION:=5bea13572325af4fb3057ff600cc7f7d5b82012b
|
||||
PKG_MIRROR_HASH:=62a0f20970e7db5b0de4814168e0f9f558f16d5e8caa1203d247ae1faa1c2a18
|
||||
PKG_SOURCE_DATE:=2025-12-02
|
||||
PKG_SOURCE_VERSION:=66127cd76c5d0bd46d5a90302cc6110f53a4e2f8
|
||||
PKG_MIRROR_HASH:=ff23a9825aeac8da14a7142e985d598043c0287a463279f24863c580622bf18d
|
||||
PKG_ABI_VERSION:=20250120
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1
|
||||
|
||||
@ -162,14 +162,14 @@ bump_kernel()
|
||||
|
||||
git commit \
|
||||
--signoff \
|
||||
--message "kernel/${platform_name}: Create kernel files for v${target_version} (from v${source_version})" \
|
||||
--message "kernel/${platform_name}: create files for v${target_version} (from v${source_version})" \
|
||||
--message 'This is an automatically generated commit.' \
|
||||
--message 'When doing `git bisect`, consider `git bisect --skip`.'
|
||||
|
||||
git checkout 'HEAD~' "${_target_dir}"
|
||||
git commit \
|
||||
--signoff \
|
||||
--message "kernel/${platform_name}: Restore kernel files for v${source_version}" \
|
||||
--message "kernel/${platform_name}: restore files for v${source_version}" \
|
||||
--message "$(printf "This is an automatically generated commit which aids following Kernel patch\nhistory, as git will see the move and copy as a rename thus defeating the\npurpose.\n\nFor the original discussion see:\nhttps://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041673.html")"
|
||||
git switch "${initial_branch:?Unable to switch back to original branch. Quitting.}"
|
||||
GIT_EDITOR=true git merge --no-ff '__openwrt_kernel_files_mover'
|
||||
|
||||
@ -74,22 +74,20 @@
|
||||
&pcie0 {
|
||||
status = "okay";
|
||||
|
||||
ath9k0: wifi@11,0 { /* 2.4 GHz */
|
||||
wifi@11,0 { /* 2.4 GHz */
|
||||
compatible = "pci168c,0029";
|
||||
reg = <0x8800 0 0 0 0>;
|
||||
qca,no-eeprom;
|
||||
nvmem-cells = <&macaddr_config_66 1>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_config_66 1>, <&cal_art_11000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
};
|
||||
|
||||
ath9k1: wifi@12,0 { /* 5 GHz */
|
||||
wifi@12,0 { /* 5 GHz */
|
||||
compatible = "pci168c,0029";
|
||||
reg = <0x9000 0 0 0 0>;
|
||||
qca,no-eeprom;
|
||||
nvmem-cells = <&macaddr_config_66 2>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_config_66 2>, <&cal_art_15000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
};
|
||||
@ -139,7 +137,7 @@
|
||||
read-only;
|
||||
};
|
||||
|
||||
config: partition@80000 {
|
||||
partition@80000 {
|
||||
label = "config";
|
||||
reg = <0x80000 0x20000>;
|
||||
read-only;
|
||||
@ -167,6 +165,20 @@
|
||||
label = "art";
|
||||
reg = <0xfe0000 0x20000>;
|
||||
read-only;
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
cal_art_11000: calibration@11000 {
|
||||
reg = <0x11000 0xeb8>;
|
||||
};
|
||||
|
||||
cal_art_15000: calibration@15000 {
|
||||
reg = <0x15000 0xeb8>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -77,9 +77,8 @@
|
||||
wifi@0,0 {
|
||||
compatible = "pci168c,002a";
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
qca,no-eeprom;
|
||||
nvmem-cells = <&macaddr_config_66 1>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&macaddr_config_66 1>, <&cal_art_11000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
};
|
||||
};
|
||||
|
||||
@ -139,7 +138,7 @@
|
||||
read-only;
|
||||
};
|
||||
|
||||
config: partition@80000 {
|
||||
partition@80000 {
|
||||
label = "config";
|
||||
reg = <0x80000 0x20000>;
|
||||
read-only;
|
||||
@ -167,6 +166,16 @@
|
||||
label = "art";
|
||||
reg = <0xfe0000 0x20000>;
|
||||
read-only;
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
cal_art_11000: calibration@11000 {
|
||||
reg = <0x11000 0xeb8>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -48,26 +48,18 @@
|
||||
};
|
||||
|
||||
led-2 {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WLAN;
|
||||
function-enumerator = <0>;
|
||||
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
|
||||
led-3 {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WAN;
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-4 {
|
||||
led-3 {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_LAN;
|
||||
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-5 {
|
||||
led-4 {
|
||||
color = <LED_COLOR_ID_YELLOW>;
|
||||
function = LED_FUNCTION_WLAN;
|
||||
function-enumerator = <1>;
|
||||
@ -157,6 +149,16 @@
|
||||
label = "art";
|
||||
reg = <0xfe0000 0x010000>;
|
||||
read-only;
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
cal_art_1000: calibration@1000 {
|
||||
reg = <0x1000 0x440>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
partition@ff0000 {
|
||||
@ -174,5 +176,12 @@
|
||||
|
||||
&wmac {
|
||||
status = "okay";
|
||||
qca,no-eeprom;
|
||||
|
||||
nvmem-cells = <&cal_art_1000>;
|
||||
nvmem-cell-names = "calibration";
|
||||
|
||||
led {
|
||||
led-sources = <12>;
|
||||
led-active-low;
|
||||
};
|
||||
};
|
||||
|
||||
@ -15,10 +15,6 @@ case "$FIRMWARE" in
|
||||
avm,fritzdvbc)
|
||||
caldata_extract_reverse "urlader" 0x1541 0x440
|
||||
;;
|
||||
moxa,awk-1137c)
|
||||
caldata_extract "art" 0x1000 0x440
|
||||
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env mac_addr)
|
||||
;;
|
||||
*)
|
||||
caldata_die "board $board is not supported yet"
|
||||
;;
|
||||
@ -29,9 +25,6 @@ case "$FIRMWARE" in
|
||||
avm,fritz300e)
|
||||
caldata_extract_reverse "urloader" 0x1541 0x440
|
||||
;;
|
||||
meraki,mr12)
|
||||
caldata_extract "art" 0x11000 0xeb8
|
||||
;;
|
||||
wd,mynet-wifi-rangeextender)
|
||||
caldata_extract "art" 0x1000 0x440
|
||||
ath9k_patch_mac $(nvram get wl0_hwaddr)
|
||||
@ -41,24 +34,4 @@ case "$FIRMWARE" in
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"ath9k-eeprom-pci-0000:00:11.0.bin")
|
||||
case $board in
|
||||
meraki,mr16)
|
||||
caldata_extract "art" 0x11000 0xeb8
|
||||
;;
|
||||
*)
|
||||
caldata_die "board $board is not supported yet"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"ath9k-eeprom-pci-0000:00:12.0.bin")
|
||||
case $board in
|
||||
meraki,mr16)
|
||||
caldata_extract "art" 0x15000 0xeb8
|
||||
;;
|
||||
*)
|
||||
caldata_die "board $board is not supported yet"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
@ -80,6 +80,10 @@ case "$board" in
|
||||
# which would allow to patch the macaddress
|
||||
macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" $PHYNBR > /sys${DEVPATH}/macaddress
|
||||
;;
|
||||
moxa,awk-1137c)
|
||||
[ "$PHYNBR" -eq 0 ] && \
|
||||
mtd_get_mac_ascii u-boot-env mac_addr > /sys${DEVPATH}/macaddress
|
||||
;;
|
||||
dlink,dir-842-c1|\
|
||||
dlink,dir-842-c2|\
|
||||
dlink,dir-842-c3|\
|
||||
|
||||
@ -260,6 +260,12 @@
|
||||
pins = "gpio40";
|
||||
};
|
||||
};
|
||||
|
||||
ephy_rst: reset-controller@3c {
|
||||
compatible = "brcm,bcm6345-reset";
|
||||
reg = <0x3c 0x4>;
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
uart0: serial@10000100 {
|
||||
@ -399,6 +405,8 @@
|
||||
reg = <0x10080000 0x8000>;
|
||||
big-endian;
|
||||
|
||||
brcm,gpio-ctrl = <&gpio_cntl>;
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
@ -431,21 +439,41 @@
|
||||
phy1: ethernet-phy@1 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <1>;
|
||||
|
||||
resets = <&ephy_rst 0>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
|
||||
phy2: ethernet-phy@2 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <2>;
|
||||
|
||||
resets = <&ephy_rst 1>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
|
||||
phy3: ethernet-phy@3 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <3>;
|
||||
|
||||
resets = <&ephy_rst 2>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
|
||||
phy4: ethernet-phy@4 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <4>;
|
||||
|
||||
resets = <&ephy_rst 3>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -288,6 +288,12 @@
|
||||
pins = "dsl_gpio9";
|
||||
};
|
||||
};
|
||||
|
||||
ephy_rst: reset-controller@3c {
|
||||
compatible = "brcm,bcm6345-reset";
|
||||
reg = <0x3c 0x4>;
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
uart0: serial@10000180 {
|
||||
@ -481,8 +487,7 @@
|
||||
<&timer_clk BCM63268_TCLK_GPHY1>;
|
||||
|
||||
resets = <&periph_rst BCM63268_RST_ENETSW>,
|
||||
<&periph_rst BCM63268_RST_EPHY>,
|
||||
<&periph_rst BCM63268_RST_GPHY>;
|
||||
<&periph_rst BCM63268_RST_EPHY>;
|
||||
|
||||
power-domains = <&periph_pwr BCM63268_POWER_DOMAIN_ROBOSW>;
|
||||
|
||||
@ -532,6 +537,8 @@
|
||||
reg = <0x10700000 0x8000>;
|
||||
big-endian;
|
||||
|
||||
brcm,gpio-ctrl = <&gpio_cntl>;
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
@ -564,21 +571,41 @@
|
||||
phy1: ethernet-phy@1 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <1>;
|
||||
|
||||
resets = <&ephy_rst 0>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
|
||||
phy2: ethernet-phy@2 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <2>;
|
||||
|
||||
resets = <&ephy_rst 1>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
|
||||
phy3: ethernet-phy@3 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <3>;
|
||||
|
||||
resets = <&ephy_rst 2>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
|
||||
phy4: ethernet-phy@4 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <4>;
|
||||
|
||||
resets = <&periph_rst BCM63268_RST_GPHY>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -48,17 +48,6 @@
|
||||
linux,default-trigger = "usbport";
|
||||
};
|
||||
};
|
||||
|
||||
ath9k-leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led-8 {
|
||||
function = LED_FUNCTION_WLAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&ath9k 8 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&leds {
|
||||
@ -205,15 +194,16 @@
|
||||
device_type = "pci";
|
||||
ranges;
|
||||
|
||||
ath9k: wifi@0,0 {
|
||||
wifi@0,0 {
|
||||
compatible = "pci168c,002e";
|
||||
reg = <0 0 0 0 0>;
|
||||
|
||||
nvmem-cells = <&macaddr_cfe_6a0 1>, <&cal_data_1000>;
|
||||
nvmem-cell-names = "mac-address", "calibration";
|
||||
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
led {
|
||||
led-sources = <8>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -248,6 +248,12 @@
|
||||
pins = "usb_port1";
|
||||
};
|
||||
};
|
||||
|
||||
ephy_rst: reset-controller@3c {
|
||||
compatible = "brcm,bcm6345-reset";
|
||||
reg = <0x3c 0x4>;
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
uart0: serial@10000100 {
|
||||
@ -417,6 +423,8 @@
|
||||
reg = <0x10e00000 0x8000>;
|
||||
big-endian;
|
||||
|
||||
brcm,gpio-ctrl = <&gpio_cntl>;
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
@ -449,21 +457,41 @@
|
||||
phy1: ethernet-phy@1 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <1>;
|
||||
|
||||
resets = <&ephy_rst 0>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
|
||||
phy2: ethernet-phy@2 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <2>;
|
||||
|
||||
resets = <&ephy_rst 1>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
|
||||
phy3: ethernet-phy@3 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <3>;
|
||||
|
||||
resets = <&ephy_rst 2>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
|
||||
phy4: ethernet-phy@4 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <4>;
|
||||
|
||||
resets = <&ephy_rst 3>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -5,17 +5,6 @@
|
||||
/ {
|
||||
model = "Huawei EchoLife HG556a (version A)";
|
||||
compatible = "huawei,hg556a-a", "brcm,bcm6358";
|
||||
|
||||
ath9k-leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led-2 {
|
||||
function = LED_FUNCTION_WLAN;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&ath9k 2 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&gpio_keys {
|
||||
@ -58,7 +47,7 @@
|
||||
&pci {
|
||||
status = "okay";
|
||||
|
||||
ath9k: wifi@1,0 {
|
||||
wifi@1,0 {
|
||||
compatible = "pci168c,ff1d";
|
||||
reg = <0x0800 0 0 0 0>;
|
||||
|
||||
@ -67,7 +56,8 @@
|
||||
nvmem-cells = <&macaddr_cfe_6a0 1>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
led {
|
||||
led-sources = <2>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -5,17 +5,6 @@
|
||||
/ {
|
||||
model = "Huawei EchoLife HG556a (version B)";
|
||||
compatible = "huawei,hg556a-b", "brcm,bcm6358";
|
||||
|
||||
ath9k-leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led-2 {
|
||||
function = LED_FUNCTION_WLAN;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&ath9k 2 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "phy0tpt";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&gpio_keys {
|
||||
@ -58,7 +47,7 @@
|
||||
&pci {
|
||||
status = "okay";
|
||||
|
||||
ath9k: wifi@1,0 {
|
||||
wifi@1,0 {
|
||||
compatible = "pci168c,0029";
|
||||
reg = <0x0800 0 0 0 0>;
|
||||
|
||||
@ -67,7 +56,8 @@
|
||||
nvmem-cells = <&macaddr_cfe_6a0 1>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
|
||||
#gpio-cells = <2>;
|
||||
gpio-controller;
|
||||
led {
|
||||
led-sources = <2>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -38,16 +38,26 @@
|
||||
};
|
||||
};
|
||||
|
||||
&cal_data {
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
cal_data_1fe00: calibration@1fe00 {
|
||||
reg = <0x1fe00 0x200>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pci {
|
||||
status = "okay";
|
||||
|
||||
wifi@1,0 {
|
||||
compatible = "pci0,0";
|
||||
compatible = "pci1814,3062";
|
||||
reg = <0x0800 0 0 0 0>;
|
||||
|
||||
ralink,mtd-eeprom = <&cal_data 0x1fe00>;
|
||||
|
||||
nvmem-cells = <&macaddr_cfe_6a0 1>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
nvmem-cells = <&cal_data_1fe00>, <&macaddr_cfe_6a0 1>;
|
||||
nvmem-cell-names = "calibration", "mac-address";
|
||||
};
|
||||
};
|
||||
|
||||
@ -323,6 +323,12 @@
|
||||
pins = "nand_grp";
|
||||
};
|
||||
};
|
||||
|
||||
ephy_rst: reset-controller@3c {
|
||||
compatible = "brcm,bcm6345-reset";
|
||||
reg = <0x3c 0x4>;
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
uart0: serial@10000100 {
|
||||
@ -526,6 +532,8 @@
|
||||
reg = <0x10e00000 0x8000>;
|
||||
big-endian;
|
||||
|
||||
brcm,gpio-ctrl = <&gpio_cntl>;
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
@ -558,21 +566,41 @@
|
||||
phy1: ethernet-phy@1 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <1>;
|
||||
|
||||
resets = <&ephy_rst 0>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
|
||||
phy2: ethernet-phy@2 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <2>;
|
||||
|
||||
resets = <&ephy_rst 1>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
|
||||
phy3: ethernet-phy@3 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <3>;
|
||||
|
||||
resets = <&ephy_rst 2>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
|
||||
phy4: ethernet-phy@4 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <4>;
|
||||
|
||||
resets = <&ephy_rst 3>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -337,6 +337,12 @@
|
||||
pins = "uart1_grp";
|
||||
};
|
||||
};
|
||||
|
||||
ephy_rst: reset-controller@3c {
|
||||
compatible = "brcm,bcm6345-reset";
|
||||
reg = <0x3c 0x4>;
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
};
|
||||
|
||||
leds: led-controller@100000d0 {
|
||||
@ -528,6 +534,8 @@
|
||||
reg = <0x10f00000 0x8000>;
|
||||
big-endian;
|
||||
|
||||
brcm,gpio-ctrl = <&gpio_cntl>;
|
||||
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
@ -560,21 +568,41 @@
|
||||
phy1: ethernet-phy@1 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <1>;
|
||||
|
||||
resets = <&ephy_rst 6>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
|
||||
phy2: ethernet-phy@2 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <2>;
|
||||
|
||||
resets = <&ephy_rst 7>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
|
||||
phy3: ethernet-phy@3 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <3>;
|
||||
|
||||
resets = <&ephy_rst 8>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
|
||||
phy4: ethernet-phy@4 {
|
||||
compatible = "ethernet-phy-ieee802.3-c22";
|
||||
reg = <4>;
|
||||
|
||||
resets = <&ephy_rst 9>;
|
||||
reset-names = "phy";
|
||||
reset-assert-us = <2000>;
|
||||
reset-deassert-us = <2000>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -3,6 +3,8 @@
|
||||
|
||||
set -e
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
part=
|
||||
offset_blocks=
|
||||
block_size=
|
||||
@ -99,8 +101,8 @@ switch() {
|
||||
}
|
||||
|
||||
main() {
|
||||
machine=$(sed -n -e 's/^machine\s\+:\s\+//p' < /proc/cpuinfo)
|
||||
if [ "$machine" = "TP-Link Archer VR1200v (v2)" ]; then
|
||||
case "$(board_name)" in
|
||||
tplink,archer-vr1200v-v2)
|
||||
# 03fe0000
|
||||
part=$(part_named '"reserve"')
|
||||
offset_blocks=0
|
||||
@ -108,7 +110,8 @@ main() {
|
||||
code_offset=0
|
||||
code_openwrt=0000000101000002
|
||||
code_factory=0000000101010003
|
||||
elif [ "$machine" = "Nokia G-240G-E" ]; then
|
||||
;;
|
||||
nokia,g240g-e)
|
||||
part=$(part_named '"flag"')
|
||||
offset_blocks=0
|
||||
block_size=$((1024 * 128))
|
||||
@ -116,7 +119,8 @@ main() {
|
||||
code_openwrt=000000000000000000000001000000010000000000000000
|
||||
code_factory=000000000000000100000001000000010000000000000000
|
||||
read_mask=000000000000000X00000000000000000000000000000000
|
||||
elif [ "$machine" = "SmartFiber XP8421-B" ]; then
|
||||
;;
|
||||
smartfiber,xp8421-b)
|
||||
# 0dfc0000
|
||||
part=$(part_named '"reservearea"')
|
||||
offset_blocks=12
|
||||
@ -124,7 +128,8 @@ main() {
|
||||
code_offset=0
|
||||
code_openwrt=30000000
|
||||
code_factory=31000000
|
||||
elif [ "$machine" = "Zyxel PMG5617GA" ]; then
|
||||
;;
|
||||
zyxel,pmg5617ga)
|
||||
# 00060fff
|
||||
part=$(part_named '"reservearea"')
|
||||
offset_blocks=3
|
||||
@ -132,10 +137,12 @@ main() {
|
||||
code_offset=4095
|
||||
code_openwrt=30
|
||||
code_factory=31
|
||||
else
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported machine: $machine"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$1" = "factory" ]; then
|
||||
switch factory
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
/ {
|
||||
model = "Zyxel PMG5617GA";
|
||||
compatible = "tplink,zyxel-pmg5617ga", "econet,en751221";
|
||||
compatible = "zyxel,pmg5617ga", "econet,en751221";
|
||||
|
||||
memory@0 {
|
||||
device_type = "memory";
|
||||
|
||||
@ -1,80 +0,0 @@
|
||||
From 7e1241396c241f9b4fff2ff133806fef4ddd9ecc Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Sun, 7 Dec 2025 22:18:11 +0100
|
||||
Subject: [PATCH] resource: handle wrong resource_size value on zero start/end
|
||||
resource
|
||||
|
||||
Commit 900730dc4705 ("wifi: ath: Use
|
||||
of_reserved_mem_region_to_resource() for "memory-region"") uncovered a
|
||||
massive problem with the usage of resource_size() helper.
|
||||
|
||||
The reported commit caused a regression with ath11k WiFi firmware
|
||||
loading and the change was just a simple replacement of duplicate code
|
||||
with a new helper of_reserved_mem_region_to_resource().
|
||||
|
||||
On reworking this, in the commit also a check for the presence of the
|
||||
node was replaced with resource_size(&res). This was done following the
|
||||
logic that if the node wasn't present then it's expected that also the
|
||||
resource_size is zero, mimicking the same if-else logic.
|
||||
|
||||
This was also the reason the regression was mostly hard to catch at
|
||||
first sight as the rework is correctly done given the assumption on the
|
||||
used helpers.
|
||||
|
||||
BUT this is actually not the case. On further inspection on
|
||||
resource_size() it was found that it NEVER actually returns 0.
|
||||
|
||||
Even if the resource value of start and end are 0, the return value of
|
||||
resource_size() will ALWAYS be 1, resulting in the broken if-else
|
||||
condition ALWAYS going in the first if condition.
|
||||
|
||||
This was simply confirmed by reading the resource_size() logic:
|
||||
|
||||
return res->end - res->start + 1;
|
||||
|
||||
Given the confusion, also other case of such usage were searched in the
|
||||
kernel and with great suprise it seems LOTS of place assume
|
||||
resource_size() should return zero in the context of the resource start
|
||||
and end set to 0.
|
||||
|
||||
Quoting for example comments in drivers/vfio/pci/vfio_pci_core.c:
|
||||
|
||||
/*
|
||||
* The PCI core shouldn't set up a resource with a
|
||||
* type but zero size. But there may be bugs that
|
||||
* cause us to do that.
|
||||
*/
|
||||
if (!resource_size(res))
|
||||
goto no_mmap;
|
||||
|
||||
It really seems resource_size() was tought with the assumption that
|
||||
resource struct was always correctly initialized before calling it and
|
||||
never set to zero.
|
||||
|
||||
But across the year this got lost and now there are lots of driver that
|
||||
assume resource_size() returns 0 if start and end are also 0.
|
||||
|
||||
To better handle this and make resource_size() returns correct value in
|
||||
such case, add a simple check and return 0 if both resource start and
|
||||
resource end are zero.
|
||||
|
||||
Cc: Rob Herring (Arm) <robh@kernel.org>
|
||||
Cc: stable@vger.kernel.org
|
||||
Fixes: 1a4e564b7db9 ("resource: add resource_size()")
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
include/linux/ioport.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
--- a/include/linux/ioport.h
|
||||
+++ b/include/linux/ioport.h
|
||||
@@ -283,6 +283,9 @@ static inline void resource_set_range(st
|
||||
|
||||
static inline resource_size_t resource_size(const struct resource *res)
|
||||
{
|
||||
+ if (!res->start && !res->end)
|
||||
+ return 0;
|
||||
+
|
||||
return res->end - res->start + 1;
|
||||
}
|
||||
static inline unsigned long resource_type(const struct resource *res)
|
||||
@ -0,0 +1,68 @@
|
||||
From 6ab55e0a9eac638ca390bfaef6408c10c127e623 Mon Sep 17 00:00:00 2001
|
||||
From: Chenghao Duan <duanchenghao@kylinos.cn>
|
||||
Date: Sun, 3 Aug 2025 22:49:50 +0800
|
||||
Subject: [PATCH 01/12] LoongArch: Add larch_insn_gen_{beq,bne} helpers
|
||||
|
||||
Add larch_insn_gen_beq() and larch_insn_gen_bne() helpers which will be
|
||||
used in BPF trampoline implementation.
|
||||
|
||||
Reviewed-by: Hengqi Chen <hengqi.chen@gmail.com>
|
||||
Co-developed-by: George Guo <guodongtai@kylinos.cn>
|
||||
Signed-off-by: George Guo <guodongtai@kylinos.cn>
|
||||
Co-developed-by: Youling Tang <tangyouling@kylinos.cn>
|
||||
Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
|
||||
Signed-off-by: Chenghao Duan <duanchenghao@kylinos.cn>
|
||||
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
|
||||
---
|
||||
arch/loongarch/include/asm/inst.h | 2 ++
|
||||
arch/loongarch/kernel/inst.c | 28 ++++++++++++++++++++++++++++
|
||||
2 files changed, 30 insertions(+)
|
||||
|
||||
--- a/arch/loongarch/include/asm/inst.h
|
||||
+++ b/arch/loongarch/include/asm/inst.h
|
||||
@@ -515,6 +515,8 @@ u32 larch_insn_gen_move(enum loongarch_g
|
||||
u32 larch_insn_gen_lu12iw(enum loongarch_gpr rd, int imm);
|
||||
u32 larch_insn_gen_lu32id(enum loongarch_gpr rd, int imm);
|
||||
u32 larch_insn_gen_lu52id(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm);
|
||||
+u32 larch_insn_gen_beq(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm);
|
||||
+u32 larch_insn_gen_bne(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm);
|
||||
u32 larch_insn_gen_jirl(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm);
|
||||
|
||||
static inline bool signed_imm_check(long val, unsigned int bit)
|
||||
--- a/arch/loongarch/kernel/inst.c
|
||||
+++ b/arch/loongarch/kernel/inst.c
|
||||
@@ -335,6 +335,34 @@ u32 larch_insn_gen_lu52id(enum loongarch
|
||||
return insn.word;
|
||||
}
|
||||
|
||||
+u32 larch_insn_gen_beq(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm)
|
||||
+{
|
||||
+ union loongarch_instruction insn;
|
||||
+
|
||||
+ if ((imm & 3) || imm < -SZ_128K || imm >= SZ_128K) {
|
||||
+ pr_warn("The generated beq instruction is out of range.\n");
|
||||
+ return INSN_BREAK;
|
||||
+ }
|
||||
+
|
||||
+ emit_beq(&insn, rj, rd, imm >> 2);
|
||||
+
|
||||
+ return insn.word;
|
||||
+}
|
||||
+
|
||||
+u32 larch_insn_gen_bne(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm)
|
||||
+{
|
||||
+ union loongarch_instruction insn;
|
||||
+
|
||||
+ if ((imm & 3) || imm < -SZ_128K || imm >= SZ_128K) {
|
||||
+ pr_warn("The generated bne instruction is out of range.\n");
|
||||
+ return INSN_BREAK;
|
||||
+ }
|
||||
+
|
||||
+ emit_bne(&insn, rj, rd, imm >> 2);
|
||||
+
|
||||
+ return insn.word;
|
||||
+}
|
||||
+
|
||||
u32 larch_insn_gen_jirl(enum loongarch_gpr rd, enum loongarch_gpr rj, int imm)
|
||||
{
|
||||
union loongarch_instruction insn;
|
||||
@ -0,0 +1,52 @@
|
||||
From ed1a1fe6ec5e73b23b310b434ace07d1e5060657 Mon Sep 17 00:00:00 2001
|
||||
From: Chenghao Duan <duanchenghao@kylinos.cn>
|
||||
Date: Tue, 5 Aug 2025 19:00:18 +0800
|
||||
Subject: [PATCH 02/12] LoongArch: BPF: Rename and refactor validate_code()
|
||||
|
||||
1. Rename the existing validate_code() to validate_ctx()
|
||||
2. Factor out the code validation handling into a new helper
|
||||
validate_code()
|
||||
|
||||
Then:
|
||||
|
||||
* validate_code() is used to check the validity of code.
|
||||
* validate_ctx() is used to check both code validity and table entry
|
||||
correctness.
|
||||
|
||||
The new validate_code() will be used in subsequent changes.
|
||||
|
||||
Reviewed-by: Hengqi Chen <hengqi.chen@gmail.com>
|
||||
Co-developed-by: George Guo <guodongtai@kylinos.cn>
|
||||
Signed-off-by: George Guo <guodongtai@kylinos.cn>
|
||||
Signed-off-by: Chenghao Duan <duanchenghao@kylinos.cn>
|
||||
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
|
||||
---
|
||||
arch/loongarch/net/bpf_jit.c | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/loongarch/net/bpf_jit.c
|
||||
+++ b/arch/loongarch/net/bpf_jit.c
|
||||
@@ -1170,6 +1170,14 @@ static int validate_code(struct jit_ctx
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int validate_ctx(struct jit_ctx *ctx)
|
||||
+{
|
||||
+ if (validate_code(ctx))
|
||||
+ return -1;
|
||||
+
|
||||
if (WARN_ON_ONCE(ctx->num_exentries != ctx->prog->aux->num_exentries))
|
||||
return -1;
|
||||
|
||||
@@ -1278,7 +1286,7 @@ skip_init_ctx:
|
||||
build_epilogue(&ctx);
|
||||
|
||||
/* 3. Extra pass to validate JITed code */
|
||||
- if (validate_code(&ctx)) {
|
||||
+ if (validate_ctx(&ctx)) {
|
||||
bpf_jit_binary_free(header);
|
||||
prog = orig_prog;
|
||||
goto out_offset;
|
||||
@ -0,0 +1,240 @@
|
||||
From 9fbd18cf4c69f512f7de3ab73235078f3e32ecec Mon Sep 17 00:00:00 2001
|
||||
From: Chenghao Duan <duanchenghao@kylinos.cn>
|
||||
Date: Tue, 5 Aug 2025 19:00:18 +0800
|
||||
Subject: [PATCH 03/12] LoongArch: BPF: Add dynamic code modification support
|
||||
|
||||
This commit adds support for BPF dynamic code modification on the
|
||||
LoongArch architecture:
|
||||
1. Add bpf_arch_text_copy() for instruction block copying.
|
||||
2. Add bpf_arch_text_poke() for runtime instruction patching.
|
||||
3. Add bpf_arch_text_invalidate() for code invalidation.
|
||||
|
||||
On LoongArch, since symbol addresses in the direct mapping region can't
|
||||
be reached via relative jump instructions from the paged mapping region,
|
||||
we use the move_imm+jirl instruction pair as absolute jump instructions.
|
||||
These require 2-5 instructions, so we reserve 5 NOP instructions in the
|
||||
program as placeholders for function jumps.
|
||||
|
||||
The larch_insn_text_copy() function is solely used for BPF. And the use
|
||||
of larch_insn_text_copy() requires PAGE_SIZE alignment. Currently, only
|
||||
the size of the BPF trampoline is page-aligned.
|
||||
|
||||
Co-developed-by: George Guo <guodongtai@kylinos.cn>
|
||||
Signed-off-by: George Guo <guodongtai@kylinos.cn>
|
||||
Signed-off-by: Chenghao Duan <duanchenghao@kylinos.cn>
|
||||
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
|
||||
---
|
||||
arch/loongarch/include/asm/inst.h | 1 +
|
||||
arch/loongarch/kernel/inst.c | 46 +++++++++++++
|
||||
arch/loongarch/net/bpf_jit.c | 105 +++++++++++++++++++++++++++++-
|
||||
3 files changed, 151 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/loongarch/include/asm/inst.h
|
||||
+++ b/arch/loongarch/include/asm/inst.h
|
||||
@@ -502,6 +502,7 @@ void arch_simulate_insn(union loongarch_
|
||||
int larch_insn_read(void *addr, u32 *insnp);
|
||||
int larch_insn_write(void *addr, u32 insn);
|
||||
int larch_insn_patch_text(void *addr, u32 insn);
|
||||
+int larch_insn_text_copy(void *dst, void *src, size_t len);
|
||||
|
||||
u32 larch_insn_gen_nop(void);
|
||||
u32 larch_insn_gen_b(unsigned long pc, unsigned long dest);
|
||||
--- a/arch/loongarch/kernel/inst.c
|
||||
+++ b/arch/loongarch/kernel/inst.c
|
||||
@@ -4,6 +4,8 @@
|
||||
*/
|
||||
#include <linux/sizes.h>
|
||||
#include <linux/uaccess.h>
|
||||
+#include <linux/set_memory.h>
|
||||
+#include <linux/stop_machine.h>
|
||||
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/inst.h>
|
||||
@@ -229,6 +231,50 @@ int larch_insn_patch_text(void *addr, u3
|
||||
|
||||
return ret;
|
||||
}
|
||||
+
|
||||
+struct insn_copy {
|
||||
+ void *dst;
|
||||
+ void *src;
|
||||
+ size_t len;
|
||||
+ unsigned int cpu;
|
||||
+};
|
||||
+
|
||||
+static int text_copy_cb(void *data)
|
||||
+{
|
||||
+ int ret = 0;
|
||||
+ struct insn_copy *copy = data;
|
||||
+
|
||||
+ if (smp_processor_id() == copy->cpu) {
|
||||
+ ret = copy_to_kernel_nofault(copy->dst, copy->src, copy->len);
|
||||
+ if (ret)
|
||||
+ pr_err("%s: operation failed\n", __func__);
|
||||
+ }
|
||||
+
|
||||
+ flush_icache_range((unsigned long)copy->dst, (unsigned long)copy->dst + copy->len);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+int larch_insn_text_copy(void *dst, void *src, size_t len)
|
||||
+{
|
||||
+ int ret = 0;
|
||||
+ size_t start, end;
|
||||
+ struct insn_copy copy = {
|
||||
+ .dst = dst,
|
||||
+ .src = src,
|
||||
+ .len = len,
|
||||
+ .cpu = smp_processor_id(),
|
||||
+ };
|
||||
+
|
||||
+ start = round_down((size_t)dst, PAGE_SIZE);
|
||||
+ end = round_up((size_t)dst + len, PAGE_SIZE);
|
||||
+
|
||||
+ set_memory_rw(start, (end - start) / PAGE_SIZE);
|
||||
+ ret = stop_machine(text_copy_cb, ©, cpu_online_mask);
|
||||
+ set_memory_rox(start, (end - start) / PAGE_SIZE);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
|
||||
u32 larch_insn_gen_nop(void)
|
||||
{
|
||||
--- a/arch/loongarch/net/bpf_jit.c
|
||||
+++ b/arch/loongarch/net/bpf_jit.c
|
||||
@@ -4,8 +4,12 @@
|
||||
*
|
||||
* Copyright (C) 2022 Loongson Technology Corporation Limited
|
||||
*/
|
||||
+#include <linux/memory.h>
|
||||
#include "bpf_jit.h"
|
||||
|
||||
+#define LOONGARCH_LONG_JUMP_NINSNS 5
|
||||
+#define LOONGARCH_LONG_JUMP_NBYTES (LOONGARCH_LONG_JUMP_NINSNS * 4)
|
||||
+
|
||||
#define REG_TCC LOONGARCH_GPR_A6
|
||||
#define TCC_SAVED LOONGARCH_GPR_S5
|
||||
|
||||
@@ -88,7 +92,7 @@ static u8 tail_call_reg(struct jit_ctx *
|
||||
*/
|
||||
static void build_prologue(struct jit_ctx *ctx)
|
||||
{
|
||||
- int stack_adjust = 0, store_offset, bpf_stack_adjust;
|
||||
+ int i, stack_adjust = 0, store_offset, bpf_stack_adjust;
|
||||
|
||||
bpf_stack_adjust = round_up(ctx->prog->aux->stack_depth, 16);
|
||||
|
||||
@@ -98,6 +102,10 @@ static void build_prologue(struct jit_ct
|
||||
stack_adjust = round_up(stack_adjust, 16);
|
||||
stack_adjust += bpf_stack_adjust;
|
||||
|
||||
+ /* Reserve space for the move_imm + jirl instruction */
|
||||
+ for (i = 0; i < LOONGARCH_LONG_JUMP_NINSNS; i++)
|
||||
+ emit_insn(ctx, nop);
|
||||
+
|
||||
/*
|
||||
* First instruction initializes the tail call count (TCC).
|
||||
* On tail call we skip this instruction, and the TCC is
|
||||
@@ -1184,6 +1192,101 @@ static int validate_ctx(struct jit_ctx *
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int emit_jump_and_link(struct jit_ctx *ctx, u8 rd, u64 target)
|
||||
+{
|
||||
+ if (!target) {
|
||||
+ pr_err("bpf_jit: jump target address is error\n");
|
||||
+ return -EFAULT;
|
||||
+ }
|
||||
+
|
||||
+ move_imm(ctx, LOONGARCH_GPR_T1, target, false);
|
||||
+ emit_insn(ctx, jirl, rd, LOONGARCH_GPR_T1, 0);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int emit_jump_or_nops(void *target, void *ip, u32 *insns, bool is_call)
|
||||
+{
|
||||
+ int i;
|
||||
+ struct jit_ctx ctx;
|
||||
+
|
||||
+ ctx.idx = 0;
|
||||
+ ctx.image = (union loongarch_instruction *)insns;
|
||||
+
|
||||
+ if (!target) {
|
||||
+ for (i = 0; i < LOONGARCH_LONG_JUMP_NINSNS; i++)
|
||||
+ emit_insn((&ctx), nop);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return emit_jump_and_link(&ctx, is_call ? LOONGARCH_GPR_T0 : LOONGARCH_GPR_ZERO, (u64)target);
|
||||
+}
|
||||
+
|
||||
+void *bpf_arch_text_copy(void *dst, void *src, size_t len)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ mutex_lock(&text_mutex);
|
||||
+ ret = larch_insn_text_copy(dst, src, len);
|
||||
+ mutex_unlock(&text_mutex);
|
||||
+
|
||||
+ return ret ? ERR_PTR(-EINVAL) : dst;
|
||||
+}
|
||||
+
|
||||
+int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type poke_type,
|
||||
+ void *old_addr, void *new_addr)
|
||||
+{
|
||||
+ int ret;
|
||||
+ bool is_call = (poke_type == BPF_MOD_CALL);
|
||||
+ u32 old_insns[LOONGARCH_LONG_JUMP_NINSNS] = {[0 ... 4] = INSN_NOP};
|
||||
+ u32 new_insns[LOONGARCH_LONG_JUMP_NINSNS] = {[0 ... 4] = INSN_NOP};
|
||||
+
|
||||
+ if (!is_kernel_text((unsigned long)ip) &&
|
||||
+ !is_bpf_text_address((unsigned long)ip))
|
||||
+ return -ENOTSUPP;
|
||||
+
|
||||
+ ret = emit_jump_or_nops(old_addr, ip, old_insns, is_call);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ if (memcmp(ip, old_insns, LOONGARCH_LONG_JUMP_NBYTES))
|
||||
+ return -EFAULT;
|
||||
+
|
||||
+ ret = emit_jump_or_nops(new_addr, ip, new_insns, is_call);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ mutex_lock(&text_mutex);
|
||||
+ if (memcmp(ip, new_insns, LOONGARCH_LONG_JUMP_NBYTES))
|
||||
+ ret = larch_insn_text_copy(ip, new_insns, LOONGARCH_LONG_JUMP_NBYTES);
|
||||
+ mutex_unlock(&text_mutex);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+int bpf_arch_text_invalidate(void *dst, size_t len)
|
||||
+{
|
||||
+ int i;
|
||||
+ int ret = 0;
|
||||
+ u32 *inst;
|
||||
+
|
||||
+ inst = kvmalloc(len, GFP_KERNEL);
|
||||
+ if (!inst)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ for (i = 0; i < (len / sizeof(u32)); i++)
|
||||
+ inst[i] = INSN_BREAK;
|
||||
+
|
||||
+ mutex_lock(&text_mutex);
|
||||
+ if (larch_insn_text_copy(dst, inst, len))
|
||||
+ ret = -EINVAL;
|
||||
+ mutex_unlock(&text_mutex);
|
||||
+
|
||||
+ kvfree(inst);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
|
||||
{
|
||||
bool tmp_blinded = false, extra_pass = false;
|
||||
@ -0,0 +1,467 @@
|
||||
From f9b6b41f0cf31791541cea9644ddbedb46465801 Mon Sep 17 00:00:00 2001
|
||||
From: Chenghao Duan <duanchenghao@kylinos.cn>
|
||||
Date: Tue, 5 Aug 2025 19:00:18 +0800
|
||||
Subject: [PATCH 04/12] LoongArch: BPF: Add basic bpf trampoline support
|
||||
|
||||
BPF trampoline is the critical infrastructure of the BPF subsystem,
|
||||
acting as a mediator between kernel functions and BPF programs. Numerous
|
||||
important features, such as using BPF program for zero overhead kernel
|
||||
introspection, rely on this key component.
|
||||
|
||||
The related tests have passed, including the following technical points:
|
||||
1. fentry
|
||||
2. fmod_ret
|
||||
3. fexit
|
||||
|
||||
The following related testcases passed on LoongArch:
|
||||
sudo ./test_progs -a fentry_test/fentry
|
||||
sudo ./test_progs -a fexit_test/fexit
|
||||
sudo ./test_progs -a fentry_fexit
|
||||
sudo ./test_progs -a modify_return
|
||||
sudo ./test_progs -a fexit_sleep
|
||||
sudo ./test_progs -a test_overhead
|
||||
sudo ./test_progs -a trampoline_count
|
||||
|
||||
This issue was first reported by Geliang Tang in June 2024 while
|
||||
debugging MPTCP BPF selftests on a LoongArch machine (see commit
|
||||
eef0532e900c "selftests/bpf: Null checks for links in bpf_tcp_ca").
|
||||
Geliang, Huacai, and Tiezhu then worked together to drive the
|
||||
implementation of this feature, encouraging broader collaboration among
|
||||
Chinese kernel engineers.
|
||||
|
||||
Reported-by: kernel test robot <lkp@intel.com>
|
||||
Closes: https://lore.kernel.org/oe-kbuild-all/202507100034.wXofj6VX-lkp@intel.com/
|
||||
Reported-by: Geliang Tang <geliang@kernel.org>
|
||||
Tested-by: Tiezhu Yang <yangtiezhu@loongson.cn>
|
||||
Tested-by: Vincent Li <vincent.mc.li@gmail.com>
|
||||
Co-developed-by: George Guo <guodongtai@kylinos.cn>
|
||||
Signed-off-by: George Guo <guodongtai@kylinos.cn>
|
||||
Signed-off-by: Chenghao Duan <duanchenghao@kylinos.cn>
|
||||
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
|
||||
---
|
||||
arch/loongarch/net/bpf_jit.c | 377 +++++++++++++++++++++++++++++++++++
|
||||
arch/loongarch/net/bpf_jit.h | 6 +
|
||||
2 files changed, 383 insertions(+)
|
||||
|
||||
--- a/arch/loongarch/net/bpf_jit.c
|
||||
+++ b/arch/loongarch/net/bpf_jit.c
|
||||
@@ -7,9 +7,15 @@
|
||||
#include <linux/memory.h>
|
||||
#include "bpf_jit.h"
|
||||
|
||||
+#define LOONGARCH_MAX_REG_ARGS 8
|
||||
+
|
||||
#define LOONGARCH_LONG_JUMP_NINSNS 5
|
||||
#define LOONGARCH_LONG_JUMP_NBYTES (LOONGARCH_LONG_JUMP_NINSNS * 4)
|
||||
|
||||
+#define LOONGARCH_FENTRY_NINSNS 2
|
||||
+#define LOONGARCH_FENTRY_NBYTES (LOONGARCH_FENTRY_NINSNS * 4)
|
||||
+#define LOONGARCH_BPF_FENTRY_NBYTES (LOONGARCH_LONG_JUMP_NINSNS * 4)
|
||||
+
|
||||
#define REG_TCC LOONGARCH_GPR_A6
|
||||
#define TCC_SAVED LOONGARCH_GPR_S5
|
||||
|
||||
@@ -1222,6 +1228,11 @@ static int emit_jump_or_nops(void *targe
|
||||
return emit_jump_and_link(&ctx, is_call ? LOONGARCH_GPR_T0 : LOONGARCH_GPR_ZERO, (u64)target);
|
||||
}
|
||||
|
||||
+static int emit_call(struct jit_ctx *ctx, u64 addr)
|
||||
+{
|
||||
+ return emit_jump_and_link(ctx, LOONGARCH_GPR_RA, addr);
|
||||
+}
|
||||
+
|
||||
void *bpf_arch_text_copy(void *dst, void *src, size_t len)
|
||||
{
|
||||
int ret;
|
||||
@@ -1287,6 +1298,372 @@ int bpf_arch_text_invalidate(void *dst,
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static void store_args(struct jit_ctx *ctx, int nargs, int args_off)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < nargs; i++) {
|
||||
+ emit_insn(ctx, std, LOONGARCH_GPR_A0 + i, LOONGARCH_GPR_FP, -args_off);
|
||||
+ args_off -= 8;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void restore_args(struct jit_ctx *ctx, int nargs, int args_off)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < nargs; i++) {
|
||||
+ emit_insn(ctx, ldd, LOONGARCH_GPR_A0 + i, LOONGARCH_GPR_FP, -args_off);
|
||||
+ args_off -= 8;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int invoke_bpf_prog(struct jit_ctx *ctx, struct bpf_tramp_link *l,
|
||||
+ int args_off, int retval_off, int run_ctx_off, bool save_ret)
|
||||
+{
|
||||
+ int ret;
|
||||
+ u32 *branch;
|
||||
+ struct bpf_prog *p = l->link.prog;
|
||||
+ int cookie_off = offsetof(struct bpf_tramp_run_ctx, bpf_cookie);
|
||||
+
|
||||
+ if (l->cookie) {
|
||||
+ move_imm(ctx, LOONGARCH_GPR_T1, l->cookie, false);
|
||||
+ emit_insn(ctx, std, LOONGARCH_GPR_T1, LOONGARCH_GPR_FP, -run_ctx_off + cookie_off);
|
||||
+ } else {
|
||||
+ emit_insn(ctx, std, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_FP, -run_ctx_off + cookie_off);
|
||||
+ }
|
||||
+
|
||||
+ /* arg1: prog */
|
||||
+ move_imm(ctx, LOONGARCH_GPR_A0, (const s64)p, false);
|
||||
+ /* arg2: &run_ctx */
|
||||
+ emit_insn(ctx, addid, LOONGARCH_GPR_A1, LOONGARCH_GPR_FP, -run_ctx_off);
|
||||
+ ret = emit_call(ctx, (const u64)bpf_trampoline_enter(p));
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* store prog start time */
|
||||
+ move_reg(ctx, LOONGARCH_GPR_S1, LOONGARCH_GPR_A0);
|
||||
+
|
||||
+ /*
|
||||
+ * if (__bpf_prog_enter(prog) == 0)
|
||||
+ * goto skip_exec_of_prog;
|
||||
+ */
|
||||
+ branch = (u32 *)ctx->image + ctx->idx;
|
||||
+ /* nop reserved for conditional jump */
|
||||
+ emit_insn(ctx, nop);
|
||||
+
|
||||
+ /* arg1: &args_off */
|
||||
+ emit_insn(ctx, addid, LOONGARCH_GPR_A0, LOONGARCH_GPR_FP, -args_off);
|
||||
+ if (!p->jited)
|
||||
+ move_imm(ctx, LOONGARCH_GPR_A1, (const s64)p->insnsi, false);
|
||||
+ ret = emit_call(ctx, (const u64)p->bpf_func);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ if (save_ret) {
|
||||
+ emit_insn(ctx, std, LOONGARCH_GPR_A0, LOONGARCH_GPR_FP, -retval_off);
|
||||
+ emit_insn(ctx, std, regmap[BPF_REG_0], LOONGARCH_GPR_FP, -(retval_off - 8));
|
||||
+ }
|
||||
+
|
||||
+ /* update branch with beqz */
|
||||
+ if (ctx->image) {
|
||||
+ int offset = (void *)(&ctx->image[ctx->idx]) - (void *)branch;
|
||||
+ *branch = larch_insn_gen_beq(LOONGARCH_GPR_A0, LOONGARCH_GPR_ZERO, offset);
|
||||
+ }
|
||||
+
|
||||
+ /* arg1: prog */
|
||||
+ move_imm(ctx, LOONGARCH_GPR_A0, (const s64)p, false);
|
||||
+ /* arg2: prog start time */
|
||||
+ move_reg(ctx, LOONGARCH_GPR_A1, LOONGARCH_GPR_S1);
|
||||
+ /* arg3: &run_ctx */
|
||||
+ emit_insn(ctx, addid, LOONGARCH_GPR_A2, LOONGARCH_GPR_FP, -run_ctx_off);
|
||||
+ ret = emit_call(ctx, (const u64)bpf_trampoline_exit(p));
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static void invoke_bpf_mod_ret(struct jit_ctx *ctx, struct bpf_tramp_links *tl,
|
||||
+ int args_off, int retval_off, int run_ctx_off, u32 **branches)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ emit_insn(ctx, std, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_FP, -retval_off);
|
||||
+ for (i = 0; i < tl->nr_links; i++) {
|
||||
+ invoke_bpf_prog(ctx, tl->links[i], args_off, retval_off, run_ctx_off, true);
|
||||
+ emit_insn(ctx, ldd, LOONGARCH_GPR_T1, LOONGARCH_GPR_FP, -retval_off);
|
||||
+ branches[i] = (u32 *)ctx->image + ctx->idx;
|
||||
+ emit_insn(ctx, nop);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void *arch_alloc_bpf_trampoline(unsigned int size)
|
||||
+{
|
||||
+ return bpf_prog_pack_alloc(size, jit_fill_hole);
|
||||
+}
|
||||
+
|
||||
+void arch_free_bpf_trampoline(void *image, unsigned int size)
|
||||
+{
|
||||
+ bpf_prog_pack_free(image, size);
|
||||
+}
|
||||
+
|
||||
+static int __arch_prepare_bpf_trampoline(struct jit_ctx *ctx, struct bpf_tramp_image *im,
|
||||
+ const struct btf_func_model *m, struct bpf_tramp_links *tlinks,
|
||||
+ void *func_addr, u32 flags)
|
||||
+{
|
||||
+ int i, ret, save_ret;
|
||||
+ int stack_size = 0, nargs = 0;
|
||||
+ int retval_off, args_off, nargs_off, ip_off, run_ctx_off, sreg_off;
|
||||
+ void *orig_call = func_addr;
|
||||
+ struct bpf_tramp_links *fentry = &tlinks[BPF_TRAMP_FENTRY];
|
||||
+ struct bpf_tramp_links *fexit = &tlinks[BPF_TRAMP_FEXIT];
|
||||
+ struct bpf_tramp_links *fmod_ret = &tlinks[BPF_TRAMP_MODIFY_RETURN];
|
||||
+ u32 **branches = NULL;
|
||||
+
|
||||
+ if (flags & (BPF_TRAMP_F_ORIG_STACK | BPF_TRAMP_F_SHARE_IPMODIFY))
|
||||
+ return -ENOTSUPP;
|
||||
+
|
||||
+ /*
|
||||
+ * FP + 8 [ RA to parent func ] return address to parent
|
||||
+ * function
|
||||
+ * FP + 0 [ FP of parent func ] frame pointer of parent
|
||||
+ * function
|
||||
+ * FP - 8 [ T0 to traced func ] return address of traced
|
||||
+ * function
|
||||
+ * FP - 16 [ FP of traced func ] frame pointer of traced
|
||||
+ * function
|
||||
+ *
|
||||
+ * FP - retval_off [ return value ] BPF_TRAMP_F_CALL_ORIG or
|
||||
+ * BPF_TRAMP_F_RET_FENTRY_RET
|
||||
+ * [ argN ]
|
||||
+ * [ ... ]
|
||||
+ * FP - args_off [ arg1 ]
|
||||
+ *
|
||||
+ * FP - nargs_off [ regs count ]
|
||||
+ *
|
||||
+ * FP - ip_off [ traced func ] BPF_TRAMP_F_IP_ARG
|
||||
+ *
|
||||
+ * FP - run_ctx_off [ bpf_tramp_run_ctx ]
|
||||
+ *
|
||||
+ * FP - sreg_off [ callee saved reg ]
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+ if (m->nr_args > LOONGARCH_MAX_REG_ARGS)
|
||||
+ return -ENOTSUPP;
|
||||
+
|
||||
+ if (flags & (BPF_TRAMP_F_ORIG_STACK | BPF_TRAMP_F_SHARE_IPMODIFY))
|
||||
+ return -ENOTSUPP;
|
||||
+
|
||||
+ stack_size = 0;
|
||||
+
|
||||
+ /* Room of trampoline frame to store return address and frame pointer */
|
||||
+ stack_size += 16;
|
||||
+
|
||||
+ save_ret = flags & (BPF_TRAMP_F_CALL_ORIG | BPF_TRAMP_F_RET_FENTRY_RET);
|
||||
+ if (save_ret) {
|
||||
+ /* Save BPF R0 and A0 */
|
||||
+ stack_size += 16;
|
||||
+ retval_off = stack_size;
|
||||
+ }
|
||||
+
|
||||
+ /* Room of trampoline frame to store args */
|
||||
+ nargs = m->nr_args;
|
||||
+ stack_size += nargs * 8;
|
||||
+ args_off = stack_size;
|
||||
+
|
||||
+ /* Room of trampoline frame to store args number */
|
||||
+ stack_size += 8;
|
||||
+ nargs_off = stack_size;
|
||||
+
|
||||
+ /* Room of trampoline frame to store ip address */
|
||||
+ if (flags & BPF_TRAMP_F_IP_ARG) {
|
||||
+ stack_size += 8;
|
||||
+ ip_off = stack_size;
|
||||
+ }
|
||||
+
|
||||
+ /* Room of trampoline frame to store struct bpf_tramp_run_ctx */
|
||||
+ stack_size += round_up(sizeof(struct bpf_tramp_run_ctx), 8);
|
||||
+ run_ctx_off = stack_size;
|
||||
+
|
||||
+ stack_size += 8;
|
||||
+ sreg_off = stack_size;
|
||||
+
|
||||
+ stack_size = round_up(stack_size, 16);
|
||||
+
|
||||
+ /* For the trampoline called from function entry */
|
||||
+ /* RA and FP for parent function */
|
||||
+ emit_insn(ctx, addid, LOONGARCH_GPR_SP, LOONGARCH_GPR_SP, -16);
|
||||
+ emit_insn(ctx, std, LOONGARCH_GPR_RA, LOONGARCH_GPR_SP, 8);
|
||||
+ emit_insn(ctx, std, LOONGARCH_GPR_FP, LOONGARCH_GPR_SP, 0);
|
||||
+ emit_insn(ctx, addid, LOONGARCH_GPR_FP, LOONGARCH_GPR_SP, 16);
|
||||
+
|
||||
+ /* RA and FP for traced function */
|
||||
+ emit_insn(ctx, addid, LOONGARCH_GPR_SP, LOONGARCH_GPR_SP, -stack_size);
|
||||
+ emit_insn(ctx, std, LOONGARCH_GPR_T0, LOONGARCH_GPR_SP, stack_size - 8);
|
||||
+ emit_insn(ctx, std, LOONGARCH_GPR_FP, LOONGARCH_GPR_SP, stack_size - 16);
|
||||
+ emit_insn(ctx, addid, LOONGARCH_GPR_FP, LOONGARCH_GPR_SP, stack_size);
|
||||
+
|
||||
+ /* callee saved register S1 to pass start time */
|
||||
+ emit_insn(ctx, std, LOONGARCH_GPR_S1, LOONGARCH_GPR_FP, -sreg_off);
|
||||
+
|
||||
+ /* store ip address of the traced function */
|
||||
+ if (flags & BPF_TRAMP_F_IP_ARG) {
|
||||
+ move_imm(ctx, LOONGARCH_GPR_T1, (const s64)func_addr, false);
|
||||
+ emit_insn(ctx, std, LOONGARCH_GPR_T1, LOONGARCH_GPR_FP, -ip_off);
|
||||
+ }
|
||||
+
|
||||
+ /* store nargs number */
|
||||
+ move_imm(ctx, LOONGARCH_GPR_T1, nargs, false);
|
||||
+ emit_insn(ctx, std, LOONGARCH_GPR_T1, LOONGARCH_GPR_FP, -nargs_off);
|
||||
+
|
||||
+ store_args(ctx, nargs, args_off);
|
||||
+
|
||||
+ /* To traced function */
|
||||
+ /* Ftrace jump skips 2 NOP instructions */
|
||||
+ if (is_kernel_text((unsigned long)orig_call))
|
||||
+ orig_call += LOONGARCH_FENTRY_NBYTES;
|
||||
+ /* Direct jump skips 5 NOP instructions */
|
||||
+ else if (is_bpf_text_address((unsigned long)orig_call))
|
||||
+ orig_call += LOONGARCH_BPF_FENTRY_NBYTES;
|
||||
+
|
||||
+ if (flags & BPF_TRAMP_F_CALL_ORIG) {
|
||||
+ move_imm(ctx, LOONGARCH_GPR_A0, (const s64)im, false);
|
||||
+ ret = emit_call(ctx, (const u64)__bpf_tramp_enter);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < fentry->nr_links; i++) {
|
||||
+ ret = invoke_bpf_prog(ctx, fentry->links[i], args_off, retval_off,
|
||||
+ run_ctx_off, flags & BPF_TRAMP_F_RET_FENTRY_RET);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ }
|
||||
+ if (fmod_ret->nr_links) {
|
||||
+ branches = kcalloc(fmod_ret->nr_links, sizeof(u32 *), GFP_KERNEL);
|
||||
+ if (!branches)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ invoke_bpf_mod_ret(ctx, fmod_ret, args_off, retval_off, run_ctx_off, branches);
|
||||
+ }
|
||||
+
|
||||
+ if (flags & BPF_TRAMP_F_CALL_ORIG) {
|
||||
+ restore_args(ctx, m->nr_args, args_off);
|
||||
+ ret = emit_call(ctx, (const u64)orig_call);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
+ emit_insn(ctx, std, LOONGARCH_GPR_A0, LOONGARCH_GPR_FP, -retval_off);
|
||||
+ emit_insn(ctx, std, regmap[BPF_REG_0], LOONGARCH_GPR_FP, -(retval_off - 8));
|
||||
+ im->ip_after_call = ctx->ro_image + ctx->idx;
|
||||
+ /* Reserve space for the move_imm + jirl instruction */
|
||||
+ for (i = 0; i < LOONGARCH_LONG_JUMP_NINSNS; i++)
|
||||
+ emit_insn(ctx, nop);
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; ctx->image && i < fmod_ret->nr_links; i++) {
|
||||
+ int offset = (void *)(&ctx->image[ctx->idx]) - (void *)branches[i];
|
||||
+ *branches[i] = larch_insn_gen_bne(LOONGARCH_GPR_T1, LOONGARCH_GPR_ZERO, offset);
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < fexit->nr_links; i++) {
|
||||
+ ret = invoke_bpf_prog(ctx, fexit->links[i], args_off, retval_off, run_ctx_off, false);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (flags & BPF_TRAMP_F_CALL_ORIG) {
|
||||
+ im->ip_epilogue = ctx->ro_image + ctx->idx;
|
||||
+ move_imm(ctx, LOONGARCH_GPR_A0, (const s64)im, false);
|
||||
+ ret = emit_call(ctx, (const u64)__bpf_tramp_exit);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (flags & BPF_TRAMP_F_RESTORE_REGS)
|
||||
+ restore_args(ctx, m->nr_args, args_off);
|
||||
+
|
||||
+ if (save_ret) {
|
||||
+ emit_insn(ctx, ldd, LOONGARCH_GPR_A0, LOONGARCH_GPR_FP, -retval_off);
|
||||
+ emit_insn(ctx, ldd, regmap[BPF_REG_0], LOONGARCH_GPR_FP, -(retval_off - 8));
|
||||
+ }
|
||||
+
|
||||
+ emit_insn(ctx, ldd, LOONGARCH_GPR_S1, LOONGARCH_GPR_FP, -sreg_off);
|
||||
+
|
||||
+ /* trampoline called from function entry */
|
||||
+ emit_insn(ctx, ldd, LOONGARCH_GPR_T0, LOONGARCH_GPR_SP, stack_size - 8);
|
||||
+ emit_insn(ctx, ldd, LOONGARCH_GPR_FP, LOONGARCH_GPR_SP, stack_size - 16);
|
||||
+ emit_insn(ctx, addid, LOONGARCH_GPR_SP, LOONGARCH_GPR_SP, stack_size);
|
||||
+
|
||||
+ emit_insn(ctx, ldd, LOONGARCH_GPR_RA, LOONGARCH_GPR_SP, 8);
|
||||
+ emit_insn(ctx, ldd, LOONGARCH_GPR_FP, LOONGARCH_GPR_SP, 0);
|
||||
+ emit_insn(ctx, addid, LOONGARCH_GPR_SP, LOONGARCH_GPR_SP, 16);
|
||||
+
|
||||
+ if (flags & BPF_TRAMP_F_SKIP_FRAME)
|
||||
+ /* return to parent function */
|
||||
+ emit_insn(ctx, jirl, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_RA, 0);
|
||||
+ else
|
||||
+ /* return to traced function */
|
||||
+ emit_insn(ctx, jirl, LOONGARCH_GPR_ZERO, LOONGARCH_GPR_T0, 0);
|
||||
+
|
||||
+ ret = ctx->idx;
|
||||
+out:
|
||||
+ kfree(branches);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *ro_image,
|
||||
+ void *ro_image_end, const struct btf_func_model *m,
|
||||
+ u32 flags, struct bpf_tramp_links *tlinks, void *func_addr)
|
||||
+{
|
||||
+ int ret, size;
|
||||
+ void *image, *tmp;
|
||||
+ struct jit_ctx ctx;
|
||||
+
|
||||
+ size = ro_image_end - ro_image;
|
||||
+ image = kvmalloc(size, GFP_KERNEL);
|
||||
+ if (!image)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ ctx.image = (union loongarch_instruction *)image;
|
||||
+ ctx.ro_image = (union loongarch_instruction *)ro_image;
|
||||
+ ctx.idx = 0;
|
||||
+
|
||||
+ jit_fill_hole(image, (unsigned int)(ro_image_end - ro_image));
|
||||
+ ret = __arch_prepare_bpf_trampoline(&ctx, im, m, tlinks, func_addr, flags);
|
||||
+ if (ret > 0 && validate_code(&ctx) < 0) {
|
||||
+ ret = -EINVAL;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ tmp = bpf_arch_text_copy(ro_image, image, size);
|
||||
+ if (IS_ERR(tmp)) {
|
||||
+ ret = PTR_ERR(tmp);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ bpf_flush_icache(ro_image, ro_image_end);
|
||||
+out:
|
||||
+ kvfree(image);
|
||||
+ return ret < 0 ? ret : size;
|
||||
+}
|
||||
+
|
||||
+int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,
|
||||
+ struct bpf_tramp_links *tlinks, void *func_addr)
|
||||
+{
|
||||
+ int ret;
|
||||
+ struct jit_ctx ctx;
|
||||
+ struct bpf_tramp_image im;
|
||||
+
|
||||
+ ctx.image = NULL;
|
||||
+ ctx.idx = 0;
|
||||
+
|
||||
+ ret = __arch_prepare_bpf_trampoline(&ctx, &im, m, tlinks, func_addr, flags);
|
||||
+
|
||||
+ /* Page align */
|
||||
+ return ret < 0 ? ret : round_up(ret * LOONGARCH_INSN_SIZE, PAGE_SIZE);
|
||||
+}
|
||||
+
|
||||
struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
|
||||
{
|
||||
bool tmp_blinded = false, extra_pass = false;
|
||||
--- a/arch/loongarch/net/bpf_jit.h
|
||||
+++ b/arch/loongarch/net/bpf_jit.h
|
||||
@@ -18,6 +18,7 @@ struct jit_ctx {
|
||||
u32 *offset;
|
||||
int num_exentries;
|
||||
union loongarch_instruction *image;
|
||||
+ union loongarch_instruction *ro_image;
|
||||
u32 stack_size;
|
||||
};
|
||||
|
||||
@@ -308,3 +309,8 @@ static inline int emit_tailcall_jmp(stru
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
+
|
||||
+static inline void bpf_flush_icache(void *start, void *end)
|
||||
+{
|
||||
+ flush_icache_range((unsigned long)start, (unsigned long)end);
|
||||
+}
|
||||
192
target/linux/mediatek/dts/mt7981b-kebidumei-ax3000-u22.dts
Normal file
192
target/linux/mediatek/dts/mt7981b-kebidumei-ax3000-u22.dts
Normal file
@ -0,0 +1,192 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
#include "mt7981b.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Kebidumei AX3000-U22";
|
||||
compatible = "kebidumei,ax3000-u22", "mediatek,mt7981b";
|
||||
|
||||
aliases {
|
||||
label-mac-device = &gmac1;
|
||||
|
||||
led-boot = &led_status_green;
|
||||
led-failsafe = &led_status_red;
|
||||
led-running = &led_status_green;
|
||||
led-upgrade = &led_status_green;
|
||||
|
||||
serial0 = &uart0;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
};
|
||||
|
||||
memory@40000000 {
|
||||
reg = <0 0x40000000 0 0x10000000>;
|
||||
device_type = "memory";
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
compatible = "gpio-keys";
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
wps {
|
||||
label = "wps";
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
gpios = <&pio 0 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led-0 {
|
||||
function = LED_FUNCTION_LAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&pio 6 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_status_red: led-1 {
|
||||
function = LED_FUNCTION_STATUS;
|
||||
color = <LED_COLOR_ID_RED>;
|
||||
gpios = <&pio 8 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led-2 {
|
||||
function = LED_FUNCTION_STATUS;
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
gpios = <&pio 35 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_status_green: led-3 {
|
||||
function = LED_FUNCTION_STATUS;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
gpios = <&pio 34 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&watchdog {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
ð {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mdio_pins>;
|
||||
|
||||
status = "okay";
|
||||
|
||||
gmac1: mac@1 {
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <1>;
|
||||
phy-mode = "gmii";
|
||||
phy-handle = <&int_gbe_phy>;
|
||||
nvmem-cells = <&macaddr_factory_e000 0>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
};
|
||||
|
||||
&spi2 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi2_flash_pins>;
|
||||
status = "okay";
|
||||
|
||||
flash@0 {
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
|
||||
spi-max-frequency = <52000000>;
|
||||
spi-tx-bus-width = <4>;
|
||||
spi-rx-bus-width = <4>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "bl2";
|
||||
reg = <0x00000 0x40000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@40000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x40000 0x10000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@50000 {
|
||||
label = "factory";
|
||||
reg = <0x50000 0xb0000>;
|
||||
read-only;
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
eeprom_factory_0: eeprom@0 {
|
||||
reg = <0x0 0x1000>;
|
||||
};
|
||||
|
||||
macaddr_factory_e000: macaddr@e000 {
|
||||
compatible = "mac-base";
|
||||
reg = <0xe000 0x6>;
|
||||
#nvmem-cell-cells = <1>;
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
partition@100000 {
|
||||
label = "fip";
|
||||
reg = <0x100000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@180000 {
|
||||
compatible = "denx,fit";
|
||||
label = "firmware";
|
||||
reg = <0x180000 0xe80000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&pio {
|
||||
spi2_flash_pins: spi2-pins {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi2", "spi2_wp_hold";
|
||||
};
|
||||
|
||||
conf-pu {
|
||||
pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
|
||||
};
|
||||
|
||||
conf-pd {
|
||||
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&wifi {
|
||||
status = "okay";
|
||||
|
||||
nvmem-cells = <&eeprom_factory_0>;
|
||||
nvmem-cell-names = "eeprom";
|
||||
};
|
||||
201
target/linux/mediatek/dts/mt7981b-netis-common.dtsi
Normal file
201
target/linux/mediatek/dts/mt7981b-netis-common.dtsi
Normal file
@ -0,0 +1,201 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
|
||||
|
||||
/dts-v1/;
|
||||
#include "mt7981b.dtsi"
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
serial0 = &uart0;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = "serial0:115200n8";
|
||||
rootdisk = <&ubi_rootdisk>;
|
||||
};
|
||||
|
||||
memory@40000000 {
|
||||
reg = <0 0x40000000 0 0x20000000>;
|
||||
device_type = "memory";
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
compatible = "gpio-keys";
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
wps {
|
||||
label = "wps";
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ð {
|
||||
status = "okay";
|
||||
|
||||
gmac0: mac@0 {
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <0>;
|
||||
phy-mode = "2500base-x";
|
||||
|
||||
nvmem-cells = <&macaddr_lan>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
|
||||
fixed-link {
|
||||
speed = <2500>;
|
||||
full-duplex;
|
||||
pause;
|
||||
};
|
||||
};
|
||||
|
||||
mac@1 {
|
||||
compatible = "mediatek,eth-mac";
|
||||
reg = <1>;
|
||||
phy-mode = "gmii";
|
||||
phy-handle = <&int_gbe_phy>;
|
||||
|
||||
nvmem-cells = <&macaddr_wan>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
};
|
||||
|
||||
&mdio_bus {
|
||||
switch: switch@1f {
|
||||
compatible = "mediatek,mt7531";
|
||||
reg = <31>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <1>;
|
||||
interrupt-parent = <&pio>;
|
||||
interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
|
||||
reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
|
||||
&crypto {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pio {
|
||||
spi0_flash_pins: spi0-pins {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi0", "spi0_wp_hold";
|
||||
};
|
||||
conf-pu {
|
||||
pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
|
||||
};
|
||||
conf-pd {
|
||||
pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
|
||||
drive-strength = <MTK_DRIVE_8mA>;
|
||||
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
&spi0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi0_flash_pins>;
|
||||
status = "okay";
|
||||
|
||||
spi_nand@0 {
|
||||
compatible = "spi-nand";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <52000000>;
|
||||
spi-tx-bus-width = <4>;
|
||||
spi-rx-bus-width = <4>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "BL2";
|
||||
reg = <0x0 0x100000>;
|
||||
};
|
||||
|
||||
partition@100000 {
|
||||
label = "u-boot-env";
|
||||
reg = <0x100000 0x80000>;
|
||||
};
|
||||
|
||||
partition@180000 {
|
||||
label = "Factory";
|
||||
reg = <0x180000 0x200000>;
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
eeprom_factory_0: eeprom@0 {
|
||||
reg = <0x0 0x1000>;
|
||||
};
|
||||
|
||||
macaddr_lan: macaddr@1fef20 {
|
||||
reg = <0x1fef20 0x6>;
|
||||
};
|
||||
|
||||
macaddr_wan: macaddr@1fef26 {
|
||||
reg = <0x1fef26 0x6>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
partition@380000 {
|
||||
label = "FIP";
|
||||
reg = <0x380000 0x200000>;
|
||||
};
|
||||
|
||||
partition@580000 {
|
||||
label = "ubi";
|
||||
reg = <0x580000 0x7280000>;
|
||||
compatible = "linux,ubi";
|
||||
|
||||
volumes {
|
||||
ubi_rootdisk: ubi-volume-fit {
|
||||
volname = "fit";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&switch {
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@6 {
|
||||
reg = <6>;
|
||||
ethernet = <&gmac0>;
|
||||
phy-mode = "2500base-x";
|
||||
|
||||
fixed-link {
|
||||
speed = <2500>;
|
||||
full-duplex;
|
||||
pause;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&watchdog {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&wifi {
|
||||
status = "okay";
|
||||
nvmem-cells = <&eeprom_factory_0>;
|
||||
nvmem-cell-names = "eeprom";
|
||||
};
|
||||
64
target/linux/mediatek/dts/mt7981b-netis-nx30v2.dts
Normal file
64
target/linux/mediatek/dts/mt7981b-netis-nx30v2.dts
Normal file
@ -0,0 +1,64 @@
|
||||
/* SPDX-License-Identifier: (GPL-2.0-only OR MIT) */
|
||||
|
||||
/dts-v1/;
|
||||
#include "mt7981b-netis-common.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "netis,nx30v2", "mediatek,mt7981";
|
||||
|
||||
aliases {
|
||||
label-mac-device = &gmac0;
|
||||
led-boot = &led_power;
|
||||
led-failsafe = &led_power;
|
||||
led-running = &led_power;
|
||||
led-upgrade = &led_wps;
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
led_power: power {
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
function = LED_FUNCTION_POWER;
|
||||
gpios = <&pio 4 GPIO_ACTIVE_LOW>;
|
||||
default-state = "on";
|
||||
};
|
||||
|
||||
internet {
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
function = LED_FUNCTION_WAN_ONLINE;
|
||||
gpios = <&pio 7 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
led_wps: wps {
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
function = LED_FUNCTION_WPS;
|
||||
gpios = <&pio 5 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
wan {
|
||||
color = <LED_COLOR_ID_BLUE>;
|
||||
function = LED_FUNCTION_WAN;
|
||||
gpios = <&pio 8 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&switch {
|
||||
ports {
|
||||
port@0 {
|
||||
reg = <1>;
|
||||
label = "lan1";
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <2>;
|
||||
label = "lan2";
|
||||
};
|
||||
|
||||
port@2 {
|
||||
reg = <3>;
|
||||
label = "lan3";
|
||||
};
|
||||
};
|
||||
};
|
||||
8
target/linux/mediatek/dts/mt7988d-keenetic-kn-1812.dts
Normal file
8
target/linux/mediatek/dts/mt7988d-keenetic-kn-1812.dts
Normal file
@ -0,0 +1,8 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
|
||||
|
||||
#include "mt7988d-keenetic-kn-1812.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Keenetic KN-1812";
|
||||
compatible = "keenetic,kn-1812", "mediatek,mt7988d";
|
||||
};
|
||||
610
target/linux/mediatek/dts/mt7988d-keenetic-kn-1812.dtsi
Normal file
610
target/linux/mediatek/dts/mt7988d-keenetic-kn-1812.dtsi
Normal file
@ -0,0 +1,610 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
|
||||
|
||||
/dts-v1/;
|
||||
#include "mt7988a.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/leds/common.h>
|
||||
#include <dt-bindings/pinctrl/mt65xx.h>
|
||||
#include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
|
||||
|
||||
/ {
|
||||
aliases {
|
||||
serial0 = &serial0;
|
||||
label-mac-device = &gmac1;
|
||||
led-boot = &power_led;
|
||||
led-failsafe = &power_led;
|
||||
led-running = &power_led;
|
||||
led-upgrade = &power_led;
|
||||
};
|
||||
|
||||
chosen {
|
||||
stdout-path = &serial0;
|
||||
bootargs = "console=ttyS0,115200n1 pci=pcie_bus_perf";
|
||||
};
|
||||
|
||||
memory@40000000 {
|
||||
reg = <0x0 0x40000000 0x0 0x40000000>;
|
||||
device_type = "memory";
|
||||
};
|
||||
|
||||
cpus {
|
||||
/delete-node/ cpu@3;
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
button-fn1 {
|
||||
label = "fn1";
|
||||
linux,code = <BTN_0>;
|
||||
gpios = <&pio 29 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
button-fn2 {
|
||||
label = "fn2";
|
||||
linux,code = <BTN_1>;
|
||||
gpios = <&pio 37 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
button-reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&pio 60 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
button-wps {
|
||||
label = "wps";
|
||||
linux,code = <KEY_WPS_BUTTON>;
|
||||
gpios = <&pio 61 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
gpio-leds {
|
||||
compatible = "gpio-leds";
|
||||
|
||||
/* fn1 */
|
||||
led-0 {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_INDICATOR;
|
||||
function-enumerator = <0>;
|
||||
gpios = <&pio 42 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
/* fn2 */
|
||||
led-1 {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_INDICATOR;
|
||||
function-enumerator = <1>;
|
||||
gpios = <&pio 43 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
/* wifi */
|
||||
led-2 {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WLAN;
|
||||
gpios = <&pio 47 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
/* internet */
|
||||
led-3 {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WAN_ONLINE;
|
||||
gpios = <&pio 48 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
/* power */
|
||||
power_led: led-4 {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_POWER;
|
||||
gpios = <&pio 50 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
|
||||
gpio-export {
|
||||
compatible = "gpio-export";
|
||||
|
||||
/* usb2.0 hub GL850G */
|
||||
usbhub {
|
||||
gpio-export,name = "usbhub";
|
||||
gpio-export,output = <1>;
|
||||
gpios = <&pio 34 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
/* USB2.0 */
|
||||
usb1power {
|
||||
gpio-export,name = "usb1power";
|
||||
gpio-export,output = <1>;
|
||||
gpios = <&pio 44 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
/* USB3.2 Gen1 */
|
||||
usb2power {
|
||||
gpio-export,name = "usb2power";
|
||||
gpio-export,output = <1>;
|
||||
gpios = <&pio 45 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
|
||||
virtual_flash {
|
||||
compatible = "mtd-concat";
|
||||
devices = <&firmware1 &storage1 &firmware2 &storage2>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
partition@0 {
|
||||
label = "kernel";
|
||||
reg = <0x0 0x600000>;
|
||||
};
|
||||
|
||||
partition@400000 {
|
||||
label = "ubi";
|
||||
reg = <0x600000 0x0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/* configure uart */
|
||||
&serial0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
/* configure spi-nand */
|
||||
&spi0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi0_flash_pins>;
|
||||
status = "okay";
|
||||
|
||||
/* Winbond W25N02KV (256M) */
|
||||
spi_nand@0 {
|
||||
compatible = "spi-nand";
|
||||
reg = <0>;
|
||||
|
||||
spi-max-frequency = <52000000>;
|
||||
spi-rx-bus-width = <4>;
|
||||
spi-tx-bus-width = <4>;
|
||||
|
||||
mediatek,nmbm;
|
||||
mediatek,bmt-max-ratio = <1>;
|
||||
mediatek,bmt-max-reserved-blocks = <64>;
|
||||
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
/* bl2 */
|
||||
partition@0 {
|
||||
label = "preloader";
|
||||
reg = <0x0 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
/* fip */
|
||||
partition@80000 {
|
||||
label = "u-boot";
|
||||
reg = <0x80000 0x200000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@280000 {
|
||||
label = "u-config";
|
||||
reg = <0x280000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@300000 {
|
||||
label = "rf-eeprom";
|
||||
reg = <0x300000 0x400000>;
|
||||
read-only;
|
||||
|
||||
nvmem-layout {
|
||||
compatible = "fixed-layout";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
eeprom_factory_0: eeprom@0 {
|
||||
reg = <0x0 0x1e00>;
|
||||
};
|
||||
|
||||
/* lan mac */
|
||||
macaddr_factory_4: macaddr@4 {
|
||||
reg = <0x4 0x6>;
|
||||
};
|
||||
|
||||
/* 5Ghz mac */
|
||||
macaddr_factory_a: macaddr@a {
|
||||
reg = <0xa 0x6>;
|
||||
};
|
||||
|
||||
/* lan5 mac */
|
||||
macaddr_factory_fffee: macaddr@fffee {
|
||||
reg = <0xfffee 0x6>;
|
||||
};
|
||||
|
||||
/* wan mac */
|
||||
macaddr_factory_ffffa: macaddr@ffffa {
|
||||
reg = <0xffffa 0x6>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
firmware1: partition@700000 {
|
||||
label = "firmware_1";
|
||||
reg = <0x700000 0x3800000>;
|
||||
};
|
||||
|
||||
partition@3f00000 {
|
||||
label = "config_1";
|
||||
reg = <0x3f00000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@3f80000 {
|
||||
label = "dump";
|
||||
reg = <0x3f80000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
storage1: partition@4000000 {
|
||||
label = "storage_a";
|
||||
reg = <0x4000000 0x3800000>;
|
||||
};
|
||||
|
||||
partition@7800000 {
|
||||
label = "u-state";
|
||||
reg = <0x7800000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@7a80000 {
|
||||
label = "u-config_res";
|
||||
reg = <0x7a80000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
partition@7b00000 {
|
||||
label = "rf-eeprom_res";
|
||||
reg = <0x7b00000 0x400000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
firmware2: partition@7f00000 {
|
||||
label = "firmware_2";
|
||||
reg = <0x7f00000 0x3800000>;
|
||||
};
|
||||
|
||||
partition@b700000 {
|
||||
label = "config_2";
|
||||
reg = <0xb700000 0x80000>;
|
||||
read-only;
|
||||
};
|
||||
|
||||
storage2: partition@b780000 {
|
||||
label = "storage_b";
|
||||
reg = <0xb780000 0x3880000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/* configure switch */
|
||||
&gmac0 {
|
||||
nvmem-cells = <&macaddr_factory_4>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
/* lan1 */
|
||||
&gsw_port0 {
|
||||
label = "lan1";
|
||||
};
|
||||
|
||||
&gsw_phy0 {
|
||||
pinctrl-names = "gbe-led";
|
||||
pinctrl-0 = <&gbe0_led0_pins>;
|
||||
};
|
||||
|
||||
&gsw_phy0_led0 {
|
||||
status = "okay";
|
||||
function = LED_FUNCTION_LAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
};
|
||||
|
||||
/* lan2 */
|
||||
&gsw_port1 {
|
||||
label = "lan2";
|
||||
};
|
||||
|
||||
&gsw_phy1 {
|
||||
pinctrl-names = "gbe-led";
|
||||
pinctrl-0 = <&gbe1_led0_pins>;
|
||||
};
|
||||
|
||||
&gsw_phy1_led0 {
|
||||
status = "okay";
|
||||
function = LED_FUNCTION_LAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
};
|
||||
|
||||
/* lan3 */
|
||||
&gsw_port2 {
|
||||
label = "lan3";
|
||||
};
|
||||
|
||||
&gsw_phy2 {
|
||||
pinctrl-names = "gbe-led";
|
||||
pinctrl-0 = <&gbe2_led0_pins>;
|
||||
};
|
||||
|
||||
&gsw_phy2_led0 {
|
||||
status = "okay";
|
||||
function = LED_FUNCTION_LAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
};
|
||||
|
||||
/* lan4 */
|
||||
&gsw_port3 {
|
||||
label = "lan4";
|
||||
};
|
||||
|
||||
&gsw_phy3 {
|
||||
pinctrl-names = "gbe-led";
|
||||
pinctrl-0 = <&gbe3_led0_pins>;
|
||||
};
|
||||
|
||||
&gsw_phy3_led0 {
|
||||
status = "okay";
|
||||
function = LED_FUNCTION_LAN;
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
};
|
||||
|
||||
/* configure wan */
|
||||
&gmac1 {
|
||||
nvmem-cells = <&macaddr_factory_ffffa>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
label = "wan";
|
||||
phy-mode = "internal";
|
||||
phy-connection-type = "internal";
|
||||
phy = <&int_2p5g_phy>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&int_2p5g_phy {
|
||||
pinctrl-names = "i2p5gbe-led";
|
||||
pinctrl-0 = <&i2p5gbe_led0_pins>;
|
||||
};
|
||||
|
||||
&i2p5gbe_led0 {
|
||||
color = <LED_COLOR_ID_GREEN>;
|
||||
function = LED_FUNCTION_WAN;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
/* configure lan5 */
|
||||
ð {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&mdio0_pins>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mdio_bus {
|
||||
phy27: ethernet-phy@1b {
|
||||
/* RTL8261BE */
|
||||
compatible = "ethernet-phy-ieee802.3-c45";
|
||||
reg = <0x1b>;
|
||||
|
||||
reset-gpios = <&pio 4 GPIO_ACTIVE_LOW>;
|
||||
reset-assert-us = <100000>;
|
||||
reset-deassert-us = <100000>;
|
||||
};
|
||||
};
|
||||
|
||||
&gmac2 {
|
||||
nvmem-cells = <&macaddr_factory_fffee>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
label = "lan5";
|
||||
phy-mode = "usxgmii";
|
||||
phy-connection-type = "usxgmii";
|
||||
phy = <&phy27>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
/* configure power supply */
|
||||
&i2c0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&i2c0_pins>;
|
||||
status = "okay";
|
||||
|
||||
rt5190a_64: rt5190a@64 {
|
||||
compatible = "richtek,rt5190a";
|
||||
reg = <0x64>;
|
||||
|
||||
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 =
|
||||
<RT5190A_OPMODE_AUTO RT5190A_OPMODE_FPWM>;
|
||||
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 =
|
||||
<RT5190A_OPMODE_AUTO RT5190A_OPMODE_FPWM>;
|
||||
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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&cpu0 {
|
||||
proc-supply = <&rt5190_buck3>;
|
||||
};
|
||||
|
||||
&cpu1 {
|
||||
proc-supply = <&rt5190_buck3>;
|
||||
};
|
||||
|
||||
&cpu2 {
|
||||
proc-supply = <&rt5190_buck3>;
|
||||
};
|
||||
|
||||
&cci {
|
||||
proc-supply = <&rt5190_buck3>;
|
||||
};
|
||||
|
||||
/* configure wifi chip */
|
||||
&pcie0 {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pcie0_1_pins>;
|
||||
wifi-reset-gpios = <&pio 7 GPIO_ACTIVE_LOW>;
|
||||
wifi-reset-msleep = <100>;
|
||||
status = "okay";
|
||||
|
||||
pcie@0,0 {
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
#address-cells = <3>;
|
||||
#size-cells = <2>;
|
||||
|
||||
mt7996@0,0 {
|
||||
reg = <0x0000 0 0 0 0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
nvmem-cells = <&eeprom_factory_0>;
|
||||
nvmem-cell-names = "eeprom";
|
||||
ieee80211-freq-limit = <2400000 2500000>, <5170000 5835000>;
|
||||
|
||||
band@0 {
|
||||
/* 2.4 GHz */
|
||||
reg = <0>;
|
||||
nvmem-cells = <&macaddr_factory_4>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
|
||||
band@1 {
|
||||
/* 5 GHz */
|
||||
reg = <1>;
|
||||
nvmem-cells = <&macaddr_factory_a>;
|
||||
nvmem-cell-names = "mac-address";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/* configure pinmux settings */
|
||||
&pio {
|
||||
mdio0_pins: mdio0-pins {
|
||||
mux {
|
||||
function = "eth";
|
||||
groups = "mdc_mdio0";
|
||||
};
|
||||
|
||||
conf {
|
||||
groups = "mdc_mdio0";
|
||||
drive-strength = <MTK_DRIVE_4mA>;
|
||||
};
|
||||
};
|
||||
|
||||
gbe0_led0_pins: gbe0-led0-pins {
|
||||
mux {
|
||||
function = "led";
|
||||
groups = "gbe0_led0";
|
||||
};
|
||||
};
|
||||
|
||||
gbe1_led0_pins: gbe1-led0-pins {
|
||||
mux {
|
||||
function = "led";
|
||||
groups = "gbe1_led0";
|
||||
};
|
||||
};
|
||||
|
||||
gbe2_led0_pins: gbe2-led0-pins {
|
||||
mux {
|
||||
function = "led";
|
||||
groups = "gbe2_led0";
|
||||
};
|
||||
};
|
||||
|
||||
gbe3_led0_pins: gbe3-led0-pins {
|
||||
mux {
|
||||
function = "led";
|
||||
groups = "gbe3_led0";
|
||||
};
|
||||
};
|
||||
|
||||
i2p5gbe_led0_pins: 2p5gbe-led0-pins {
|
||||
mux {
|
||||
function = "led";
|
||||
groups = "2p5gbe_led0";
|
||||
};
|
||||
};
|
||||
|
||||
i2c0_pins: i2c0-pins-g0 {
|
||||
mux {
|
||||
function = "i2c";
|
||||
groups = "i2c0_1";
|
||||
};
|
||||
};
|
||||
|
||||
pcie0_1_pins: pcie0-pins-g1 {
|
||||
mux {
|
||||
function = "pcie";
|
||||
groups = "pcie_2l_0_pereset", "pcie_clk_req_n0_0";
|
||||
};
|
||||
};
|
||||
|
||||
spi0_flash_pins: spi0-flash-pins {
|
||||
mux {
|
||||
function = "spi";
|
||||
groups = "spi0", "spi0_wp_hold";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/* configure usb */
|
||||
&ssusb1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&tphy {
|
||||
status = "okay";
|
||||
};
|
||||
8
target/linux/mediatek/dts/mt7988d-netcraze-nc-1812.dts
Normal file
8
target/linux/mediatek/dts/mt7988d-netcraze-nc-1812.dts
Normal file
@ -0,0 +1,8 @@
|
||||
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
|
||||
|
||||
#include "mt7988d-keenetic-kn-1812.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Netcraze NC-1812";
|
||||
compatible = "netcraze,nc-1812", "mediatek,mt7988d";
|
||||
};
|
||||
@ -58,6 +58,7 @@ confiabits,mt7981)
|
||||
ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" "link tx rx"
|
||||
;;
|
||||
cudy,re3000-v1|\
|
||||
kebidumei,ax3000-u22|\
|
||||
wavlink,wl-wn573hx3)
|
||||
ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0" "link tx rx"
|
||||
;;
|
||||
@ -116,6 +117,12 @@ iptime,ax3000sm)
|
||||
iptime,ax7800m-6e)
|
||||
ucidef_set_led_netdev "wan" "wan" "mdio-bus:06:blue:wan" "eth1" "link tx rx"
|
||||
;;
|
||||
keenetic,kn-1812|\
|
||||
netcraze,nc-1812)
|
||||
ucidef_set_led_netdev "wlan2g" "WLAN2G" "green:indicator-1" "phy0.0-ap0"
|
||||
ucidef_set_led_netdev "wlan5g" "WLAN5G" "green:wlan" "phy0.1-ap0"
|
||||
ucidef_set_led_netdev "internet" "internet" "green:wan-online" "wan" "link"
|
||||
;;
|
||||
mercusys,mr80x-v3)
|
||||
ucidef_set_led_netdev "lan1" "lan-1" "green:lan-1" "lan1" "link tx rx"
|
||||
ucidef_set_led_netdev "lan2" "lan-2" "green:lan-2" "lan2" "link tx rx"
|
||||
@ -157,6 +164,10 @@ netgear,eax17)
|
||||
netgear,wax220)
|
||||
ucidef_set_led_netdev "eth0" "LAN" "green:lan" "eth0"
|
||||
;;
|
||||
netis,nx30v2)
|
||||
ucidef_set_led_netdev "wanlink" "WANLINK" "blue:wan" "eth1" "link"
|
||||
ucidef_set_led_netdev "wanact" "WANACT" "blue:wan-online" "eth1" "tx rx"
|
||||
;;
|
||||
netis,nx31)
|
||||
ucidef_set_led_netdev "wan" "wan" "blue:wan" "eth1" "link tx rx"
|
||||
;;
|
||||
|
||||
@ -15,6 +15,7 @@ mediatek_setup_interfaces()
|
||||
h3c,magic-nx30-pro|\
|
||||
imou,hx21|\
|
||||
konka,komi-a31|\
|
||||
netis,nx30v2|\
|
||||
netis,nx31|\
|
||||
nokia,ea0326gmp|\
|
||||
mercusys,mr80x-v3|\
|
||||
@ -112,6 +113,7 @@ mediatek_setup_interfaces()
|
||||
cudy,ap3000outdoor-v1|\
|
||||
cudy,ap3000-v1|\
|
||||
cudy,re3000-v1|\
|
||||
kebidumei,ax3000-u22|\
|
||||
netgear,eax17|\
|
||||
netgear,wax220|\
|
||||
openfi,6c|\
|
||||
@ -146,6 +148,10 @@ mediatek_setup_interfaces()
|
||||
yuncore,ax835)
|
||||
ucidef_set_interfaces_lan_wan lan wan
|
||||
;;
|
||||
keenetic,kn-1812|\
|
||||
netcraze,nc-1812)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5" "wan"
|
||||
;;
|
||||
mediatek,mt7986a-rfb)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan6" "eth1 wan"
|
||||
;;
|
||||
|
||||
@ -103,6 +103,7 @@ platform_do_upgrade() {
|
||||
mediatek,mt7981-rfb|\
|
||||
mediatek,mt7988a-rfb|\
|
||||
mercusys,mr90x-v1-ubi|\
|
||||
netis,nx30v2|\
|
||||
netis,nx31|\
|
||||
nokia,ea0326gmp|\
|
||||
openwrt,one|\
|
||||
@ -163,6 +164,7 @@ platform_do_upgrade() {
|
||||
;;
|
||||
cudy,re3000-v1|\
|
||||
cudy,wr3000-v1|\
|
||||
kebidumei,ax3000-u22|\
|
||||
totolink,x6000r|\
|
||||
wavlink,wl-wn573hx3|\
|
||||
widelantech,wap430x|\
|
||||
|
||||
@ -154,9 +154,9 @@ define Device/abt_asr3000
|
||||
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
||||
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot abt_asr3000
|
||||
@ -245,9 +245,9 @@ define Device/acer_predator-w6x-ubootmod
|
||||
UBOOTENV_IN_UBI := 1
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr4
|
||||
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot acer_predator-w6x
|
||||
@ -361,7 +361,7 @@ define Device/arcadyan_mozart
|
||||
KERNEL_LOADADDR := 0x46000000
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
KERNEL_INITRAMFS_SUFFIX := .itb
|
||||
IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
|
||||
IMAGES := sysupgrade.itb
|
||||
@ -438,9 +438,9 @@ define Device/asus_tuf-ax4200q
|
||||
DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
||||
IMAGES := sysupgrade.bin
|
||||
KERNEL := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||
ifeq ($(IB),)
|
||||
ifeq ($(CONFIG_TARGET_INITRAMFS_FORCE),y)
|
||||
@ -597,8 +597,8 @@ endif
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | \
|
||||
pad-rootfs | append-metadata
|
||||
ARTIFACTS := \
|
||||
emmc-gpt.bin emmc-preloader.bin emmc-bl31-uboot.fip \
|
||||
snand-factory.bin snand-preloader.bin snand-bl31-uboot.fip
|
||||
emmc-gpt.bin emmc-preloader.bin emmc-bl31-uboot.fip \
|
||||
snand-factory.bin snand-preloader.bin snand-bl31-uboot.fip
|
||||
ARTIFACT/emmc-gpt.bin := mt798x-gpt emmc
|
||||
ARTIFACT/emmc-preloader.bin := mt7986-bl2 emmc-ddr4
|
||||
ARTIFACT/emmc-bl31-uboot.fip := mt7986-bl31-uboot bananapi_bpi-r3-mini-emmc
|
||||
@ -700,7 +700,7 @@ define Device/bananapi_bpi-r4-lite
|
||||
KERNEL_LOADADDR := 0x40000000
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGES := sysupgrade.itb
|
||||
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
||||
KERNEL_IN_UBI := 1
|
||||
@ -932,9 +932,9 @@ define Device/comfast_cf-e393ax
|
||||
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
||||
KERNEL_LOADADDR := 0x44000000
|
||||
KERNEL = kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
||||
KERNEL_INITRAMFS = kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
|
||||
UBINIZE_OPTS := -E 5
|
||||
BLOCKSIZE := 128k
|
||||
PAGESIZE := 2048
|
||||
@ -1472,9 +1472,9 @@ define Device/h3c_magic-nx30-pro
|
||||
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
||||
@ -1530,9 +1530,9 @@ define Device/imou_hx21
|
||||
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
||||
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot imou_hx21
|
||||
@ -1608,7 +1608,7 @@ define Device/iptime_ax3000m
|
||||
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 with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGES := factory.bin sysupgrade.bin
|
||||
IMAGE/factory.bin := sysupgrade-tar | append-metadata | check-size | iptime-crc32 ax3000m
|
||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||
@ -1656,9 +1656,9 @@ define Device/jcg_q30-pro
|
||||
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
||||
@ -1692,6 +1692,47 @@ define Device/jdcloud_re-cp-03
|
||||
endef
|
||||
TARGET_DEVICES += jdcloud_re-cp-03
|
||||
|
||||
define Device/kebidumei_ax3000-u22
|
||||
DEVICE_VENDOR := Kebidumei
|
||||
DEVICE_MODEL := AX3000-U22
|
||||
DEVICE_DTS := mt7981b-kebidumei-ax3000-u22
|
||||
DEVICE_DTS_DIR := ../dts
|
||||
DEVICE_DTS_LOADADDR := 0x43f00000
|
||||
IMAGE_SIZE := 14848k
|
||||
KERNEL_LOADADDR := 0x44000000
|
||||
KERNEL := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
||||
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
||||
SUPPORTED_DEVICES += mediatek,mt7981-spim-nor-rfb
|
||||
endef
|
||||
TARGET_DEVICES += kebidumei_ax3000-u22
|
||||
|
||||
define Device/keenetic_kn-1812-common
|
||||
DEVICE_DTS_DIR := ../dts
|
||||
DEVICE_PACKAGES := kmod-mt7992-firmware kmod-usb3 \
|
||||
mt7988-2p5g-phy-firmware mt7988-wo-firmware
|
||||
UBINIZE_OPTS := -E 5
|
||||
BLOCKSIZE := 128k
|
||||
PAGESIZE := 2048
|
||||
KERNEL_SIZE := 6144k
|
||||
IMAGE_SIZE := 229888k
|
||||
KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | \
|
||||
append-squashfs4-fakeroot
|
||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||
IMAGES += factory.bin
|
||||
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | \
|
||||
append-ubi | check-size | zyimage -d $$(ZYIMAGE_ID) -v "$$(DEVICE_MODEL)"
|
||||
endef
|
||||
|
||||
define Device/keenetic_kn-1812
|
||||
DEVICE_VENDOR := Keenetic
|
||||
DEVICE_MODEL := KN-1812
|
||||
DEVICE_DTS := mt7988d-keenetic-kn-1812
|
||||
ZYIMAGE_ID := 0x801812
|
||||
$(call Device/keenetic_kn-1812-common)
|
||||
endef
|
||||
TARGET_DEVICES += keenetic_kn-1812
|
||||
|
||||
define Device/keenetic_kn-3711
|
||||
DEVICE_VENDOR := Keenetic
|
||||
DEVICE_MODEL := KN-3711
|
||||
@ -1827,9 +1868,9 @@ define Device/livinet_zr-3020-ubootmod
|
||||
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
||||
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot livinet_zr-3020
|
||||
@ -1958,7 +1999,7 @@ define Device/mediatek_mt7987a-rfb
|
||||
KERNEL_LOADADDR := 0x40000000
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGES := sysupgrade.itb
|
||||
KERNEL_INITRAMFS_SUFFIX := .itb
|
||||
KERNEL_IN_UBI := 1
|
||||
@ -2130,9 +2171,9 @@ define Device/netcore_n60
|
||||
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr3
|
||||
@ -2154,9 +2195,9 @@ define Device/netcore_n60-pro
|
||||
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware kmod-usb3 automount
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr4
|
||||
@ -2164,6 +2205,15 @@ define Device/netcore_n60-pro
|
||||
endef
|
||||
TARGET_DEVICES += netcore_n60-pro
|
||||
|
||||
define Device/netcraze_nc-1812
|
||||
DEVICE_VENDOR := Netcraze
|
||||
DEVICE_MODEL := NC-1812
|
||||
DEVICE_DTS := mt7988d-netcraze-nc-1812
|
||||
ZYIMAGE_ID := 0xC01812
|
||||
$(call Device/keenetic_kn-1812-common)
|
||||
endef
|
||||
TARGET_DEVICES += netcraze_nc-1812
|
||||
|
||||
define Device/netgear_eax17
|
||||
DEVICE_VENDOR := NETGEAR
|
||||
DEVICE_MODEL := EAX17
|
||||
@ -2224,6 +2274,37 @@ define Device/netgear_wax220
|
||||
endef
|
||||
TARGET_DEVICES += netgear_wax220
|
||||
|
||||
define Device/netis_nx30v2
|
||||
DEVICE_VENDOR := Netis
|
||||
DEVICE_MODEL := NX30V2
|
||||
DEVICE_ALT0_VENDOR := Netcore
|
||||
DEVICE_ALT0_MODEL := POWER30AX
|
||||
DEVICE_ALT1_VENDOR := Netcore
|
||||
DEVICE_ALT1_MODEL := N30PRO
|
||||
DEVICE_ALT2_VENDOR := GWBN
|
||||
DEVICE_ALT2_MODEL := GW3001
|
||||
DEVICE_ALT3_VENDOR := GLC
|
||||
DEVICE_ALT3_MODEL := W7
|
||||
DEVICE_DTS := mt7981b-netis-nx30v2
|
||||
DEVICE_DTS_DIR := ../dts
|
||||
DEVICE_DTC_FLAGS := --pad 4096
|
||||
DEVICE_DTS_LOADADDR := 0x43f00000
|
||||
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
||||
KERNEL_LOADADDR := 0x44000000
|
||||
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 := .itb
|
||||
KERNEL_IN_UBI := 1
|
||||
UBOOTENV_IN_UBI := 1
|
||||
IMAGES := sysupgrade.itb
|
||||
IMAGE_SIZE := 117248k
|
||||
IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | pad-rootfs | append-metadata
|
||||
ARTIFACTS := spim-nand-preloader.bin spim-nand-bl31-uboot.fip
|
||||
ARTIFACT/spim-nand-preloader.bin := mt7981-bl2 spim-nand-ddr3
|
||||
ARTIFACT/spim-nand-bl31-uboot.fip := mt7981-bl31-uboot netis_nx30v2
|
||||
endef
|
||||
TARGET_DEVICES += netis_nx30v2
|
||||
|
||||
define Device/netis_nx31
|
||||
DEVICE_VENDOR := netis
|
||||
DEVICE_MODEL := NX31
|
||||
@ -2264,9 +2345,9 @@ define Device/nokia_ea0326gmp
|
||||
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
||||
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot nokia_ea0326gmp
|
||||
@ -2314,7 +2395,7 @@ define Device/openfi_6c
|
||||
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 automount
|
||||
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 with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||
endef
|
||||
TARGET_DEVICES += openfi_6c
|
||||
@ -2380,9 +2461,9 @@ define Device/qihoo_360t7
|
||||
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
||||
@ -2511,9 +2592,9 @@ define Device/tenbay_wr3000k
|
||||
IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
|
||||
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
|
||||
KERNEL = kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
|
||||
KERNEL_INITRAMFS = kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
|
||||
endef
|
||||
TARGET_DEVICES += tenbay_wr3000k
|
||||
|
||||
@ -2656,10 +2737,10 @@ define Device/tplink_tl-xdr-common
|
||||
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | append-metadata
|
||||
DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware automount
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-with-rootfs | append-metadata
|
||||
DEVICE_PACKAGES := fitblk kmod-usb3 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware automount
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr3
|
||||
endef
|
||||
@ -2865,9 +2946,9 @@ define Device/xiaomi_mi-router-ax3000t-ubootmod
|
||||
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
||||
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot xiaomi_mi-router-ax3000t
|
||||
@ -2916,9 +2997,9 @@ define Device/xiaomi_mi-router-wr30u-ubootmod
|
||||
KERNEL_INITRAMFS_SUFFIX := -recovery.itb
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3
|
||||
ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot xiaomi_mi-router-wr30u
|
||||
@ -2967,9 +3048,9 @@ define Device/xiaomi_redmi-router-ax6000-ubootmod
|
||||
UBOOTENV_IN_UBI := 1
|
||||
KERNEL := kernel-bin | gzip
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-ddr4
|
||||
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot xiaomi_redmi-router-ax6000
|
||||
@ -3101,9 +3182,9 @@ define Device/zyxel_ex5601-t0-ubootmod
|
||||
UBOOTENV_IN_UBI := 1
|
||||
KERNEL := kernel-bin | lzma
|
||||
KERNEL_INITRAMFS := kernel-bin | lzma | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd
|
||||
IMAGE/sysupgrade.itb := append-kernel | \
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata
|
||||
ARTIFACTS := preloader.bin bl31-uboot.fip
|
||||
ARTIFACT/preloader.bin := mt7986-bl2 spim-nand-4k-ddr4
|
||||
ARTIFACT/bl31-uboot.fip := mt7986-bl31-uboot zyxel_ex5601-t0
|
||||
|
||||
@ -0,0 +1,88 @@
|
||||
From f566462daef92eb0074013e32d0332116fc3a2eb Mon Sep 17 00:00:00 2001
|
||||
From: Jianguo Zhang <jianguo.zhang@mediatek.com>
|
||||
Date: Tue, 14 Oct 2025 16:00:03 +0800
|
||||
Subject: [PATCH] pcie: mediatek-gen3: Add WIFI HW reset flow
|
||||
|
||||
[Description]
|
||||
Add WIFI HW reset before PCIe host detects EP device for reboot.
|
||||
|
||||
[Release-log]
|
||||
NA
|
||||
|
||||
Signed-off-by: Jianguo Zhang <jianguo.zhang@mediatek.com>
|
||||
---
|
||||
drivers/pci/controller/pcie-mediatek-gen3.c | 29 +++++++++++++++++++++
|
||||
1 file changed, 29 insertions(+)
|
||||
|
||||
--- a/drivers/pci/controller/pcie-mediatek-gen3.c
|
||||
+++ b/drivers/pci/controller/pcie-mediatek-gen3.c
|
||||
@@ -10,6 +10,8 @@
|
||||
#include <linux/clk.h>
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/delay.h>
|
||||
+#include <linux/gpio.h>
|
||||
+#include <linux/gpio/consumer.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/irqchip/chained_irq.h>
|
||||
@@ -18,6 +20,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/msi.h>
|
||||
#include <linux/of_device.h>
|
||||
+#include <linux/of_gpio.h>
|
||||
#include <linux/of_pci.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/phy/phy.h>
|
||||
@@ -160,6 +163,8 @@ struct mtk_msi_set {
|
||||
* @phy: PHY controller block
|
||||
* @clks: PCIe clocks
|
||||
* @num_clks: PCIe clocks count for this port
|
||||
+ * @wifi_reset: reset pin for WIFI chip
|
||||
+ * @wifi_reset_delay_ms: delay time for WIFI chip reset
|
||||
* @irq: PCIe controller interrupt number
|
||||
* @saved_irq_state: IRQ enable state saved at suspend time
|
||||
* @irq_lock: lock protecting IRQ register access
|
||||
@@ -181,6 +186,9 @@ struct mtk_gen3_pcie {
|
||||
struct clk_bulk_data *clks;
|
||||
int num_clks;
|
||||
|
||||
+ struct gpio_desc *wifi_reset;
|
||||
+ u32 wifi_reset_delay_ms;
|
||||
+
|
||||
int irq;
|
||||
u32 saved_irq_state;
|
||||
raw_spinlock_t irq_lock;
|
||||
@@ -402,6 +410,12 @@ static int mtk_pcie_startup_port(struct
|
||||
val |= PCIE_DISABLE_DVFSRC_VLT_REQ;
|
||||
writel_relaxed(val, pcie->base + PCIE_MISC_CTRL_REG);
|
||||
|
||||
+ if (pcie->wifi_reset) {
|
||||
+ gpiod_set_value_cansleep(pcie->wifi_reset, 1);
|
||||
+ msleep(pcie->wifi_reset_delay_ms);
|
||||
+ gpiod_set_value_cansleep(pcie->wifi_reset, 0);
|
||||
+ }
|
||||
+
|
||||
/* Assert all reset signals */
|
||||
val = readl_relaxed(pcie->base + PCIE_RST_CTRL_REG);
|
||||
val |= PCIE_MAC_RSTB | PCIE_PHY_RSTB | PCIE_BRG_RSTB | PCIE_PE_RSTB;
|
||||
@@ -864,6 +878,20 @@ static int mtk_pcie_parse_port(struct mt
|
||||
return pcie->num_clks;
|
||||
}
|
||||
|
||||
+ ret = of_property_read_u32(dev->of_node, "wifi-reset-msleep",
|
||||
+ &pcie->wifi_reset_delay_ms);
|
||||
+ if (!ret) {
|
||||
+ pcie->wifi_reset = devm_gpiod_get_optional(dev, "wifi-reset",
|
||||
+ GPIOD_OUT_LOW);
|
||||
+ if (IS_ERR(pcie->wifi_reset)) {
|
||||
+ ret = PTR_ERR(pcie->wifi_reset);
|
||||
+ if (ret != -EPROBE_DEFER)
|
||||
+ dev_err(dev,
|
||||
+ "failed to request WIFI reset gpio\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -755,6 +755,16 @@ define Device/cudy_ap1300-outdoor-v1
|
||||
endef
|
||||
TARGET_DEVICES += cudy_ap1300-outdoor-v1
|
||||
|
||||
define Device/cudy_c200p
|
||||
$(Device/dsa-migration)
|
||||
DEVICE_VENDOR := Cudy
|
||||
DEVICE_MODEL := C200P
|
||||
IMAGE_SIZE := 15872k
|
||||
UIMAGE_NAME := R74
|
||||
DEVICE_PACKAGES := -uboot-envtools -wpad-basic-mbedtls kmod-usb3
|
||||
endef
|
||||
TARGET_DEVICES += cudy_c200p
|
||||
|
||||
define Device/cudy_m1300-v2
|
||||
$(Device/dsa-migration)
|
||||
IMAGE_SIZE := 15872k
|
||||
@ -778,6 +788,16 @@ define Device/cudy_m1800
|
||||
endef
|
||||
TARGET_DEVICES += cudy_m1800
|
||||
|
||||
define Device/cudy_r700
|
||||
$(Device/dsa-migration)
|
||||
DEVICE_VENDOR := Cudy
|
||||
DEVICE_MODEL := R700
|
||||
IMAGE_SIZE := 15872k
|
||||
UIMAGE_NAME := R29
|
||||
DEVICE_PACKAGES := -uboot-envtools -wpad-basic-mbedtls
|
||||
endef
|
||||
TARGET_DEVICES += cudy_r700
|
||||
|
||||
define Device/cudy_wr1300-v1
|
||||
$(Device/dsa-migration)
|
||||
IMAGE_SIZE := 15872k
|
||||
@ -824,26 +844,6 @@ define Device/cudy_wr2100
|
||||
endef
|
||||
TARGET_DEVICES += cudy_wr2100
|
||||
|
||||
define Device/cudy_r700
|
||||
$(Device/dsa-migration)
|
||||
DEVICE_VENDOR := Cudy
|
||||
DEVICE_MODEL := R700
|
||||
IMAGE_SIZE := 15872k
|
||||
UIMAGE_NAME := R29
|
||||
DEVICE_PACKAGES := -uboot-envtools -wpad-basic-mbedtls
|
||||
endef
|
||||
TARGET_DEVICES += cudy_r700
|
||||
|
||||
define Device/cudy_c200p
|
||||
$(Device/dsa-migration)
|
||||
DEVICE_VENDOR := Cudy
|
||||
DEVICE_MODEL := C200P
|
||||
IMAGE_SIZE := 15872k
|
||||
UIMAGE_NAME := R74
|
||||
DEVICE_PACKAGES := -uboot-envtools -wpad-basic-mbedtls kmod-usb3
|
||||
endef
|
||||
TARGET_DEVICES += cudy_c200p
|
||||
|
||||
define Device/cudy_x6-v1
|
||||
$(Device/dsa-migration)
|
||||
IMAGE_SIZE := 32256k
|
||||
|
||||
@ -84,9 +84,6 @@
|
||||
INTERNAL_PHY(13)
|
||||
INTERNAL_PHY(14)
|
||||
INTERNAL_PHY(15)
|
||||
|
||||
INTERNAL_PHY(24)
|
||||
INTERNAL_PHY(26)
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
@ -107,7 +104,6 @@
|
||||
reg = <24>;
|
||||
label = "lan9";
|
||||
pcs-handle = <&serdes4>;
|
||||
phy-handle = <&phy24>;
|
||||
phy-mode = "1000base-x";
|
||||
managed = "in-band-status";
|
||||
sfp = <&sfp0>;
|
||||
@ -117,7 +113,6 @@
|
||||
reg = <26>;
|
||||
label = "lan10";
|
||||
pcs-handle = <&serdes5>;
|
||||
phy-handle = <&phy26>;
|
||||
phy-mode = "1000base-x";
|
||||
managed = "in-band-status";
|
||||
sfp = <&sfp1>;
|
||||
|
||||
@ -35,16 +35,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
gpio-export {
|
||||
compatible = "gpio-export";
|
||||
|
||||
sff-p9-tx-disable {
|
||||
gpio-export,name = "sff-p9-tx-disable";
|
||||
gpio-export,output = <1>;
|
||||
gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
|
||||
gpio-restart {
|
||||
compatible = "gpio-restart";
|
||||
gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
|
||||
@ -76,13 +66,29 @@
|
||||
};
|
||||
};
|
||||
|
||||
i2c1: i2c-gpio-1 {
|
||||
compatible = "i2c-gpio";
|
||||
sda-gpios = <&gpio1 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
i2c-gpio-shared {
|
||||
compatible = "i2c-gpio-shared";
|
||||
scl-gpios = <&gpio1 31 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
i2c-gpio,delay-us = <2>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
i2c0: i2c@0 {
|
||||
sda-gpios = <&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
i2c-gpio,delay-us = <2>;
|
||||
};
|
||||
|
||||
i2c1: i2c@1 {
|
||||
sda-gpios = <&gpio1 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
i2c-gpio,delay-us = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
sfp0: sfp-p9 {
|
||||
compatible = "sff,sfp";
|
||||
i2c-bus = <&i2c0>;
|
||||
tx-disable-gpio = <&gpio1 10 GPIO_ACTIVE_HIGH>;
|
||||
los-gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;
|
||||
mod-def0-gpio = <&gpio1 12 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
sfp1: sfp-p10 {
|
||||
compatible = "sff,sfp";
|
||||
@ -111,15 +117,6 @@
|
||||
line-name = "poe-enable";
|
||||
};
|
||||
|
||||
sff_p9_gpios {
|
||||
gpio-hog;
|
||||
gpios = < 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>,
|
||||
< 11 GPIO_ACTIVE_HIGH>, /* los-gpio */
|
||||
< 12 GPIO_ACTIVE_LOW>; /* mod-def0-gpio */
|
||||
input;
|
||||
line-name = "sff-p9-gpios";
|
||||
};
|
||||
|
||||
led-controller {
|
||||
compatible = "realtek,rtl8231-leds";
|
||||
status = "disabled";
|
||||
@ -183,9 +180,6 @@
|
||||
INTERNAL_PHY(13)
|
||||
INTERNAL_PHY(14)
|
||||
INTERNAL_PHY(15)
|
||||
|
||||
INTERNAL_PHY(24)
|
||||
INTERNAL_PHY(26)
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
@ -202,15 +196,20 @@
|
||||
SWITCH_PORT(14, 7, internal)
|
||||
SWITCH_PORT(15, 8, internal)
|
||||
|
||||
/* TODO: fixed link SFP is not right */
|
||||
SWITCH_SFP_PORT(24, 9, 1000base-x)
|
||||
port@24 {
|
||||
reg = <24>;
|
||||
label = "lan9";
|
||||
pcs-handle = <&serdes4>;
|
||||
phy-mode = "1000base-x";
|
||||
managed = "in-band-status";
|
||||
sfp = <&sfp0>;
|
||||
};
|
||||
|
||||
port@26 {
|
||||
reg = <26>;
|
||||
label = "lan10";
|
||||
pcs-handle = <&serdes5>;
|
||||
phy-mode = "1000base-x";
|
||||
phy-handle = <&phy26>;
|
||||
managed = "in-band-status";
|
||||
sfp = <&sfp1>;
|
||||
};
|
||||
|
||||
@ -66,9 +66,6 @@
|
||||
INTERNAL_PHY(13)
|
||||
INTERNAL_PHY(14)
|
||||
INTERNAL_PHY(15)
|
||||
|
||||
INTERNAL_PHY(24)
|
||||
INTERNAL_PHY(26)
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
@ -89,7 +86,6 @@
|
||||
reg = <24>;
|
||||
label = "lan9";
|
||||
pcs-handle = <&serdes4>;
|
||||
phy-handle = <&phy24>;
|
||||
phy-mode = "1000base-x";
|
||||
managed = "in-band-status";
|
||||
sfp = <&sfp0>;
|
||||
@ -99,7 +95,6 @@
|
||||
reg = <26>;
|
||||
label = "lan10";
|
||||
pcs-handle = <&serdes5>;
|
||||
phy-handle = <&phy26>;
|
||||
phy-mode = "1000base-x";
|
||||
managed = "in-band-status";
|
||||
sfp = <&sfp1>;
|
||||
|
||||
@ -157,8 +157,6 @@
|
||||
INTERNAL_PHY(13)
|
||||
INTERNAL_PHY(14)
|
||||
INTERNAL_PHY(15)
|
||||
INTERNAL_PHY(24)
|
||||
INTERNAL_PHY(26)
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
@ -179,7 +177,6 @@
|
||||
reg = <24>;
|
||||
label = "lan9";
|
||||
pcs-handle = <&serdes4>;
|
||||
phy-handle = <&phy24>;
|
||||
phy-mode = "1000base-x";
|
||||
managed = "in-band-status";
|
||||
sfp = <&sfp0>;
|
||||
@ -189,7 +186,6 @@
|
||||
reg = <26>;
|
||||
label = "lan10";
|
||||
pcs-handle = <&serdes5>;
|
||||
phy-handle = <&phy26>;
|
||||
phy-mode = "1000base-x";
|
||||
managed = "in-band-status";
|
||||
sfp = <&sfp1>;
|
||||
|
||||
@ -53,7 +53,18 @@
|
||||
&switch0 {
|
||||
ports {
|
||||
SWITCH_PORT(16, 9, qsgmii)
|
||||
|
||||
/* TODO: fixed link SFP is not right */
|
||||
SWITCH_SFP_PORT(24, 10, rgmii-id)
|
||||
port24: port@24 {
|
||||
reg = <24>;
|
||||
label = SWITCH_PORT_LABEL(10);
|
||||
pcs-handle = <&serdes4>;
|
||||
phy-handle = <&phy24>;
|
||||
phy-mode = "1000base-x";
|
||||
fixed-link {
|
||||
speed = <1000>;
|
||||
full-duplex;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -49,15 +49,29 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mdio_bus0 {
|
||||
INTERNAL_PHY(24)
|
||||
INTERNAL_PHY(26)
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
ports {
|
||||
/* TODO: fixed link SFP is not right */
|
||||
SWITCH_SFP_PORT(24, 9, 1000base-x)
|
||||
SWITCH_SFP_PORT(26, 10, 1000base-x)
|
||||
|
||||
port24: port@24 {
|
||||
reg = <24>;
|
||||
label = SWITCH_PORT_LABEL(9);
|
||||
pcs-handle = <&serdes4>;
|
||||
phy-mode = "1000base-x";
|
||||
fixed-link {
|
||||
speed = <1000>;
|
||||
full-duplex;
|
||||
};
|
||||
};
|
||||
port26: port@26 {
|
||||
reg = <26>;
|
||||
label = SWITCH_PORT_LABEL(10);
|
||||
pcs-handle = <&serdes5>;
|
||||
phy-mode = "1000base-x";
|
||||
fixed-link {
|
||||
speed = <1000>;
|
||||
full-duplex;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -83,8 +83,6 @@
|
||||
INTERNAL_PHY(13)
|
||||
INTERNAL_PHY(14)
|
||||
INTERNAL_PHY(15)
|
||||
|
||||
INTERNAL_PHY(24)
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
@ -105,7 +103,6 @@
|
||||
reg = <24>;
|
||||
label = "lan9";
|
||||
pcs-handle = <&serdes4>;
|
||||
phy-handle = <&phy24>;
|
||||
phy-mode = "1000base-x";
|
||||
managed = "in-band-status";
|
||||
sfp = <&sfp0>;
|
||||
|
||||
@ -11,18 +11,3 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&phy24 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&phy26 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&port24 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&port26 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@ -7,10 +7,29 @@
|
||||
model = "TP-Link SG2210P v3";
|
||||
};
|
||||
|
||||
&port24 {
|
||||
label = "lan-sfp2";
|
||||
&switch0 {
|
||||
ports {
|
||||
port24: port@24 {
|
||||
reg = <24>;
|
||||
label = "lan-sfp2";
|
||||
pcs-handle = <&serdes4>;
|
||||
phy-mode = "1000base-x";
|
||||
fixed-link {
|
||||
speed = <1000>;
|
||||
full-duplex;
|
||||
};
|
||||
};
|
||||
|
||||
port26: port@26 {
|
||||
reg = <26>;
|
||||
label = "lan-sfp1";
|
||||
pcs-handle = <&serdes5>;
|
||||
phy-mode = "1000base-x";
|
||||
fixed-link {
|
||||
speed = <1000>;
|
||||
full-duplex;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&port26 {
|
||||
label = "lan-sfp1";
|
||||
};
|
||||
|
||||
@ -143,9 +143,6 @@
|
||||
INTERNAL_PHY(13)
|
||||
INTERNAL_PHY(14)
|
||||
INTERNAL_PHY(15)
|
||||
|
||||
INTERNAL_PHY(24)
|
||||
INTERNAL_PHY(26)
|
||||
};
|
||||
|
||||
ðernet0 {
|
||||
@ -168,8 +165,26 @@
|
||||
SWITCH_PORT(8, 8, internal)
|
||||
|
||||
/* TODO: fixed link SFP is not right */
|
||||
SWITCH_SFP_PORT(24, 9, 1000base-x)
|
||||
SWITCH_SFP_PORT(26, 10, 1000base-x)
|
||||
port24: port@24 {
|
||||
reg = <24>;
|
||||
label = SWITCH_PORT_LABEL(9);
|
||||
pcs-handle = <&serdes4>;
|
||||
phy-mode = "1000base-x";
|
||||
fixed-link {
|
||||
speed = <1000>;
|
||||
full-duplex;
|
||||
};
|
||||
};
|
||||
port26: port@26 {
|
||||
reg = <26>;
|
||||
label = SWITCH_PORT_LABEL(10);
|
||||
pcs-handle = <&serdes5>;
|
||||
phy-mode = "1000base-x";
|
||||
fixed-link {
|
||||
speed = <1000>;
|
||||
full-duplex;
|
||||
};
|
||||
};
|
||||
|
||||
port@28 {
|
||||
ethernet = <ðernet0>;
|
||||
|
||||
@ -52,18 +52,12 @@
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&mdio_bus0 {
|
||||
INTERNAL_PHY(24)
|
||||
INTERNAL_PHY(26)
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
ports {
|
||||
port@24 {
|
||||
reg = <24>;
|
||||
label = "lan9";
|
||||
pcs-handle = <&serdes4>;
|
||||
phy-handle = <&phy24>;
|
||||
phy-mode = "1000base-x";
|
||||
managed = "in-band-status";
|
||||
sfp = <&sfp0>;
|
||||
@ -73,7 +67,6 @@
|
||||
reg = <26>;
|
||||
label = "lan10";
|
||||
pcs-handle = <&serdes5>;
|
||||
phy-handle = <&phy26>;
|
||||
phy-mode = "1000base-x";
|
||||
managed = "in-band-status";
|
||||
sfp = <&sfp1>;
|
||||
|
||||
@ -229,14 +229,14 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
SWITCH_PORT(0, 1, qsgmii)
|
||||
SWITCH_PORT(1, 2, qsgmii)
|
||||
SWITCH_PORT(2, 3, qsgmii)
|
||||
SWITCH_PORT(3, 4, qsgmii)
|
||||
SWITCH_PORT(4, 5, qsgmii)
|
||||
SWITCH_PORT(5, 6, qsgmii)
|
||||
SWITCH_PORT(6, 7, qsgmii)
|
||||
SWITCH_PORT(7, 8, qsgmii)
|
||||
SWITCH_PORT_SDS(0, 1, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(1, 2, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(2, 3, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(3, 4, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(4, 5, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(5, 6, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(6, 7, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(7, 8, 1, qsgmii)
|
||||
|
||||
SWITCH_PORT(8, 9, internal)
|
||||
SWITCH_PORT(9, 10, internal)
|
||||
@ -247,10 +247,10 @@
|
||||
SWITCH_PORT(14, 15, internal)
|
||||
SWITCH_PORT(15, 16, internal)
|
||||
|
||||
SWITCH_PORT(24, 17, qsgmii)
|
||||
SWITCH_PORT(25, 18, qsgmii)
|
||||
SWITCH_PORT(26, 19, qsgmii)
|
||||
SWITCH_PORT(27, 20, qsgmii)
|
||||
SWITCH_PORT_SDS(24, 17, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(25, 18, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(26, 19, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(27, 20, 4, qsgmii)
|
||||
|
||||
port@28 {
|
||||
ethernet = <ðernet0>;
|
||||
|
||||
@ -83,9 +83,6 @@
|
||||
INTERNAL_PHY(13)
|
||||
INTERNAL_PHY(14)
|
||||
INTERNAL_PHY(15)
|
||||
|
||||
INTERNAL_PHY(24)
|
||||
INTERNAL_PHY(26)
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
@ -106,7 +103,6 @@
|
||||
reg = <24>;
|
||||
label = "lan9";
|
||||
pcs-handle = <&serdes4>;
|
||||
phy-handle = <&phy24>;
|
||||
phy-mode = "1000base-x";
|
||||
managed = "in-band-status";
|
||||
sfp = <&sfp0>;
|
||||
@ -116,7 +112,6 @@
|
||||
reg = <26>;
|
||||
label = "lan10";
|
||||
pcs-handle = <&serdes5>;
|
||||
phy-handle = <&phy26>;
|
||||
phy-mode = "1000base-x";
|
||||
managed = "in-band-status";
|
||||
sfp = <&sfp1>;
|
||||
|
||||
@ -39,14 +39,14 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
SWITCH_PORT(0, 1, qsgmii)
|
||||
SWITCH_PORT(1, 2, qsgmii)
|
||||
SWITCH_PORT(2, 3, qsgmii)
|
||||
SWITCH_PORT(3, 4, qsgmii)
|
||||
SWITCH_PORT(4, 5, qsgmii)
|
||||
SWITCH_PORT(5, 6, qsgmii)
|
||||
SWITCH_PORT(6, 7, qsgmii)
|
||||
SWITCH_PORT(7, 8, qsgmii)
|
||||
SWITCH_PORT_SDS(0, 1, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(1, 2, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(2, 3, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(3, 4, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(4, 5, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(5, 6, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(6, 7, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(7, 8, 1, qsgmii)
|
||||
|
||||
SWITCH_PORT(8, 9, internal)
|
||||
SWITCH_PORT(9, 10, internal)
|
||||
@ -57,10 +57,10 @@
|
||||
SWITCH_PORT(14, 15, internal)
|
||||
SWITCH_PORT(15, 16, internal)
|
||||
|
||||
SWITCH_PORT(24, 17, qsgmii)
|
||||
SWITCH_PORT(25, 18, qsgmii)
|
||||
SWITCH_PORT(26, 19, qsgmii)
|
||||
SWITCH_PORT(27, 20, qsgmii)
|
||||
SWITCH_PORT_SDS(24, 17, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(25, 18, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(26, 19, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(27, 20, 4, qsgmii)
|
||||
|
||||
port@28 {
|
||||
ethernet = <ðernet0>;
|
||||
|
||||
@ -39,14 +39,14 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
SWITCH_PORT(0, 1, qsgmii)
|
||||
SWITCH_PORT(1, 2, qsgmii)
|
||||
SWITCH_PORT(2, 3, qsgmii)
|
||||
SWITCH_PORT(3, 4, qsgmii)
|
||||
SWITCH_PORT(4, 5, qsgmii)
|
||||
SWITCH_PORT(5, 6, qsgmii)
|
||||
SWITCH_PORT(6, 7, qsgmii)
|
||||
SWITCH_PORT(7, 8, qsgmii)
|
||||
SWITCH_PORT_SDS(0, 1, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(1, 2, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(2, 3, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(3, 4, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(4, 5, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(5, 6, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(6, 7, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(7, 8, 1, qsgmii)
|
||||
|
||||
SWITCH_PORT(8, 9, internal)
|
||||
SWITCH_PORT(9, 10, internal)
|
||||
@ -57,10 +57,10 @@
|
||||
SWITCH_PORT(14, 15, internal)
|
||||
SWITCH_PORT(15, 16, internal)
|
||||
|
||||
SWITCH_PORT(24, 17, qsgmii)
|
||||
SWITCH_PORT(25, 18, qsgmii)
|
||||
SWITCH_PORT(26, 19, qsgmii)
|
||||
SWITCH_PORT(27, 20, qsgmii)
|
||||
SWITCH_PORT_SDS(24, 17, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(25, 18, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(26, 19, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(27, 20, 4, qsgmii)
|
||||
|
||||
port@28 {
|
||||
ethernet = <ðernet0>;
|
||||
|
||||
@ -72,9 +72,6 @@
|
||||
EXTERNAL_PHY(21)
|
||||
EXTERNAL_PHY(22)
|
||||
EXTERNAL_PHY(23)
|
||||
|
||||
INTERNAL_PHY(24)
|
||||
INTERNAL_PHY(26)
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
@ -82,14 +79,14 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
SWITCH_PORT(0, 1, qsgmii)
|
||||
SWITCH_PORT(1, 2, qsgmii)
|
||||
SWITCH_PORT(2, 3, qsgmii)
|
||||
SWITCH_PORT(3, 4, qsgmii)
|
||||
SWITCH_PORT(4, 5, qsgmii)
|
||||
SWITCH_PORT(5, 6, qsgmii)
|
||||
SWITCH_PORT(6, 7, qsgmii)
|
||||
SWITCH_PORT(7, 8, qsgmii)
|
||||
SWITCH_PORT_SDS(0, 1, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(1, 2, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(2, 3, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(3, 4, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(4, 5, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(5, 6, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(6, 7, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(7, 8, 1, qsgmii)
|
||||
|
||||
SWITCH_PORT(8, 9, internal)
|
||||
SWITCH_PORT(9, 10, internal)
|
||||
@ -100,14 +97,14 @@
|
||||
SWITCH_PORT(14, 15, internal)
|
||||
SWITCH_PORT(15, 16, internal)
|
||||
|
||||
SWITCH_PORT(16, 17, qsgmii)
|
||||
SWITCH_PORT(17, 18, qsgmii)
|
||||
SWITCH_PORT(18, 19, qsgmii)
|
||||
SWITCH_PORT(19, 20, qsgmii)
|
||||
SWITCH_PORT(20, 21, qsgmii)
|
||||
SWITCH_PORT(21, 22, qsgmii)
|
||||
SWITCH_PORT(22, 23, qsgmii)
|
||||
SWITCH_PORT(23, 24, qsgmii)
|
||||
SWITCH_PORT_SDS(16, 17, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(17, 18, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(18, 19, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(19, 20, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(20, 21, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(21, 22, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(22, 23, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(23, 24, 3, qsgmii)
|
||||
|
||||
port@24 {
|
||||
reg = <24>;
|
||||
|
||||
@ -40,14 +40,14 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
SWITCH_PORT(0, 1, qsgmii)
|
||||
SWITCH_PORT(1, 2, qsgmii)
|
||||
SWITCH_PORT(2, 3, qsgmii)
|
||||
SWITCH_PORT(3, 4, qsgmii)
|
||||
SWITCH_PORT(4, 5, qsgmii)
|
||||
SWITCH_PORT(5, 6, qsgmii)
|
||||
SWITCH_PORT(6, 7, qsgmii)
|
||||
SWITCH_PORT(7, 8, qsgmii)
|
||||
SWITCH_PORT_SDS(0, 1, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(1, 2, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(2, 3, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(3, 4, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(4, 5, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(5, 6, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(6, 7, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(7, 8, 1, qsgmii)
|
||||
|
||||
SWITCH_PORT(8, 9, internal)
|
||||
SWITCH_PORT(9, 10, internal)
|
||||
@ -58,19 +58,19 @@
|
||||
SWITCH_PORT(14, 15, internal)
|
||||
SWITCH_PORT(15, 16, internal)
|
||||
|
||||
SWITCH_PORT(16, 17, qsgmii)
|
||||
SWITCH_PORT(17, 18, qsgmii)
|
||||
SWITCH_PORT(18, 19, qsgmii)
|
||||
SWITCH_PORT(19, 20, qsgmii)
|
||||
SWITCH_PORT(20, 21, qsgmii)
|
||||
SWITCH_PORT(21, 22, qsgmii)
|
||||
SWITCH_PORT(22, 23, qsgmii)
|
||||
SWITCH_PORT(23, 24, qsgmii)
|
||||
SWITCH_PORT_SDS(16, 17, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(17, 18, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(18, 19, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(19, 20, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(20, 21, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(21, 22, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(22, 23, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(23, 24, 3, qsgmii)
|
||||
|
||||
SWITCH_PORT(24, 25, qsgmii)
|
||||
SWITCH_PORT(25, 26, qsgmii)
|
||||
SWITCH_PORT(26, 27, qsgmii)
|
||||
SWITCH_PORT(27, 28, qsgmii)
|
||||
SWITCH_PORT_SDS(24, 25, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(25, 26, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(26, 27, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(27, 28, 4, qsgmii)
|
||||
|
||||
port@28 {
|
||||
ethernet = <ðernet0>;
|
||||
|
||||
@ -21,19 +21,19 @@
|
||||
SWITCH_PORT(14, 7, internal)
|
||||
SWITCH_PORT(15, 8, internal)
|
||||
|
||||
SWITCH_PORT(16, 9, qsgmii)
|
||||
SWITCH_PORT(17, 10, qsgmii)
|
||||
SWITCH_PORT(18, 11, qsgmii)
|
||||
SWITCH_PORT(19, 12, qsgmii)
|
||||
SWITCH_PORT(20, 13, qsgmii)
|
||||
SWITCH_PORT(21, 14, qsgmii)
|
||||
SWITCH_PORT(22, 15, qsgmii)
|
||||
SWITCH_PORT(23, 16, qsgmii)
|
||||
SWITCH_PORT_SDS(16, 9, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(17, 10, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(18, 11, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(19, 12, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(20, 13, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(21, 14, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(22, 15, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(23, 16, 3, qsgmii)
|
||||
|
||||
SWITCH_PORT(24, 17, qsgmii)
|
||||
SWITCH_PORT(25, 18, qsgmii)
|
||||
SWITCH_PORT(26, 19, qsgmii)
|
||||
SWITCH_PORT(27, 20, qsgmii)
|
||||
SWITCH_PORT_SDS(24, 17, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(25, 18, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(26, 19, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(27, 20, 4, qsgmii)
|
||||
|
||||
port@28 {
|
||||
ethernet = <ðernet0>;
|
||||
|
||||
@ -23,14 +23,14 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
SWITCH_PORT(0, 1, qsgmii)
|
||||
SWITCH_PORT(1, 2, qsgmii)
|
||||
SWITCH_PORT(2, 3, qsgmii)
|
||||
SWITCH_PORT(3, 4, qsgmii)
|
||||
SWITCH_PORT(4, 5, qsgmii)
|
||||
SWITCH_PORT(5, 6, qsgmii)
|
||||
SWITCH_PORT(6, 7, qsgmii)
|
||||
SWITCH_PORT(7, 8, qsgmii)
|
||||
SWITCH_PORT_SDS(0, 1, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(1, 2, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(2, 3, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(3, 4, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(4, 5, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(5, 6, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(6, 7, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(7, 8, 1, qsgmii)
|
||||
|
||||
SWITCH_PORT(8, 9, internal)
|
||||
SWITCH_PORT(9, 10, internal)
|
||||
@ -41,19 +41,19 @@
|
||||
SWITCH_PORT(14, 15, internal)
|
||||
SWITCH_PORT(15, 16, internal)
|
||||
|
||||
SWITCH_PORT(16, 17, qsgmii)
|
||||
SWITCH_PORT(17, 18, qsgmii)
|
||||
SWITCH_PORT(18, 19, qsgmii)
|
||||
SWITCH_PORT(19, 20, qsgmii)
|
||||
SWITCH_PORT(20, 21, qsgmii)
|
||||
SWITCH_PORT(21, 22, qsgmii)
|
||||
SWITCH_PORT(22, 23, qsgmii)
|
||||
SWITCH_PORT(23, 24, qsgmii)
|
||||
SWITCH_PORT_SDS(16, 17, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(17, 18, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(18, 19, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(19, 20, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(20, 21, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(21, 22, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(22, 23, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(23, 24, 3, qsgmii)
|
||||
|
||||
SWITCH_PORT(24, 25, qsgmii)
|
||||
SWITCH_PORT(25, 26, qsgmii)
|
||||
SWITCH_PORT(26, 27, qsgmii)
|
||||
SWITCH_PORT(27, 28, qsgmii)
|
||||
SWITCH_PORT_SDS(24, 25, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(25, 26, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(26, 27, 4, qsgmii)
|
||||
SWITCH_PORT_SDS(27, 28, 4, qsgmii)
|
||||
|
||||
port@28 {
|
||||
ethernet = <ðernet0>;
|
||||
|
||||
@ -121,14 +121,14 @@
|
||||
SWITCH_PORT(14, 7, internal)
|
||||
SWITCH_PORT(15, 8, internal)
|
||||
|
||||
SWITCH_PORT(16, 9, qsgmii)
|
||||
SWITCH_PORT(17, 10, qsgmii)
|
||||
SWITCH_PORT(18, 11, qsgmii)
|
||||
SWITCH_PORT(19, 12, qsgmii)
|
||||
SWITCH_PORT(20, 13, qsgmii)
|
||||
SWITCH_PORT(21, 14, qsgmii)
|
||||
SWITCH_PORT(22, 15, qsgmii)
|
||||
SWITCH_PORT(23, 16, qsgmii)
|
||||
SWITCH_PORT_SDS(16, 9, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(17, 10, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(18, 11, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(19, 12, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(20, 13, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(21, 14, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(22, 15, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(23, 16, 3, qsgmii)
|
||||
|
||||
port@24 {
|
||||
reg = <24>;
|
||||
|
||||
@ -155,14 +155,14 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
SWITCH_PORT(0, 1, qsgmii)
|
||||
SWITCH_PORT(1, 2, qsgmii)
|
||||
SWITCH_PORT(2, 3, qsgmii)
|
||||
SWITCH_PORT(3, 4, qsgmii)
|
||||
SWITCH_PORT(4, 5, qsgmii)
|
||||
SWITCH_PORT(5, 6, qsgmii)
|
||||
SWITCH_PORT(6, 7, qsgmii)
|
||||
SWITCH_PORT(7, 8, qsgmii)
|
||||
SWITCH_PORT_SDS(0, 1, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(1, 2, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(2, 3, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(3, 4, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(4, 5, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(5, 6, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(6, 7, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(7, 8, 1, qsgmii)
|
||||
|
||||
SWITCH_PORT(8, 9, internal)
|
||||
SWITCH_PORT(9, 10, internal)
|
||||
@ -173,14 +173,14 @@
|
||||
SWITCH_PORT(14, 15, internal)
|
||||
SWITCH_PORT(15, 16, internal)
|
||||
|
||||
SWITCH_PORT(16, 17, qsgmii)
|
||||
SWITCH_PORT(17, 18, qsgmii)
|
||||
SWITCH_PORT(18, 19, qsgmii)
|
||||
SWITCH_PORT(19, 20, qsgmii)
|
||||
SWITCH_PORT(20, 21, qsgmii)
|
||||
SWITCH_PORT(21, 22, qsgmii)
|
||||
SWITCH_PORT(22, 23, qsgmii)
|
||||
SWITCH_PORT(23, 24, qsgmii)
|
||||
SWITCH_PORT_SDS(16, 17, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(17, 18, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(18, 19, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(19, 20, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(20, 21, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(21, 22, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(22, 23, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(23, 24, 3, qsgmii)
|
||||
|
||||
port@28 {
|
||||
ethernet = <ðernet0>;
|
||||
|
||||
@ -140,14 +140,14 @@
|
||||
SWITCH_PORT(14, 7, internal)
|
||||
SWITCH_PORT(15, 8, internal)
|
||||
|
||||
SWITCH_PORT(16, 9, qsgmii)
|
||||
SWITCH_PORT(17, 10, qsgmii)
|
||||
SWITCH_PORT(18, 11, qsgmii)
|
||||
SWITCH_PORT(19, 12, qsgmii)
|
||||
SWITCH_PORT(20, 13, qsgmii)
|
||||
SWITCH_PORT(21, 14, qsgmii)
|
||||
SWITCH_PORT(22, 15, qsgmii)
|
||||
SWITCH_PORT(23, 16, qsgmii)
|
||||
SWITCH_PORT_SDS(16, 9, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(17, 10, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(18, 11, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(19, 12, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(20, 13, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(21, 14, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(22, 15, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(23, 16, 3, qsgmii)
|
||||
|
||||
port@28 {
|
||||
ethernet = <ðernet0>;
|
||||
|
||||
@ -141,14 +141,14 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
SWITCH_PORT(0, 1, qsgmii)
|
||||
SWITCH_PORT(1, 2, qsgmii)
|
||||
SWITCH_PORT(2, 3, qsgmii)
|
||||
SWITCH_PORT(3, 4, qsgmii)
|
||||
SWITCH_PORT(4, 5, qsgmii)
|
||||
SWITCH_PORT(5, 6, qsgmii)
|
||||
SWITCH_PORT(6, 7, qsgmii)
|
||||
SWITCH_PORT(7, 8, qsgmii)
|
||||
SWITCH_PORT_SDS(0, 1, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(1, 2, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(2, 3, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(3, 4, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(4, 5, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(5, 6, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(6, 7, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(7, 8, 1, qsgmii)
|
||||
|
||||
SWITCH_PORT(8, 9, internal)
|
||||
SWITCH_PORT(9, 10, internal)
|
||||
@ -159,14 +159,14 @@
|
||||
SWITCH_PORT(14, 15, internal)
|
||||
SWITCH_PORT(15, 16, internal)
|
||||
|
||||
SWITCH_PORT(16, 17, qsgmii)
|
||||
SWITCH_PORT(17, 18, qsgmii)
|
||||
SWITCH_PORT(18, 19, qsgmii)
|
||||
SWITCH_PORT(19, 20, qsgmii)
|
||||
SWITCH_PORT(20, 21, qsgmii)
|
||||
SWITCH_PORT(21, 22, qsgmii)
|
||||
SWITCH_PORT(22, 23, qsgmii)
|
||||
SWITCH_PORT(23, 24, qsgmii)
|
||||
SWITCH_PORT_SDS(16, 17, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(17, 18, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(18, 19, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(19, 20, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(20, 21, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(21, 22, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(22, 23, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(23, 24, 3, qsgmii)
|
||||
|
||||
port@28 {
|
||||
ethernet = <ðernet0>;
|
||||
|
||||
@ -128,14 +128,14 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
SWITCH_PORT(0, 1, qsgmii)
|
||||
SWITCH_PORT(1, 2, qsgmii)
|
||||
SWITCH_PORT(2, 3, qsgmii)
|
||||
SWITCH_PORT(3, 4, qsgmii)
|
||||
SWITCH_PORT(4, 5, qsgmii)
|
||||
SWITCH_PORT(5, 6, qsgmii)
|
||||
SWITCH_PORT(6, 7, qsgmii)
|
||||
SWITCH_PORT(7, 8, qsgmii)
|
||||
SWITCH_PORT_SDS(0, 1, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(1, 2, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(2, 3, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(3, 4, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(4, 5, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(5, 6, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(6, 7, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(7, 8, 1, qsgmii)
|
||||
|
||||
SWITCH_PORT(8, 9, internal)
|
||||
SWITCH_PORT(9, 10, internal)
|
||||
@ -146,14 +146,14 @@
|
||||
SWITCH_PORT(14, 15, internal)
|
||||
SWITCH_PORT(15, 16, internal)
|
||||
|
||||
SWITCH_PORT(16, 17, qsgmii)
|
||||
SWITCH_PORT(17, 18, qsgmii)
|
||||
SWITCH_PORT(18, 19, qsgmii)
|
||||
SWITCH_PORT(19, 20, qsgmii)
|
||||
SWITCH_PORT(20, 21, qsgmii)
|
||||
SWITCH_PORT(21, 22, qsgmii)
|
||||
SWITCH_PORT(22, 23, qsgmii)
|
||||
SWITCH_PORT(23, 24, qsgmii)
|
||||
SWITCH_PORT_SDS(16, 17, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(17, 18, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(18, 19, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(19, 20, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(20, 21, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(21, 22, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(22, 23, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(23, 24, 3, qsgmii)
|
||||
|
||||
port@28 {
|
||||
ethernet = <ðernet0>;
|
||||
|
||||
@ -21,14 +21,14 @@
|
||||
|
||||
&switch0 {
|
||||
ports {
|
||||
SWITCH_PORT(16, 9, qsgmii)
|
||||
SWITCH_PORT(17, 10, qsgmii)
|
||||
SWITCH_PORT(18, 11, qsgmii)
|
||||
SWITCH_PORT(19, 12, qsgmii)
|
||||
SWITCH_PORT(20, 13, qsgmii)
|
||||
SWITCH_PORT(21, 14, qsgmii)
|
||||
SWITCH_PORT(22, 15, qsgmii)
|
||||
SWITCH_PORT(23, 16, qsgmii)
|
||||
SWITCH_PORT_SDS(16, 9, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(17, 10, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(18, 11, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(19, 12, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(20, 13, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(21, 14, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(22, 15, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(23, 16, 3, qsgmii)
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -72,21 +72,18 @@
|
||||
EXTERNAL_PHY(21)
|
||||
EXTERNAL_PHY(22)
|
||||
EXTERNAL_PHY(23)
|
||||
|
||||
INTERNAL_PHY(24)
|
||||
INTERNAL_PHY(26)
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
ports {
|
||||
SWITCH_PORT(0, 1, qsgmii)
|
||||
SWITCH_PORT(1, 2, qsgmii)
|
||||
SWITCH_PORT(2, 3, qsgmii)
|
||||
SWITCH_PORT(3, 4, qsgmii)
|
||||
SWITCH_PORT(4, 5, qsgmii)
|
||||
SWITCH_PORT(5, 6, qsgmii)
|
||||
SWITCH_PORT(6, 7, qsgmii)
|
||||
SWITCH_PORT(7, 8, qsgmii)
|
||||
SWITCH_PORT_SDS(0, 1, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(1, 2, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(2, 3, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(3, 4, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(4, 5, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(5, 6, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(6, 7, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(7, 8, 1, qsgmii)
|
||||
|
||||
SWITCH_PORT(8, 9, internal)
|
||||
SWITCH_PORT(9, 10, internal)
|
||||
@ -97,14 +94,14 @@
|
||||
SWITCH_PORT(14, 15, internal)
|
||||
SWITCH_PORT(15, 16, internal)
|
||||
|
||||
SWITCH_PORT(16, 17, qsgmii)
|
||||
SWITCH_PORT(17, 18, qsgmii)
|
||||
SWITCH_PORT(18, 19, qsgmii)
|
||||
SWITCH_PORT(19, 20, qsgmii)
|
||||
SWITCH_PORT(20, 21, qsgmii)
|
||||
SWITCH_PORT(21, 22, qsgmii)
|
||||
SWITCH_PORT(22, 23, qsgmii)
|
||||
SWITCH_PORT(23, 24, qsgmii)
|
||||
SWITCH_PORT_SDS(16, 17, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(17, 18, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(18, 19, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(19, 20, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(20, 21, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(21, 22, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(22, 23, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(23, 24, 3, qsgmii)
|
||||
|
||||
port@24 {
|
||||
reg = <24>;
|
||||
|
||||
@ -30,14 +30,14 @@
|
||||
|
||||
&switch0 {
|
||||
ports {
|
||||
SWITCH_PORT(1, 1, qsgmii)
|
||||
SWITCH_PORT(0, 2, qsgmii)
|
||||
SWITCH_PORT(3, 3, qsgmii)
|
||||
SWITCH_PORT(2, 4, qsgmii)
|
||||
SWITCH_PORT(5, 5, qsgmii)
|
||||
SWITCH_PORT(4, 6, qsgmii)
|
||||
SWITCH_PORT(7, 7, qsgmii)
|
||||
SWITCH_PORT(6, 8, qsgmii)
|
||||
SWITCH_PORT_SDS(1, 1, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(0, 2, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(3, 3, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(2, 4, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(5, 5, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(4, 6, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(7, 7, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(6, 8, 1, qsgmii)
|
||||
|
||||
SWITCH_PORT(9, 9, internal)
|
||||
SWITCH_PORT(8, 10, internal)
|
||||
@ -48,14 +48,14 @@
|
||||
SWITCH_PORT(15, 15, internal)
|
||||
SWITCH_PORT(14, 16, internal)
|
||||
|
||||
SWITCH_PORT(17, 17, qsgmii)
|
||||
SWITCH_PORT(16, 18, qsgmii)
|
||||
SWITCH_PORT(19, 19, qsgmii)
|
||||
SWITCH_PORT(18, 20, qsgmii)
|
||||
SWITCH_PORT(21, 21, qsgmii)
|
||||
SWITCH_PORT(20, 22, qsgmii)
|
||||
SWITCH_PORT(23, 23, qsgmii)
|
||||
SWITCH_PORT(22, 24, qsgmii)
|
||||
SWITCH_PORT_SDS(17, 17, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(16, 18, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(19, 19, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(18, 20, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(21, 21, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(20, 22, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(23, 23, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(22, 24, 3, qsgmii)
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -34,14 +34,14 @@
|
||||
|
||||
&switch0 {
|
||||
ports {
|
||||
SWITCH_PORT(0, 1, qsgmii)
|
||||
SWITCH_PORT(1, 2, qsgmii)
|
||||
SWITCH_PORT(2, 3, qsgmii)
|
||||
SWITCH_PORT(3, 4, qsgmii)
|
||||
SWITCH_PORT(4, 5, qsgmii)
|
||||
SWITCH_PORT(5, 6, qsgmii)
|
||||
SWITCH_PORT(6, 7, qsgmii)
|
||||
SWITCH_PORT(7, 8, qsgmii)
|
||||
SWITCH_PORT_SDS(0, 1, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(1, 2, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(2, 3, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(3, 4, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(4, 5, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(5, 6, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(6, 7, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(7, 8, 1, qsgmii)
|
||||
|
||||
SWITCH_PORT(8, 9, internal)
|
||||
SWITCH_PORT(9, 10, internal)
|
||||
@ -52,13 +52,13 @@
|
||||
SWITCH_PORT(14, 15, internal)
|
||||
SWITCH_PORT(15, 16, internal)
|
||||
|
||||
SWITCH_PORT(16, 17, qsgmii)
|
||||
SWITCH_PORT(17, 18, qsgmii)
|
||||
SWITCH_PORT(18, 19, qsgmii)
|
||||
SWITCH_PORT(19, 20, qsgmii)
|
||||
SWITCH_PORT(20, 21, qsgmii)
|
||||
SWITCH_PORT(21, 22, qsgmii)
|
||||
SWITCH_PORT(22, 23, qsgmii)
|
||||
SWITCH_PORT(23, 24, qsgmii)
|
||||
SWITCH_PORT_SDS(16, 17, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(17, 18, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(18, 19, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(19, 20, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(20, 21, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(21, 22, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(22, 23, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(23, 24, 3, qsgmii)
|
||||
};
|
||||
};
|
||||
|
||||
@ -72,21 +72,18 @@
|
||||
EXTERNAL_PHY(21)
|
||||
EXTERNAL_PHY(22)
|
||||
EXTERNAL_PHY(23)
|
||||
|
||||
INTERNAL_PHY(24)
|
||||
INTERNAL_PHY(26)
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
ports {
|
||||
SWITCH_PORT(0, 1, qsgmii)
|
||||
SWITCH_PORT(1, 2, qsgmii)
|
||||
SWITCH_PORT(2, 3, qsgmii)
|
||||
SWITCH_PORT(3, 4, qsgmii)
|
||||
SWITCH_PORT(4, 5, qsgmii)
|
||||
SWITCH_PORT(5, 6, qsgmii)
|
||||
SWITCH_PORT(6, 7, qsgmii)
|
||||
SWITCH_PORT(7, 8, qsgmii)
|
||||
SWITCH_PORT_SDS(0, 1, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(1, 2, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(2, 3, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(3, 4, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(4, 5, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(5, 6, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(6, 7, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(7, 8, 1, qsgmii)
|
||||
|
||||
SWITCH_PORT(8, 9, internal)
|
||||
SWITCH_PORT(9, 10, internal)
|
||||
@ -97,14 +94,14 @@
|
||||
SWITCH_PORT(14, 15, internal)
|
||||
SWITCH_PORT(15, 16, internal)
|
||||
|
||||
SWITCH_PORT(16, 17, qsgmii)
|
||||
SWITCH_PORT(17, 18, qsgmii)
|
||||
SWITCH_PORT(18, 19, qsgmii)
|
||||
SWITCH_PORT(19, 20, qsgmii)
|
||||
SWITCH_PORT(20, 21, qsgmii)
|
||||
SWITCH_PORT(21, 22, qsgmii)
|
||||
SWITCH_PORT(22, 23, qsgmii)
|
||||
SWITCH_PORT(23, 24, qsgmii)
|
||||
SWITCH_PORT_SDS(16, 17, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(17, 18, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(18, 19, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(19, 20, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(20, 21, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(21, 22, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(22, 23, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(23, 24, 3, qsgmii)
|
||||
|
||||
port@24 {
|
||||
reg = <24>;
|
||||
|
||||
@ -68,21 +68,18 @@
|
||||
EXTERNAL_PHY(21)
|
||||
EXTERNAL_PHY(22)
|
||||
EXTERNAL_PHY(23)
|
||||
|
||||
INTERNAL_PHY(24)
|
||||
INTERNAL_PHY(26)
|
||||
};
|
||||
|
||||
&switch0 {
|
||||
ports {
|
||||
SWITCH_PORT(0, 1, qsgmii)
|
||||
SWITCH_PORT(1, 2, qsgmii)
|
||||
SWITCH_PORT(2, 3, qsgmii)
|
||||
SWITCH_PORT(3, 4, qsgmii)
|
||||
SWITCH_PORT(4, 5, qsgmii)
|
||||
SWITCH_PORT(5, 6, qsgmii)
|
||||
SWITCH_PORT(6, 7, qsgmii)
|
||||
SWITCH_PORT(7, 8, qsgmii)
|
||||
SWITCH_PORT_SDS(0, 1, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(1, 2, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(2, 3, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(3, 4, 0, qsgmii)
|
||||
SWITCH_PORT_SDS(4, 5, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(5, 6, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(6, 7, 1, qsgmii)
|
||||
SWITCH_PORT_SDS(7, 8, 1, qsgmii)
|
||||
|
||||
SWITCH_PORT(8, 9, internal)
|
||||
SWITCH_PORT(9, 10, internal)
|
||||
@ -93,14 +90,14 @@
|
||||
SWITCH_PORT(14, 15, internal)
|
||||
SWITCH_PORT(15, 16, internal)
|
||||
|
||||
SWITCH_PORT(16, 17, qsgmii)
|
||||
SWITCH_PORT(17, 18, qsgmii)
|
||||
SWITCH_PORT(18, 19, qsgmii)
|
||||
SWITCH_PORT(19, 20, qsgmii)
|
||||
SWITCH_PORT(20, 21, qsgmii)
|
||||
SWITCH_PORT(21, 22, qsgmii)
|
||||
SWITCH_PORT(22, 23, qsgmii)
|
||||
SWITCH_PORT(23, 24, qsgmii)
|
||||
SWITCH_PORT_SDS(16, 17, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(17, 18, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(18, 19, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(19, 20, 2, qsgmii)
|
||||
SWITCH_PORT_SDS(20, 21, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(21, 22, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(22, 23, 3, qsgmii)
|
||||
SWITCH_PORT_SDS(23, 24, 3, qsgmii)
|
||||
|
||||
|
||||
port@24 {
|
||||
|
||||
@ -369,14 +369,6 @@ static int __init rtl83xx_mdio_probe(struct rtl838x_switch_priv *priv)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Check for the integrated SerDes of the RTL8380M first */
|
||||
if (of_property_read_bool(phy_node, "phy-is-integrated")
|
||||
&& priv->id == 0x8380 && pn >= 24) {
|
||||
pr_debug("----> FOUND A SERDES\n");
|
||||
priv->ports[pn].phy = PHY_RTL838X_SDS;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (of_property_read_bool(phy_node, "phy-is-integrated") &&
|
||||
!of_property_read_bool(phy_node, "sfp")) {
|
||||
priv->ports[pn].phy = PHY_RTL8218B_INT;
|
||||
@ -408,13 +400,6 @@ static int __init rtl83xx_mdio_probe(struct rtl838x_switch_priv *priv)
|
||||
sw_w32_mask(BIT(7), 0, RTL839X_SMI_GLB_CTRL);
|
||||
}
|
||||
|
||||
/* Power on fibre ports and reset them if necessary */
|
||||
if (priv->ports[24].phy == PHY_RTL838X_SDS) {
|
||||
pr_debug("Powering on fibre ports & reset\n");
|
||||
rtl8380_sds_power(24, 1);
|
||||
rtl8380_sds_power(26, 1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -652,43 +652,6 @@ static struct phylink_pcs *rtldsa_phylink_mac_select_pcs(struct dsa_switch *ds,
|
||||
return priv->pcs[port];
|
||||
}
|
||||
|
||||
static void rtl83xx_config_interface(int port, phy_interface_t interface)
|
||||
{
|
||||
u32 old, int_shift, sds_shift;
|
||||
|
||||
switch (port) {
|
||||
case 24:
|
||||
int_shift = 0;
|
||||
sds_shift = 5;
|
||||
break;
|
||||
case 26:
|
||||
int_shift = 3;
|
||||
sds_shift = 0;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
old = sw_r32(RTL838X_SDS_MODE_SEL);
|
||||
switch (interface) {
|
||||
case PHY_INTERFACE_MODE_1000BASEX:
|
||||
if ((old >> sds_shift & 0x1f) == 4)
|
||||
return;
|
||||
sw_w32_mask(0x7 << int_shift, 1 << int_shift, RTL838X_INT_MODE_CTRL);
|
||||
sw_w32_mask(0x1f << sds_shift, 4 << sds_shift, RTL838X_SDS_MODE_SEL);
|
||||
break;
|
||||
case PHY_INTERFACE_MODE_SGMII:
|
||||
if ((old >> sds_shift & 0x1f) == 2)
|
||||
return;
|
||||
sw_w32_mask(0x7 << int_shift, 2 << int_shift, RTL838X_INT_MODE_CTRL);
|
||||
sw_w32_mask(0x1f << sds_shift, 2 << sds_shift, RTL838X_SDS_MODE_SEL);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
pr_debug("configured port %d for interface %s\n", port, phy_modes(interface));
|
||||
}
|
||||
|
||||
static void rtldsa_83xx_phylink_get_caps(struct dsa_switch *ds, int port,
|
||||
struct phylink_config *config)
|
||||
{
|
||||
@ -754,7 +717,7 @@ static void rtl83xx_phylink_mac_config(struct dsa_switch *ds, int port,
|
||||
mcr = sw_r32(priv->r->mac_force_mode_ctrl(port));
|
||||
if (mode == MLO_AN_PHY || phylink_autoneg_inband(mode)) {
|
||||
pr_debug("port %d PHY autonegotiates\n", port);
|
||||
rtl83xx_config_interface(port, state->interface);
|
||||
|
||||
mcr |= RTL838X_NWAY_EN;
|
||||
} else {
|
||||
mcr &= ~RTL838X_NWAY_EN;
|
||||
|
||||
@ -1810,31 +1810,3 @@ void rtl838x_vlan_profile_dump(int profile)
|
||||
profile, p & 1, (p >> 1) & 0x1ff, (p >> 10) & 0x1ff, (p >> 19) & 0x1ff);
|
||||
}
|
||||
|
||||
void rtl8380_sds_rst(int mac)
|
||||
{
|
||||
u32 offset = (mac == 24) ? 0 : 0x100;
|
||||
|
||||
sw_w32_mask(1 << 11, 0, RTL838X_SDS4_FIB_REG0 + offset);
|
||||
sw_w32_mask(0x3, 0, RTL838X_SDS4_REG28 + offset);
|
||||
sw_w32_mask(0x3, 0x3, RTL838X_SDS4_REG28 + offset);
|
||||
sw_w32_mask(0, 0x1 << 6, RTL838X_SDS4_DUMMY0 + offset);
|
||||
sw_w32_mask(0x1 << 6, 0, RTL838X_SDS4_DUMMY0 + offset);
|
||||
pr_debug("SERDES reset: %d\n", mac);
|
||||
}
|
||||
|
||||
int rtl8380_sds_power(int mac, int val)
|
||||
{
|
||||
u32 mode = (val == 1) ? 0x4 : 0x9;
|
||||
u32 offset = (mac == 24) ? 5 : 0;
|
||||
|
||||
if ((mac != 24) && (mac != 26)) {
|
||||
pr_err("%s: not a fibre port: %d\n", __func__, mac);
|
||||
return -1;
|
||||
}
|
||||
|
||||
sw_w32_mask(0x1f << offset, mode << offset, RTL838X_SDS_MODE_SEL);
|
||||
|
||||
rtl8380_sds_rst(mac);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -21,10 +21,6 @@
|
||||
#define RTL930X_MAC_FORCE_MODE_CTRL (0xCA1C)
|
||||
#define RTL931X_MAC_FORCE_MODE_CTRL (0x0DCC)
|
||||
|
||||
#define RTL838X_DMY_REG31 (0x3b28)
|
||||
#define RTL838X_SDS_MODE_SEL (0x0028)
|
||||
#define RTL838X_SDS_CFG_REG (0x0034)
|
||||
#define RTL838X_INT_MODE_CTRL (0x005c)
|
||||
#define RTL838X_PORT_ISO_CTRL(port) (0x4100 + ((port) << 2))
|
||||
#define RTL839X_PORT_ISO_CTRL(port) (0x1400 + ((port) << 3))
|
||||
|
||||
@ -54,12 +50,6 @@
|
||||
#define RTL839X_SDS12_13_PWR0 (0xb880)
|
||||
#define RTL839X_SDS12_13_PWR1 (0xb980)
|
||||
|
||||
/* Registers of the internal Serdes of the 8380 */
|
||||
#define RTL838X_SDS4_FIB_REG0 (0xF800)
|
||||
#define RTL838X_SDS4_REG28 (0xef80)
|
||||
#define RTL838X_SDS4_DUMMY0 (0xef8c)
|
||||
#define RTL838X_SDS5_EXT_REG6 (0xf18c)
|
||||
|
||||
/* VLAN registers */
|
||||
#define RTL838X_VLAN_CTRL (0x3A74)
|
||||
#define RTL838X_VLAN_PROFILE(idx) (0x3A88 + ((idx) << 2))
|
||||
|
||||
@ -162,8 +162,6 @@ u32 rtl838x_hash(struct rtl838x_switch_priv *priv, u64 seed);
|
||||
irqreturn_t rtl838x_switch_irq(int irq, void *dev_id);
|
||||
void rtl8380_get_version(struct rtl838x_switch_priv *priv);
|
||||
void rtl838x_vlan_profile_dump(int index);
|
||||
void rtl8380_sds_rst(int mac);
|
||||
int rtl8380_sds_power(int mac, int val);
|
||||
void rtl838x_print_matrix(void);
|
||||
|
||||
/* RTL839x-specific */
|
||||
|
||||
@ -51,6 +51,13 @@
|
||||
#define RTPCS_931X_MAC_RX_PAUSE_STS 0x0f00
|
||||
#define RTPCS_931X_MAC_TX_PAUSE_STS 0x0ef8
|
||||
|
||||
#define RTPCS_838X_SDS_CFG_REG 0x34
|
||||
#define RTPCS_838X_RST_GLB_CTRL_0 0x3c
|
||||
#define RTPCS_838X_SDS_MODE_SEL 0x0028
|
||||
#define RTPCS_838X_INT_RW_CTRL 0x0058
|
||||
#define RTPCS_838X_INT_MODE_CTRL 0x005c
|
||||
#define RTPCS_838X_PLL_CML_CTRL 0x0ff8
|
||||
|
||||
#define RTPCS_93XX_MAC_LINK_SPD_BITS 4
|
||||
|
||||
#define RTL93XX_MODEL_NAME_INFO (0x0004)
|
||||
@ -122,6 +129,7 @@ struct rtpcs_config {
|
||||
int mac_rx_pause_sts;
|
||||
int mac_tx_pause_sts;
|
||||
const struct phylink_pcs_ops *pcs_ops;
|
||||
int (*init_serdes_common)(struct rtpcs_ctrl *ctrl);
|
||||
int (*set_autoneg)(struct rtpcs_ctrl *ctrl, int sds, unsigned int neg_mode);
|
||||
int (*setup_serdes)(struct rtpcs_ctrl *ctrl, int sds, phy_interface_t mode);
|
||||
};
|
||||
@ -213,6 +221,288 @@ static struct rtpcs_link *rtpcs_phylink_pcs_to_link(struct phylink_pcs *pcs)
|
||||
|
||||
/* Variant-specific functions */
|
||||
|
||||
/* RTL838X */
|
||||
|
||||
static void rtpcs_838x_sds_patch_01_qsgmii_6275b(struct rtpcs_ctrl *ctrl)
|
||||
{
|
||||
rtpcs_sds_write(ctrl, 0, 1, 3, 0xf46f);
|
||||
rtpcs_sds_write(ctrl, 0, 1, 2, 0x85fa);
|
||||
rtpcs_sds_write(ctrl, 1, 1, 2, 0x85fa);
|
||||
rtpcs_sds_write(ctrl, 0, 1, 6, 0x20d8);
|
||||
rtpcs_sds_write(ctrl, 1, 1, 6, 0x20d8);
|
||||
rtpcs_sds_write(ctrl, 0, 1, 17, 0xb7c9);
|
||||
rtpcs_sds_write(ctrl, 1, 1, 11, 0x482);
|
||||
rtpcs_sds_write(ctrl, 1, 1, 10, 0x80c7);
|
||||
rtpcs_sds_write(ctrl, 0, 1, 18, 0xab8e);
|
||||
rtpcs_sds_write(ctrl, 0, 1, 11, 0x482);
|
||||
rtpcs_sds_write(ctrl, 0, 1, 19, 0x24ab);
|
||||
rtpcs_sds_write(ctrl, 1, 1, 17, 0x4208);
|
||||
rtpcs_sds_write(ctrl, 1, 1, 18, 0xc208);
|
||||
rtpcs_sds_write(ctrl, 0, 2, 25, 0x303);
|
||||
rtpcs_sds_write(ctrl, 1, 2, 25, 0x303);
|
||||
rtpcs_sds_write(ctrl, 0, 1, 14, 0xfcc2);
|
||||
rtpcs_sds_write(ctrl, 1, 1, 14, 0xfcc2);
|
||||
|
||||
rtpcs_sds_write(ctrl, 0, 1, 9, 0x8e64);
|
||||
rtpcs_sds_write(ctrl, 0, 1, 9, 0x8c64);
|
||||
|
||||
rtpcs_sds_write(ctrl, 1, 1, 9, 0x8e64);
|
||||
rtpcs_sds_write(ctrl, 1, 1, 9, 0x8c64);
|
||||
}
|
||||
|
||||
static void rtpcs_838x_sds_patch_23_qsgmii_6275b(struct rtpcs_ctrl *ctrl)
|
||||
{
|
||||
rtpcs_sds_write(ctrl, 2, 1, 3, 0xf46d);
|
||||
rtpcs_sds_write(ctrl, 2, 1, 2, 0x85fa);
|
||||
rtpcs_sds_write(ctrl, 3, 1, 2, 0x85fa);
|
||||
rtpcs_sds_write(ctrl, 2, 1, 6, 0x20d8);
|
||||
rtpcs_sds_write(ctrl, 3, 1, 6, 0x20d8);
|
||||
rtpcs_sds_write(ctrl, 2, 1, 17, 0xb7c9);
|
||||
rtpcs_sds_write(ctrl, 2, 1, 18, 0xab8e);
|
||||
rtpcs_sds_write(ctrl, 2, 1, 11, 0x482);
|
||||
rtpcs_sds_write(ctrl, 3, 1, 11, 0x482);
|
||||
rtpcs_sds_write(ctrl, 2, 1, 19, 0x24ab);
|
||||
rtpcs_sds_write(ctrl, 3, 1, 17, 0x4208);
|
||||
rtpcs_sds_write(ctrl, 3, 1, 18, 0xc208);
|
||||
rtpcs_sds_write(ctrl, 2, 2, 25, 0x303);
|
||||
rtpcs_sds_write(ctrl, 3, 2, 25, 0x303);
|
||||
rtpcs_sds_write(ctrl, 2, 1, 14, 0xfcc2);
|
||||
rtpcs_sds_write(ctrl, 3, 1, 14, 0xfcc2);
|
||||
|
||||
rtpcs_sds_write(ctrl, 2, 1, 9, 0x8e64);
|
||||
rtpcs_sds_write(ctrl, 2, 1, 9, 0x8c64);
|
||||
|
||||
rtpcs_sds_write(ctrl, 3, 1, 9, 0x8e64);
|
||||
rtpcs_sds_write(ctrl, 3, 1, 9, 0x8c64);
|
||||
}
|
||||
|
||||
static void rtpcs_838x_sds_patch_4_fiber_6275b(struct rtpcs_ctrl *ctrl)
|
||||
{
|
||||
rtpcs_sds_write(ctrl, 4, 1, 2, 0x85fa);
|
||||
rtpcs_sds_write(ctrl, 4, 1, 11, 0x1482);
|
||||
rtpcs_sds_write(ctrl, 4, 1, 6, 0x20d8);
|
||||
rtpcs_sds_write(ctrl, 4, 1, 10, 0xc3);
|
||||
rtpcs_sds_write(ctrl, 4, 1, 17, 0xb7c9);
|
||||
rtpcs_sds_write(ctrl, 4, 1, 18, 0xab8e);
|
||||
rtpcs_sds_write(ctrl, 4, 2, 25, 0x303);
|
||||
rtpcs_sds_write(ctrl, 4, 1, 14, 0xfcc2);
|
||||
|
||||
rtpcs_sds_write(ctrl, 4, 1, 9, 0x8e64);
|
||||
rtpcs_sds_write(ctrl, 4, 1, 9, 0x8c64);
|
||||
}
|
||||
|
||||
static void rtpcs_838x_sds_patch_4_qsgmii_6275b(struct rtpcs_ctrl *ctrl)
|
||||
{
|
||||
rtpcs_sds_write(ctrl, 4, 1, 3, 0xf46d);
|
||||
rtpcs_sds_write(ctrl, 4, 1, 2, 0x85fa);
|
||||
rtpcs_sds_write(ctrl, 4, 1, 11, 0x0482);
|
||||
rtpcs_sds_write(ctrl, 4, 1, 6, 0x20d8);
|
||||
rtpcs_sds_write(ctrl, 4, 1, 10, 0x58c7);
|
||||
rtpcs_sds_write(ctrl, 4, 1, 17, 0xb7c9);
|
||||
rtpcs_sds_write(ctrl, 4, 1, 18, 0xab8e);
|
||||
rtpcs_sds_write(ctrl, 4, 2, 25, 0x303);
|
||||
rtpcs_sds_write(ctrl, 4, 1, 14, 0xfcc2);
|
||||
|
||||
rtpcs_sds_write(ctrl, 4, 1, 9, 0x8e64);
|
||||
rtpcs_sds_write(ctrl, 4, 1, 9, 0x8c64);
|
||||
}
|
||||
|
||||
static void rtpcs_838x_sds_patch_5_fiber_6275b(struct rtpcs_ctrl *ctrl)
|
||||
{
|
||||
rtpcs_sds_write(ctrl, 5, 1, 2, 0x85fa);
|
||||
rtpcs_sds_write(ctrl, 5, 1, 3, 0x00);
|
||||
rtpcs_sds_write(ctrl, 5, 1, 4, 0xdccc);
|
||||
rtpcs_sds_write(ctrl, 5, 1, 5, 0x00);
|
||||
rtpcs_sds_write(ctrl, 5, 1, 6, 0x3600);
|
||||
rtpcs_sds_write(ctrl, 5, 1, 7, 0x03);
|
||||
rtpcs_sds_write(ctrl, 5, 1, 8, 0x79aa);
|
||||
rtpcs_sds_write(ctrl, 5, 1, 9, 0x8c64);
|
||||
rtpcs_sds_write(ctrl, 5, 1, 10, 0xc3);
|
||||
rtpcs_sds_write(ctrl, 5, 1, 11, 0x1482);
|
||||
rtpcs_sds_write(ctrl, 5, 2, 24, 0x14aa);
|
||||
rtpcs_sds_write(ctrl, 5, 2, 25, 0x303);
|
||||
rtpcs_sds_write(ctrl, 5, 1, 14, 0xf002);
|
||||
rtpcs_sds_write(ctrl, 5, 2, 27, 0x4bf);
|
||||
|
||||
rtpcs_sds_write(ctrl, 5, 1, 9, 0x8e64);
|
||||
rtpcs_sds_write(ctrl, 5, 1, 9, 0x8c64);
|
||||
}
|
||||
|
||||
static void rtpcs_838x_sds_reset(struct rtpcs_ctrl *ctrl, u32 sds)
|
||||
{
|
||||
rtpcs_sds_write_bits(ctrl, sds, 2, 0, 11, 11, 0x0); /* FIB_REG0 CFG_FIB_PDOWN */
|
||||
|
||||
/* analog reset */
|
||||
rtpcs_sds_write_bits(ctrl, sds, 0, 0, 1, 0, 0x0); /* REG0 EN_RX/EN_TX */
|
||||
rtpcs_sds_write_bits(ctrl, sds, 0, 0, 1, 0, 0x3); /* REG0 EN_RX/EN_TX */
|
||||
|
||||
/* digital reset */
|
||||
rtpcs_sds_write_bits(ctrl, sds, 0, 3, 6, 6, 0x1); /* REG3 SOFT_RST */
|
||||
rtpcs_sds_write_bits(ctrl, sds, 0, 3, 6, 6, 0x0); /* REG3 SOFT_RST */
|
||||
|
||||
dev_info(ctrl->dev, "SerDes %d reset\n", sds);
|
||||
}
|
||||
|
||||
static bool rtpcs_838x_sds_is_mode_supported(u32 sds, phy_interface_t mode)
|
||||
{
|
||||
switch (sds) {
|
||||
case 0 ... 3:
|
||||
return mode == PHY_INTERFACE_MODE_QSGMII;
|
||||
case 4:
|
||||
return mode == PHY_INTERFACE_MODE_QSGMII ||
|
||||
mode == PHY_INTERFACE_MODE_SGMII ||
|
||||
mode == PHY_INTERFACE_MODE_1000BASEX;
|
||||
case 5:
|
||||
return mode == PHY_INTERFACE_MODE_SGMII ||
|
||||
mode == PHY_INTERFACE_MODE_1000BASEX;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static int rtpcs_838x_sds_power(struct rtpcs_ctrl *ctrl, u32 sds, bool power_on)
|
||||
{
|
||||
u8 val = power_on ? 0 : BIT(sds);
|
||||
int ret;
|
||||
|
||||
ret = regmap_write_bits(ctrl->map, RTPCS_838X_SDS_CFG_REG, BIT(sds), val);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (sds >= 4)
|
||||
ret = regmap_write_bits(ctrl->map, RTPCS_838X_SDS_CFG_REG,
|
||||
BIT(sds) << 2, val << 2); /* SDS*_PHY_MODE */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int rtpcs_838x_sds_set_mode(struct rtpcs_ctrl *ctrl, u32 sds,
|
||||
phy_interface_t mode)
|
||||
{
|
||||
u8 sds_mode_shift, int_mode_shift;
|
||||
u32 sds_mode_val, int_mode_val;
|
||||
|
||||
switch (mode) {
|
||||
case PHY_INTERFACE_MODE_1000BASEX:
|
||||
sds_mode_val = 0x4;
|
||||
int_mode_val = 0x1;
|
||||
break;
|
||||
case PHY_INTERFACE_MODE_SGMII:
|
||||
sds_mode_val = 0x2;
|
||||
int_mode_val = 0x2;
|
||||
break;
|
||||
case PHY_INTERFACE_MODE_QSGMII:
|
||||
sds_mode_val = 0x6;
|
||||
int_mode_val = 0x5;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Configure SerDes module mode (all SDS 0-5) */
|
||||
sds_mode_shift = (5 - sds) * 5;
|
||||
regmap_write_bits(ctrl->map, RTPCS_838X_SDS_MODE_SEL,
|
||||
0x1f << sds_mode_shift, sds_mode_val << sds_mode_shift);
|
||||
|
||||
/* Configure MAC interface mode (only SDS 4-5) */
|
||||
if (sds >= 4) {
|
||||
int_mode_shift = (sds == 5) ? 3 : 0;
|
||||
regmap_write_bits(ctrl->map, RTPCS_838X_INT_MODE_CTRL,
|
||||
0x7 << int_mode_shift, int_mode_val << int_mode_shift);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtpcs_838x_sds_patch(struct rtpcs_ctrl *ctrl, u32 sds,
|
||||
phy_interface_t mode)
|
||||
{
|
||||
rtpcs_sds_write(ctrl, sds, 0, 1, 0xf00);
|
||||
mdelay(1);
|
||||
rtpcs_sds_write(ctrl, sds, 0, 2, 0x7060);
|
||||
mdelay(1);
|
||||
|
||||
if (sds >= 4) {
|
||||
rtpcs_sds_write(ctrl, sds, 2, 30, 0x71e);
|
||||
mdelay(1);
|
||||
rtpcs_sds_write(ctrl, sds, 0, 4, 0x74d);
|
||||
mdelay(1);
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
case PHY_INTERFACE_MODE_1000BASEX:
|
||||
if (sds == 4)
|
||||
rtpcs_838x_sds_patch_4_fiber_6275b(ctrl);
|
||||
else if (sds == 5)
|
||||
rtpcs_838x_sds_patch_5_fiber_6275b(ctrl);
|
||||
|
||||
break;
|
||||
case PHY_INTERFACE_MODE_QSGMII:
|
||||
if (sds == 0 || sds == 1)
|
||||
rtpcs_838x_sds_patch_01_qsgmii_6275b(ctrl);
|
||||
else if (sds == 2 || sds == 3)
|
||||
rtpcs_838x_sds_patch_23_qsgmii_6275b(ctrl);
|
||||
else if (sds == 4)
|
||||
rtpcs_838x_sds_patch_4_qsgmii_6275b(ctrl);
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtpcs_838x_init_serdes_common(struct rtpcs_ctrl *ctrl)
|
||||
{
|
||||
u32 val;
|
||||
|
||||
dev_dbg(ctrl->dev, "Init RTL838X SerDes common\n");
|
||||
|
||||
/* enable R/W of some protected registers */
|
||||
regmap_write(ctrl->map, RTPCS_838X_INT_RW_CTRL, 0x3);
|
||||
|
||||
regmap_read(ctrl->map, RTPCS_838X_PLL_CML_CTRL, &val);
|
||||
dev_dbg(ctrl->dev, "PLL control register: %x\n", val);
|
||||
regmap_write_bits(ctrl->map, RTPCS_838X_PLL_CML_CTRL, 0xfffffff0,
|
||||
0xaaaaaaaf & 0xf);
|
||||
|
||||
/* power off and reset all SerDes */
|
||||
regmap_write(ctrl->map, RTPCS_838X_SDS_CFG_REG, 0x3f);
|
||||
regmap_write(ctrl->map, RTPCS_838X_RST_GLB_CTRL_0, 0x10); /* SW_SERDES_RST */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtpcs_838x_setup_serdes(struct rtpcs_ctrl *ctrl, int sds,
|
||||
phy_interface_t mode)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (sds > 5)
|
||||
return -EINVAL;
|
||||
if (!rtpcs_838x_sds_is_mode_supported(sds, mode))
|
||||
return -EINVAL;
|
||||
|
||||
rtpcs_838x_sds_power(ctrl, sds, false);
|
||||
|
||||
/* take reset */
|
||||
rtpcs_sds_write(ctrl, sds, 0x0, 0x0, 0xc00);
|
||||
rtpcs_sds_write(ctrl, sds, 0x0, 0x3, 0x7146);
|
||||
|
||||
ret = rtpcs_838x_sds_set_mode(ctrl, sds, mode);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
rtpcs_838x_sds_patch(ctrl, sds, mode);
|
||||
rtpcs_838x_sds_reset(ctrl, sds);
|
||||
|
||||
/* release reset */
|
||||
rtpcs_sds_write(ctrl, sds, 0, 3, 0x7106);
|
||||
|
||||
rtpcs_838x_sds_power(ctrl, sds, true);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* RTL930X */
|
||||
|
||||
/* The access registers for SDS_MODE_SEL and the LSB for each SDS within */
|
||||
@ -2769,6 +3059,12 @@ static int rtpcs_probe(struct platform_device *pdev)
|
||||
ctrl->tx_pol_inv[sds] = of_property_read_bool(child, "realtek,pnswap-tx");
|
||||
}
|
||||
|
||||
if (ctrl->cfg->init_serdes_common) {
|
||||
ret = ctrl->cfg->init_serdes_common(ctrl);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* rtpcs_create() relies on that fact that data is attached to the platform device to
|
||||
* determine if the driver is ready. Do this after everything is initialized properly.
|
||||
@ -2803,6 +3099,8 @@ static const struct rtpcs_config rtpcs_838x_cfg = {
|
||||
.mac_rx_pause_sts = RTPCS_838X_MAC_RX_PAUSE_STS,
|
||||
.mac_tx_pause_sts = RTPCS_838X_MAC_TX_PAUSE_STS,
|
||||
.pcs_ops = &rtpcs_838x_pcs_ops,
|
||||
.init_serdes_common = rtpcs_838x_init_serdes_common,
|
||||
.setup_serdes = rtpcs_838x_setup_serdes,
|
||||
};
|
||||
|
||||
static const struct phylink_pcs_ops rtpcs_839x_pcs_ops = {
|
||||
|
||||
@ -143,23 +143,6 @@ static void rtl8380_phy_reset(struct phy_device *phydev)
|
||||
phy_modify(phydev, 0, BMCR_RESET, BMCR_RESET);
|
||||
}
|
||||
|
||||
/* Read the link and speed status of the 2 internal SGMII/1000Base-X
|
||||
* ports of the RTL838x SoCs
|
||||
*/
|
||||
static int rtl8380_read_status(struct phy_device *phydev)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = genphy_read_status(phydev);
|
||||
|
||||
if (phydev->link) {
|
||||
phydev->speed = SPEED_1000;
|
||||
phydev->duplex = DUPLEX_FULL;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Read the link and speed status of the 2 internal SGMII/1000Base-X
|
||||
* ports of the RTL8393 SoC
|
||||
*/
|
||||
@ -807,127 +790,6 @@ static int rtl8380_configure_rtl8214fc(struct phy_device *phydev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtl8380_configure_serdes(struct phy_device *phydev)
|
||||
{
|
||||
u32 v;
|
||||
u32 sds_conf_value;
|
||||
int i;
|
||||
struct fw_header *h;
|
||||
u32 *rtl8380_sds_take_reset;
|
||||
u32 *rtl8380_sds_common;
|
||||
u32 *rtl8380_sds01_qsgmii_6275b;
|
||||
u32 *rtl8380_sds23_qsgmii_6275b;
|
||||
u32 *rtl8380_sds4_fiber_6275b;
|
||||
u32 *rtl8380_sds5_fiber_6275b;
|
||||
u32 *rtl8380_sds_reset;
|
||||
u32 *rtl8380_sds_release_reset;
|
||||
|
||||
phydev_info(phydev, "Detected internal RTL8380 SERDES\n");
|
||||
|
||||
h = rtl838x_request_fw(phydev, &rtl838x_8218b_fw, FIRMWARE_838X_8380_1);
|
||||
if (!h)
|
||||
return -1;
|
||||
|
||||
if (h->magic != 0x83808380) {
|
||||
phydev_err(phydev, "Wrong firmware file: magic number mismatch.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
rtl8380_sds_take_reset = (void *)h + sizeof(struct fw_header) + h->parts[0].start;
|
||||
|
||||
rtl8380_sds_common = (void *)h + sizeof(struct fw_header) + h->parts[1].start;
|
||||
|
||||
rtl8380_sds01_qsgmii_6275b = (void *)h + sizeof(struct fw_header) + h->parts[2].start;
|
||||
|
||||
rtl8380_sds23_qsgmii_6275b = (void *)h + sizeof(struct fw_header) + h->parts[3].start;
|
||||
|
||||
rtl8380_sds4_fiber_6275b = (void *)h + sizeof(struct fw_header) + h->parts[4].start;
|
||||
|
||||
rtl8380_sds5_fiber_6275b = (void *)h + sizeof(struct fw_header) + h->parts[5].start;
|
||||
|
||||
rtl8380_sds_reset = (void *)h + sizeof(struct fw_header) + h->parts[6].start;
|
||||
|
||||
rtl8380_sds_release_reset = (void *)h + sizeof(struct fw_header) + h->parts[7].start;
|
||||
|
||||
/* Back up serdes power off value */
|
||||
sds_conf_value = sw_r32(RTL838X_SDS_CFG_REG);
|
||||
pr_info("SDS power down value: %x\n", sds_conf_value);
|
||||
|
||||
/* take serdes into reset */
|
||||
i = 0;
|
||||
while (rtl8380_sds_take_reset[2 * i]) {
|
||||
sw_w32(rtl8380_sds_take_reset[2 * i + 1], rtl8380_sds_take_reset[2 * i]);
|
||||
i++;
|
||||
udelay(1000);
|
||||
}
|
||||
|
||||
/* apply common serdes patch */
|
||||
i = 0;
|
||||
while (rtl8380_sds_common[2 * i]) {
|
||||
sw_w32(rtl8380_sds_common[2 * i + 1], rtl8380_sds_common[2 * i]);
|
||||
i++;
|
||||
udelay(1000);
|
||||
}
|
||||
|
||||
/* internal R/W enable */
|
||||
sw_w32(3, RTL838X_INT_RW_CTRL);
|
||||
|
||||
/* SerDes ports 4 and 5 are FIBRE ports */
|
||||
sw_w32_mask(0x7 | 0x38, 1 | (1 << 3), RTL838X_INT_MODE_CTRL);
|
||||
|
||||
/* SerDes module settings, SerDes 0-3 are QSGMII */
|
||||
v = 0x6 << 25 | 0x6 << 20 | 0x6 << 15 | 0x6 << 10;
|
||||
/* SerDes 4 and 5 are 1000BX FIBRE */
|
||||
v |= 0x4 << 5 | 0x4;
|
||||
sw_w32(v, RTL838X_SDS_MODE_SEL);
|
||||
|
||||
pr_info("PLL control register: %x\n", sw_r32(RTL838X_PLL_CML_CTRL));
|
||||
sw_w32_mask(0xfffffff0, 0xaaaaaaaf & 0xf, RTL838X_PLL_CML_CTRL);
|
||||
i = 0;
|
||||
while (rtl8380_sds01_qsgmii_6275b[2 * i]) {
|
||||
sw_w32(rtl8380_sds01_qsgmii_6275b[2 * i + 1],
|
||||
rtl8380_sds01_qsgmii_6275b[2 * i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
while (rtl8380_sds23_qsgmii_6275b[2 * i]) {
|
||||
sw_w32(rtl8380_sds23_qsgmii_6275b[2 * i + 1], rtl8380_sds23_qsgmii_6275b[2 * i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
while (rtl8380_sds4_fiber_6275b[2 * i]) {
|
||||
sw_w32(rtl8380_sds4_fiber_6275b[2 * i + 1], rtl8380_sds4_fiber_6275b[2 * i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
while (rtl8380_sds5_fiber_6275b[2 * i]) {
|
||||
sw_w32(rtl8380_sds5_fiber_6275b[2 * i + 1], rtl8380_sds5_fiber_6275b[2 * i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
while (rtl8380_sds_reset[2 * i]) {
|
||||
sw_w32(rtl8380_sds_reset[2 * i + 1], rtl8380_sds_reset[2 * i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
while (rtl8380_sds_release_reset[2 * i]) {
|
||||
sw_w32(rtl8380_sds_release_reset[2 * i + 1], rtl8380_sds_release_reset[2 * i]);
|
||||
i++;
|
||||
}
|
||||
|
||||
pr_info("SDS power down value now: %x\n", sw_r32(RTL838X_SDS_CFG_REG));
|
||||
sw_w32(sds_conf_value, RTL838X_SDS_CFG_REG);
|
||||
|
||||
pr_info("Configuration of SERDES done\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtl8390_configure_serdes(struct phy_device *phydev)
|
||||
{
|
||||
phydev_info(phydev, "Detected internal RTL8390 SERDES\n");
|
||||
@ -1098,25 +960,6 @@ static int rtl8218b_config_init(struct phy_device *phydev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtl838x_serdes_probe(struct phy_device *phydev)
|
||||
{
|
||||
int addr = phydev->mdio.addr;
|
||||
|
||||
if (soc_info.family != RTL8380_FAMILY_ID)
|
||||
return -ENODEV;
|
||||
if (addr < 24)
|
||||
return -ENODEV;
|
||||
|
||||
/* On the RTL8380M, PHYs 24-27 connect to the internal SerDes */
|
||||
if (soc_info.id == 0x8380) {
|
||||
if (addr == 24)
|
||||
return rtl8380_configure_serdes(phydev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int rtl8393_serdes_probe(struct phy_device *phydev)
|
||||
{
|
||||
int addr = phydev->mdio.addr;
|
||||
@ -1224,17 +1067,6 @@ static struct phy_driver rtl83xx_phy_driver[] = {
|
||||
.write_mmd = rtl821x_write_mmd,
|
||||
.write_page = rtl821x_write_page,
|
||||
},
|
||||
{
|
||||
PHY_ID_MATCH_MODEL(PHY_ID_RTL8218B_I),
|
||||
.name = "Realtek RTL8380 SERDES",
|
||||
.features = PHY_GBIT_FIBRE_FEATURES,
|
||||
.probe = rtl838x_serdes_probe,
|
||||
.read_page = rtl821x_read_page,
|
||||
.write_page = rtl821x_write_page,
|
||||
.suspend = genphy_suspend,
|
||||
.resume = genphy_resume,
|
||||
.read_status = rtl8380_read_status,
|
||||
},
|
||||
{
|
||||
PHY_ID_MATCH_MODEL(PHY_ID_RTL8393_I),
|
||||
.name = "Realtek RTL8393 SERDES",
|
||||
|
||||
@ -35,19 +35,6 @@ struct __packed fw_header {
|
||||
#define PHY_IS_RTL8214FB 2
|
||||
#define PHY_IS_RTL8218B_E 3
|
||||
|
||||
/* Registers of the internal Serdes of the 8380 */
|
||||
#define RTL838X_SDS_MODE_SEL (0x0028)
|
||||
#define RTL838X_SDS_CFG_REG (0x0034)
|
||||
#define RTL838X_INT_MODE_CTRL (0x005c)
|
||||
#define RTL838X_DMY_REG31 (0x3b28)
|
||||
|
||||
#define RTL8380_SDS4_FIB_REG0 (0xF800)
|
||||
#define RTL838X_SDS4_REG28 (0xef80)
|
||||
#define RTL838X_SDS4_DUMMY0 (0xef8c)
|
||||
#define RTL838X_SDS5_EXT_REG6 (0xf18c)
|
||||
#define RTL838X_SDS4_FIB_REG0 (RTL838X_SDS4_REG28 + 0x880)
|
||||
#define RTL838X_SDS5_FIB_REG0 (RTL838X_SDS4_REG28 + 0x980)
|
||||
|
||||
/* Registers of the internal SerDes of the RTL8390 */
|
||||
#define RTL839X_SDS12_13_XSG0 (0xB800)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user