diff --git a/include/image.mk b/include/image.mk index 9736e4e1642..4ebff2e9ae0 100644 --- a/include/image.mk +++ b/include/image.mk @@ -40,8 +40,10 @@ IMG_PREFIX_VERCODE:=$(if $(CONFIG_VERSION_CODE_FILENAMES),$(call sanitize,$(VERS IMG_PREFIX:=$(VERSION_DIST_SANITIZED)-$(IMG_PREFIX_VERNUM)$(IMG_PREFIX_VERCODE)$(IMG_PREFIX_EXTRA)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET)) IMG_ROOTFS:=$(IMG_PREFIX)-rootfs IMG_COMBINED:=$(IMG_PREFIX)-combined +ifeq ($(DUMP),) IMG_PART_SIGNATURE:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | $(MKHASH) md5 | cut -b1-8) IMG_PART_DISKGUID:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | $(MKHASH) md5 | sed -E 's/(.{8})(.{4})(.{4})(.{4})(.{10})../\1-\2-\3-\4-\500/') +endif MKFS_DEVTABLE_OPT := -D $(INCLUDE_DIR)/device_table.txt @@ -167,7 +169,9 @@ define Image/pad-to mv $(1).new $(1) endef +ifeq ($(DUMP),) ROOTFS_PARTSIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024*1024))) +endif define Image/pad-root-squashfs $(call Image/pad-to,$(KDIR)/root.squashfs,$(if $(1),$(1),$(ROOTFS_PARTSIZE))) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 2378f5ad90c..49340ce3e44 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -182,7 +182,6 @@ $(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \ perl --version | grep "perl.*v5")) $(eval $(call SetupHostCommand,python,Please install Python >= 3.7, \ - python3.12 -V 2>&1 | grep 'Python 3', \ python3.11 -V 2>&1 | grep 'Python 3', \ python3.10 -V 2>&1 | grep 'Python 3', \ python3.9 -V 2>&1 | grep 'Python 3', \ @@ -191,7 +190,6 @@ $(eval $(call SetupHostCommand,python,Please install Python >= 3.7, \ python3 -V 2>&1 | grep -E 'Python 3\.([7-9]|[0-9][0-9])\.?')) $(eval $(call SetupHostCommand,python3,Please install Python >= 3.7, \ - python3.12 -V 2>&1 | grep 'Python 3', \ python3.11 -V 2>&1 | grep 'Python 3', \ python3.10 -V 2>&1 | grep 'Python 3', \ python3.9 -V 2>&1 | grep 'Python 3', \ diff --git a/include/scan.mk b/include/scan.mk index 33a5832ff5f..2e0ee0c9609 100644 --- a/include/scan.mk +++ b/include/scan.mk @@ -50,7 +50,8 @@ define PackageDir $$(call progress,Collecting $(SCAN_NAME) info: $(SCAN_DIR)/$(2)) \ echo Source-Makefile: $(SCAN_DIR)/$(2)/Makefile; \ $(if $(3),echo Override: $(3),true); \ - $(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 FEED="$(call feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) 2>/dev/null || { \ + $(if $(findstring c,$(OPENWRT_VERBOSE)),$(MAKE),$(NO_TRACE_MAKE) --no-print-dir) -r DUMP=1 FEED="$(call feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) \ + $(if $(findstring c,$(OPENWRT_VERBOSE)),,2>/dev/null) || { \ mkdir -p "$(TOPDIR)/logs/$(SCAN_DIR)/$(2)"; \ $(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 FEED="$(call feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) > $(TOPDIR)/logs/$(SCAN_DIR)/$(2)/dump.txt 2>&1; \ $$(call progress,ERROR: please fix $(SCAN_DIR)/$(2)/Makefile - see logs/$(SCAN_DIR)/$(2)/dump.txt for details\n) \ diff --git a/include/u-boot.mk b/include/u-boot.mk index 8b96f38e780..5969873af48 100644 --- a/include/u-boot.mk +++ b/include/u-boot.mk @@ -18,7 +18,7 @@ PKG_FLAGS:=nonshared PKG_LICENSE:=GPL-2.0 GPL-2.0+ PKG_LICENSE_FILES:=Licenses/README -PKG_BUILD_PARALLEL:=1 +PKG_BUILD_PARALLEL ?= 1 ifdef UBOOT_USE_BINMAN $(eval $(call TestHostCommand,python3-pyelftools, \ diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh index 827cb5dc2ea..9b5e5accdca 100755 --- a/package/base-files/files/bin/ipcalc.sh +++ b/package/base-files/files/bin/ipcalc.sh @@ -34,19 +34,19 @@ function compl32(v) { BEGIN { slpos=index(ARGV[1],"/") - if (slpos == 0) { - ipaddr=ip2int(ARGV[1]) - dotpos=index(ARGV[2],".") - if (dotpos == 0) - netmask=compl32(2**(32-int(ARGV[2]))-1) - else - netmask=ip2int(ARGV[2]) - } else { - ipaddr=ip2int(substr(ARGV[1],0,slpos-1)) - netmask=compl32(2**(32-int(substr(ARGV[1],slpos+1)))-1) + if (slpos != 0) { + # rearrange arguments to not use compound notation ARGV[4]=ARGV[3] ARGV[3]=ARGV[2] + ARGV[2]=substr(ARGV[1],slpos+1) + ARGV[1]=substr(ARGV[1],0,slpos-1) } + ipaddr=ip2int(ARGV[1]) + dotpos=index(ARGV[2],".") + if (dotpos == 0) + netmask=compl32(2**(32-int(ARGV[2]))-1) + else + netmask=ip2int(ARGV[2]) network=and(ipaddr,netmask) prefix=32-bitcount(compl32(netmask)) diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index bbcafaf5e98..f1497acc364 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -95,6 +95,7 @@ xiaomi,redmi-router-ax6000-stock) ;; h3c,magic-nx30-pro|\ h3c,magic-nx30-pro-nmbm|\ +jcg,q30|\ qihoo,360t7|\ tplink,tl-xdr4288|\ tplink,tl-xdr6086|\ diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-envtools/files/mvebu index 63b5132608a..c4ce76cf240 100644 --- a/package/boot/uboot-envtools/files/mvebu +++ b/package/boot/uboot-envtools/files/mvebu @@ -68,6 +68,10 @@ methode,edpu) ubootenv_add_uci_config "/dev/mtd0" "0x180000" "0x10000" "0x10000" fi ;; +synology,ds213j) + idx="$(find_mtd_index u-boot-env)" + [ -n "$idx" ] && ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x10000" + ;; esac config_load ubootenv diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index f049e1cbe1e..db403611be5 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -236,6 +236,18 @@ define U-Boot/mt7981_h3c_magic-nx30-pro DEPENDS:=+trusted-firmware-a-mt7981-spim-nand-ddr3 endef +define U-Boot/mt7981_jcg_q30 + NAME:=JCG Q30 + BUILD_SUBTARGET:=filogic + BUILD_DEVICES:=jcg_q30 + UBOOT_CONFIG:=mt7981_jcg_q30 + 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_rfb-spim-nand NAME:=MT7981 Reference Board BUILD_SUBTARGET:=filogic @@ -547,6 +559,7 @@ UBOOT_TARGETS := \ mt7981_cmcc_rax3000m-emmc \ mt7981_cmcc_rax3000m-nand \ mt7981_h3c_magic-nx30-pro \ + mt7981_jcg_q30 \ mt7981_rfb-spim-nand \ mt7981_rfb-emmc \ mt7981_rfb-nor \ diff --git a/package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch b/package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch index 507a7dd04e8..d499b0dcc67 100644 --- a/package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch +++ b/package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch @@ -870,7 +870,7 @@ +ubi_init_emmc_install=run sdmmc_read_emmc_install && run ubi_write_emmc_install +ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi +ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data -+ubi_write_emmc_install=ubi check emmc_install && ubi remote emmc_install ; ubi create emmc_install 0x800000 dynamic ; ubi write $loadaddr emmc_install 0x800000 ++ubi_write_emmc_install=ubi check emmc_install && ubi remove emmc_install ; ubi create emmc_install 0x800000 dynamic ; ubi write $loadaddr emmc_install 0x800000 +ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic 2 && ubi write $loadaddr fit $filesize +ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic 3 && ubi write $loadaddr recovery $filesize +_init_env=setenv _init_env ; setenv _create_env ; saveenv ; saveenv diff --git a/package/boot/uboot-mediatek/patches/438-add-jcg_q30.patch b/package/boot/uboot-mediatek/patches/438-add-jcg_q30.patch new file mode 100644 index 00000000000..0779c6b175a --- /dev/null +++ b/package/boot/uboot-mediatek/patches/438-add-jcg_q30.patch @@ -0,0 +1,420 @@ +--- /dev/null ++++ b/configs/mt7981_jcg_q30_defconfig +@@ -0,0 +1,175 @@ ++CONFIG_ARM=y ++CONFIG_POSITION_INDEPENDENT=y ++CONFIG_ARCH_MEDIATEK=y ++CONFIG_TARGET_MT7981=y ++CONFIG_TEXT_BASE=0x41e00000 ++CONFIG_SYS_MALLOC_F_LEN=0x4000 ++CONFIG_SYS_HAS_NONCACHED_MEMORY=y ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_DEFAULT_DEVICE_TREE="mt7981_jcg_q30" ++CONFIG_DEFAULT_ENV_FILE="jcg_q30_env" ++CONFIG_DEFAULT_FDT_FILE="mediatek/mt7981_jcg_q30.dtb" ++CONFIG_OF_LIBFDT_OVERLAY=y ++CONFIG_DEBUG_UART_BASE=0x11002000 ++CONFIG_DEBUG_UART_CLOCK=40000000 ++CONFIG_DEBUG_UART=y ++CONFIG_SYS_LOAD_ADDR=0x46000000 ++CONFIG_SMBIOS_PRODUCT_NAME="" ++CONFIG_AUTOBOOT_KEYED=y ++CONFIG_BOOTDELAY=30 ++CONFIG_AUTOBOOT_MENU_SHOW=y ++CONFIG_CFB_CONSOLE_ANSI=y ++CONFIG_BOARD_LATE_INIT=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_GPIO=y ++CONFIG_LOGLEVEL=7 ++CONFIG_LOG=y ++CONFIG_SYS_PROMPT="MT7981> " ++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_DM=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_ECHO=y ++CONFIG_CMD_ENV_READMEM=y ++CONFIG_CMD_ERASEENV=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FAT=y ++CONFIG_CMD_FDT=y ++CONFIG_CMD_FS_GENERIC=y ++CONFIG_CMD_FS_UUID=y ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_HASH=y ++CONFIG_CMD_ITEST=y ++CONFIG_CMD_LED=y ++CONFIG_CMD_LICENSE=y ++CONFIG_CMD_LINK_LOCAL=y ++# CONFIG_CMD_MBR is not set ++CONFIG_CMD_PCI=y ++CONFIG_CMD_PSTORE=y ++CONFIG_CMD_PSTORE_MEM_ADDR=0x42ff0000 ++CONFIG_CMD_SF_TEST=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_PXE=y ++CONFIG_CMD_PWM=y ++CONFIG_CMD_SMC=y ++CONFIG_CMD_TFTPBOOT=y ++CONFIG_CMD_TFTPSRV=y ++CONFIG_CMD_UBI=y ++CONFIG_CMD_UBI_RENAME=y ++CONFIG_CMD_UBIFS=y ++CONFIG_CMD_ASKENV=y ++CONFIG_CMD_PART=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_DISPLAY_CPUINFO=y ++CONFIG_DM_MTD=y ++CONFIG_DM_REGULATOR=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_DM_REGULATOR_GPIO=y ++CONFIG_DM_PWM=y ++CONFIG_PWM_MTK=y ++CONFIG_HUSH_PARSER=y ++CONFIG_SYS_REDUNDAND_ENVIRONMENT=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_VERSION_VARIABLE=y ++CONFIG_PARTITION_UUIDS=y ++CONFIG_NETCONSOLE=y ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_CLK=y ++CONFIG_DM_GPIO=y ++CONFIG_DM_SCSI=y ++CONFIG_AHCI=y ++CONFIG_AHCI_PCI=y ++CONFIG_SCSI_AHCI=y ++CONFIG_SCSI=y ++CONFIG_CMD_SCSI=y ++CONFIG_PHY=y ++CONFIG_PHY_MTK_TPHY=y ++CONFIG_PHY_FIXED=y ++CONFIG_MTK_AHCI=y ++CONFIG_DM_ETH=y ++CONFIG_MEDIATEK_ETH=y ++CONFIG_PCI=y ++# CONFIG_MMC is not set ++# CONFIG_DM_MMC is not set ++CONFIG_MTD=y ++CONFIG_MTD_UBI_FASTMAP=y ++CONFIG_DM_PCI=y ++CONFIG_PCIE_MEDIATEK=y ++CONFIG_PINCTRL=y ++CONFIG_PINCONF=y ++CONFIG_PINCTRL_MT7622=y ++CONFIG_POWER_DOMAIN=y ++CONFIG_PRE_CONSOLE_BUFFER=y ++CONFIG_PRE_CON_BUF_ADDR=0x4007EF00 ++CONFIG_MTK_POWER_DOMAIN=y ++CONFIG_RAM=y ++CONFIG_DM_SERIAL=y ++CONFIG_MTK_SERIAL=y ++CONFIG_SPI=y ++CONFIG_DM_SPI=y ++CONFIG_MTK_SPI_NAND=y ++CONFIG_MTK_SPI_NAND_MTD=y ++CONFIG_SYSRESET_WATCHDOG=y ++CONFIG_WDT_MTK=y ++CONFIG_LZO=y ++CONFIG_ZSTD=y ++CONFIG_HEXDUMP=y ++CONFIG_RANDOM_UUID=y ++CONFIG_REGEX=y ++CONFIG_OF_EMBED=y ++CONFIG_ENV_OVERWRITE=y ++CONFIG_ENV_IS_IN_UBI=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_VARS_UBOOT_RUNTIME_CONFIG=y ++CONFIG_NET_RANDOM_ETHADDR=y ++CONFIG_REGMAP=y ++CONFIG_SYSCON=y ++CONFIG_CLK=y ++CONFIG_PHY_FIXED=y ++CONFIG_DM_ETH=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_REGULATOR=y ++CONFIG_DM_REGULATOR_FIXED=y ++CONFIG_DM_SERIAL=y ++CONFIG_MTK_SERIAL=y ++CONFIG_HEXDUMP=y ++CONFIG_USE_DEFAULT_ENV_FILE=y ++CONFIG_MTD_SPI_NAND=y ++CONFIG_MTK_SPIM=y ++CONFIG_CMD_MTD=y ++CONFIG_CMD_NAND=y ++CONFIG_CMD_NAND_TRIMFFS=y ++CONFIG_LMB_MAX_REGIONS=64 ++CONFIG_USE_IPADDR=y ++CONFIG_IPADDR="192.168.1.1" ++CONFIG_USE_SERVERIP=y ++CONFIG_SERVERIP="192.168.1.254" +--- /dev/null ++++ b/arch/arm/dts/mt7981_jcg_q30.dts +@@ -0,0 +1,179 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Copyright (c) 2022 MediaTek Inc. ++ * Author: Sam Shih ++ */ ++ ++/dts-v1/; ++#include "mt7981.dtsi" ++#include ++#include ++ ++/ { ++ #address-cells = <1>; ++ #size-cells = <1>; ++ model = "JCG Q30"; ++ compatible = "mediatek,mt7981", "mediatek,mt7981-rfb"; ++ ++ chosen { ++ stdout-path = &uart0; ++ tick-timer = &timer0; ++ }; ++ ++ memory@40000000 { ++ device_type = "memory"; ++ reg = <0x40000000 0x10000000>; ++ }; ++ ++ keys { ++ compatible = "gpio-keys"; ++ ++ factory { ++ label = "reset"; ++ linux,code = ; ++ gpios = <&gpio 1 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ status_red { ++ label = "red:status"; ++ gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ status_blue { ++ label = "blue:status"; ++ gpios = <&gpio 13 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&uart0 { ++ mediatek,force-highspeed; ++ status = "okay"; ++}; ++ ++&uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart1_pins>; ++ status = "disabled"; ++}; ++ ++ð { ++ status = "okay"; ++ mediatek,gmac-id = <0>; ++ phy-mode = "2500base-x"; ++ mediatek,switch = "mt7531"; ++ reset-gpios = <&gpio 39 GPIO_ACTIVE_HIGH>; ++ ++ fixed-link { ++ speed = <2500>; ++ full-duplex; ++ }; ++}; ++ ++&pinctrl { ++ 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 = ; ++ bias-pull-up = ; ++ }; ++ ++ conf-pd { ++ pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; ++ drive-strength = ; ++ bias-pull-down = ; ++ }; ++ }; ++ ++ spic_pins: spi1-pins-func-1 { ++ mux { ++ function = "spi"; ++ groups = "spi1_1"; ++ }; ++ }; ++ ++ uart1_pins: spi1-pins-func-3 { ++ mux { ++ function = "uart"; ++ groups = "uart1_2"; ++ }; ++ }; ++ ++ pwm_pins: pwm0-pins-func-1 { ++ mux { ++ function = "pwm"; ++ groups = "pwm0_1", "pwm1_0"; ++ }; ++ }; ++}; ++ ++&pwm { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm_pins>; ++ status = "okay"; ++}; ++ ++&spi0 { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi_flash_pins>; ++ status = "okay"; ++ must_tx; ++ enhance_timing; ++ dma_ext; ++ ipm_design; ++ support_quad; ++ tick_dly = <2>; ++ sample_sel = <0>; ++ ++ spi_nand@0 { ++ compatible = "spi-nand"; ++ reg = <0>; ++ spi-max-frequency = <52000000>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ label = "bl2"; ++ reg = <0x0 0x100000>; ++ }; ++ ++ partition@100000 { ++ label = "orig-env"; ++ reg = <0x100000 0x80000>; ++ }; ++ ++ partition@160000 { ++ label = "factory"; ++ reg = <0x180000 0x200000>; ++ }; ++ ++ partition@380000 { ++ label = "fip"; ++ reg = <0x380000 0x200000>; ++ }; ++ ++ partition@580000 { ++ label = "ubi"; ++ reg = <0x580000 0x7000000>; ++ }; ++ }; ++ }; ++}; ++ ++&watchdog { ++ status = "disabled"; ++}; +--- /dev/null ++++ b/jcg_q30_env +@@ -0,0 +1,57 @@ ++ipaddr=192.168.1.1 ++serverip=192.168.1.254 ++loadaddr=0x46000000 ++console=earlycon=uart8250,mmio32,0x11002000 console=ttyS0 ++bootcmd=if pstore check ; then run boot_recovery ; else run boot_ubi ; fi ++bootconf=config-1 ++bootdelay=0 ++bootfile=immortalwrt-mediatek-filogic-jcg_q30-initramfs-recovery.itb ++bootfile_bl2=immortalwrt-mediatek-filogic-jcg_q30-preloader.bin ++bootfile_fip=immortalwrt-mediatek-filogic-jcg_q30-bl31-uboot.fip ++bootfile_upg=immortalwrt-mediatek-filogic-jcg_q30-squashfs-sysupgrade.itb ++bootled_pwr=blue:status ++bootled_rec=red:status ++bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60 ++bootmenu_default=0 ++bootmenu_delay=0 ++bootmenu_title= ( ( ( OpenWrt ) ) ) ++bootmenu_0=Initialize environment.=run _firstboot ++bootmenu_0d=Run default boot command.=run boot_default ++bootmenu_1=Boot system via TFTP.=run boot_tftp ; run bootmenu_confirm_return ++bootmenu_2=Boot production system from NAND.=run boot_production ; run bootmenu_confirm_return ++bootmenu_3=Boot recovery system from NAND.=run boot_recovery ; run bootmenu_confirm_return ++bootmenu_4=Load production system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_production ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_5=Load recovery system via TFTP then write to NAND.=setenv noboot 1 ; setenv replacevol 1 ; run boot_tftp_recovery ; setenv noboot ; setenv replacevol ; run bootmenu_confirm_return ++bootmenu_6=Load BL31+U-Boot FIP via TFTP then write to NAND.=run boot_tftp_write_fip ; run bootmenu_confirm_return ++bootmenu_7=Load BL2 preloader via TFTP then write to NAND.=run boot_tftp_write_bl2 ; run bootmenu_confirm_return ++bootmenu_8=Reboot.=reset ++bootmenu_9=Reset all settings to factory defaults.=run reset_factory ; reset ++boot_first=if button reset ; then led $bootled_rec on ; run boot_tftp_recovery ; setenv flag_recover 1 ; run boot_default ; fi ; bootmenu ++boot_default=if env exists flag_recover ; then else run bootcmd ; fi ; run boot_recovery ; setenv replacevol 1 ; run boot_tftp_forever ++boot_production=led $bootled_pwr on ; run ubi_read_production && bootm $loadaddr#$bootconf ; led $bootled_pwr off ++boot_recovery=led $bootled_rec on ; run ubi_read_recovery && bootm $loadaddr#$bootconf ; led $bootled_rec off ++boot_ubi=run boot_production ; run boot_recovery ; run boot_tftp_forever ++boot_tftp_forever=led $bootled_rec on ; while true ; do run boot_tftp_recovery ; sleep 1 ; done ++boot_tftp_production=tftpboot $loadaddr $bootfile_upg && env exists replacevol && iminfo $loadaddr && run ubi_write_production ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp_recovery=tftpboot $loadaddr $bootfile && env exists replacevol && iminfo $loadaddr && run ubi_write_recovery ; if env exists noboot ; then else bootm $loadaddr#$bootconf ; fi ++boot_tftp=tftpboot $loadaddr $bootfile && bootm $loadaddr#$bootconf ++boot_tftp_write_fip=tftpboot $loadaddr $bootfile_fip && run mtd_write_fip && run reset_factory ++boot_tftp_write_bl2=tftpboot $loadaddr $bootfile_bl2 && run mtd_write_bl2 ++part_default=production ++part_recovery=recovery ++reset_factory=ubi part ubi ; mw $loadaddr 0x0 0x800 ; ubi write $loadaddr ubootenv 0x800 ; ubi write $loadaddr ubootenv2 0x800 ++mtd_write_fip=mtd erase fip && mtd write fip $loadaddr ++mtd_write_bl2=mtd erase bl2 && mtd write bl2 $loadaddr ++ubi_create_env=ubi check ubootenv || ubi create ubootenv 0x100000 dynamic 0 || run ubi_format ; ubi check ubootenv2 || ubi create ubootenv2 0x100000 dynamic 1 || run ubi_format ++ubi_format=ubi detach ; mtd erase ubi && ubi part ubi ; reset ++ubi_prepare_rootfs=if ubi check rootfs_data ; then else if env exists rootfs_data_max ; then ubi create rootfs_data $rootfs_data_max dynamic || ubi create rootfs_data - dynamic ; else ubi create rootfs_data - dynamic ; fi ; fi ++ubi_read_production=ubi read $loadaddr fit && iminfo $loadaddr && run ubi_prepare_rootfs ++ubi_read_recovery=ubi check recovery && ubi read $loadaddr recovery ++ubi_remove_rootfs=ubi check rootfs_data && ubi remove rootfs_data ++ubi_write_production=ubi check fit && ubi remove fit ; run ubi_remove_rootfs ; ubi create fit $filesize dynamic 2 && ubi write $loadaddr fit $filesize ++ubi_write_recovery=ubi check recovery && ubi remove recovery ; run ubi_remove_rootfs ; ubi create recovery $filesize dynamic 3 && ubi write $loadaddr recovery $filesize ++ethaddr_factory=mtd read factory 0x40080000 0xa0000 0x800 && env readmem -b ethaddr 0x4008002a 0x6 ; setenv ethaddr_factory ++_init_env=setenv _init_env ; run ubi_create_env ; saveenv ; saveenv ++_firstboot=setenv _firstboot ; run ethaddr_factory ; run _switch_to_menu ; run _init_env ; run boot_first ++_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title ++_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile index 20a40eb8bbe..3efbce28f40 100644 --- a/package/devel/gdb/Makefile +++ b/package/devel/gdb/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb PKG_VERSION:=13.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb @@ -58,6 +58,7 @@ CONFIGURE_ARGS+= \ --with-system-zlib \ --without-expat \ --without-lzma \ + --without-zstd \ --disable-unit-tests \ --disable-ubsan \ --disable-sim \ diff --git a/package/emortal/default-settings/files/99-default-settings b/package/emortal/default-settings/files/99-default-settings index 479798a9c52..6f5cf56baac 100755 --- a/package/emortal/default-settings/files/99-default-settings +++ b/package/emortal/default-settings/files/99-default-settings @@ -3,19 +3,23 @@ uci -q get system.@imm_init[0] > "/dev/null" || uci -q add system imm_init > "/dev/null" if ! uci -q get system.@imm_init[0].lang > "/dev/null"; then - uci -q set luci.main.lang="auto" - uci -q commit luci + uci -q batch <<-EOF + set luci.main.lang="auto" + commit luci - uci -q set system.@imm_init[0].lang="1" - uci -q commit system + set system.@imm_init[0].lang="1" + commit system + EOF fi if ! uci -q get system.@imm_init[0].anon_mount > "/dev/null"; then - uci -q set fstab.@global[0].anon_mount="1" - uci -q commit fstab + uci -q batch <<-EOF + set fstab.@global[0].anon_mount="1" + commit fstab - uci -q set system.@imm_init[0].anon_mount="1" - uci -q commit system + set system.@imm_init[0].anon_mount="1" + commit system + EOF fi ln -sf "/sbin/ip" "/usr/bin/ip" diff --git a/package/emortal/default-settings/files/99-default-settings-chinese b/package/emortal/default-settings/files/99-default-settings-chinese index d1e4208533f..d640c6bf023 100755 --- a/package/emortal/default-settings/files/99-default-settings-chinese +++ b/package/emortal/default-settings/files/99-default-settings-chinese @@ -21,8 +21,10 @@ fi opkg_mirror="$(uci -q get system.@imm_init[0].opkg_mirror)" if [ -z "$opkg_mirror" ]; then opkg_mirror="https://mirrors.vsean.net/openwrt" - uci -q set system.@imm_init[0].opkg_mirror="$opkg_mirror" - uci -q commit system + uci -q batch <<-EOF + set system.@imm_init[0].opkg_mirror="$opkg_mirror" + commit system + EOF fi sed -i.bak "s,https://downloads.immortalwrt.org,$opkg_mirror,g" "/etc/opkg/distfeeds.conf" diff --git a/package/emortal/ipv6-helper/files/60-ipv6-hybrid b/package/emortal/ipv6-helper/files/60-ipv6-hybrid index 40efd986f53..72133a3a965 100755 --- a/package/emortal/ipv6-helper/files/60-ipv6-hybrid +++ b/package/emortal/ipv6-helper/files/60-ipv6-hybrid @@ -3,13 +3,15 @@ uci -q get system.@imm_init[0] > "/dev/null" || uci -q add system imm_init > "/dev/null" uci -q get system.@imm_init[0].ipv6 > "/dev/null" && exit 0 -uci -q set dhcp.lan.ra="hybrid" -uci -q set dhcp.lan.ndp="hybrid" -uci -q set dhcp.lan.dhcpv6="hybrid" -uci -q set dhcp.lan.ra_management="1" -uci -q commit dhcp - -uci -q set system.@imm_init[0].ipv6="1" -uci -q commit system +uci -q batch <<-EOF + set dhcp.lan.ra="hybrid" + set dhcp.lan.ndp="hybrid" + set dhcp.lan.dhcpv6="hybrid" + set dhcp.lan.ra_management="1" + commit dhcp + + set system.@imm_init[0].ipv6="1" + commit system +EOF exit 0 diff --git a/package/firmware/linux-firmware/realtek.mk b/package/firmware/linux-firmware/realtek.mk index 6a86f98806d..b4880b6a7f2 100644 --- a/package/firmware/linux-firmware/realtek.mk +++ b/package/firmware/linux-firmware/realtek.mk @@ -86,12 +86,12 @@ define Package/rtl8723bu-firmware/install endef $(eval $(call BuildPackage,rtl8723bu-firmware)) -Package/rtl8723du-firmware = $(call Package/firmware-default,RealTek RTL8723DU firmware) -define Package/rtl8723du-firmware/install +Package/rtl8723de-firmware = $(call Package/firmware-default,RealTek RTL8723DE firmware) +define Package/rtl8723de-firmware/install $(INSTALL_DIR) $(1)/lib/firmware/rtw88 $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8723d_fw.bin $(1)/lib/firmware/rtw88 endef -$(eval $(call BuildPackage,rtl8723du-firmware)) +$(eval $(call BuildPackage,rtl8723de-firmware)) Package/rtl8761a-firmware = $(call Package/firmware-default,RealTek RTL8761A firmware) define Package/rtl8761a-firmware/install @@ -145,3 +145,32 @@ define Package/rtl8822ce-firmware/install $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8822c_wow_fw.bin $(1)/lib/firmware/rtw88 endef $(eval $(call BuildPackage,rtl8822ce-firmware)) + +Package/rtl8851be-firmware = $(call Package/firmware-default,RealTek RTL8851BE firmware) +define Package/rtl8851be-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/rtw89 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw89/rtw8851b_fw.bin $(1)/lib/firmware/rtw89 +endef +$(eval $(call BuildPackage,rtl8851be-firmware)) + +Package/rtl8852ae-firmware = $(call Package/firmware-default,RealTek RTL8852AE firmware) +define Package/rtl8852ae-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/rtw89 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw89/rtw8852a_fw.bin $(1)/lib/firmware/rtw89 +endef +$(eval $(call BuildPackage,rtl8852ae-firmware)) + +Package/rtl8852be-firmware = $(call Package/firmware-default,RealTek RTL8852BE firmware) +define Package/rtl8852be-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/rtw89 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw89/rtw8852b_fw.bin $(1)/lib/firmware/rtw89 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw89/rtw8852b_fw-1.bin $(1)/lib/firmware/rtw89 +endef +$(eval $(call BuildPackage,rtl8852be-firmware)) + +Package/rtl8852ce-firmware = $(call Package/firmware-default,RealTek RTL8852CE firmware) +define Package/rtl8852ce-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/rtw89 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw89/rtw8852c_fw.bin $(1)/lib/firmware/rtw89 +endef +$(eval $(call BuildPackage,rtl8852ce-firmware)) diff --git a/package/kernel/mac80211/realtek.mk b/package/kernel/mac80211/realtek.mk index 48109b94b2a..04057b31069 100644 --- a/package/kernel/mac80211/realtek.mk +++ b/package/kernel/mac80211/realtek.mk @@ -1,8 +1,9 @@ PKG_DRIVERS += \ rtlwifi rtlwifi-pci rtlwifi-btcoexist rtlwifi-usb rtl8192c-common \ rtl8192ce rtl8192se rtl8192de rtl8192cu rtl8723bs rtl8821ae \ - rtl8xxxu rtw88 rtw88-pci rtw88-usb rtw88-8822b rtw88-8822c rtw88-8723d \ - rtw88-8822be rtw88-8822bu rtw88-8822ce rtw88-8723de + rtl8xxxu rtw88 rtw88-pci rtw88-usb rtw88-8821c rtw88-8822b rtw88-8822c \ + rtw88-8723d rtw88-8821ce rtw88-8821cu rtw88-8822be rtw88-8822bu \ + rtw88-8822ce rtw88-8822cu rtw88-8723de config-$(call config_package,rtlwifi) += RTL_CARDS RTLWIFI config-$(call config_package,rtlwifi-pci) += RTLWIFI_PCI @@ -25,11 +26,15 @@ config-y += STAGING config-$(call config_package,rtw88) += RTW88 RTW88_CORE config-$(call config_package,rtw88-pci) += RTW88_PCI config-$(call config_package,rtw88-usb) += RTW88_USB +config-$(call config_package,rtw88-8821c) += RTW88_8821C +config-$(call config_package,rtw88-8821ce) += RTW88_8821CE +config-$(call config_package,rtw88-8821cu) += RTW88_8821CU config-$(call config_package,rtw88-8822b) += RTW88_8822B config-$(call config_package,rtw88-8822be) += RTW88_8822BE config-$(call config_package,rtw88-8822bu) += RTW88_8822BU config-$(call config_package,rtw88-8822c) += RTW88_8822C config-$(call config_package,rtw88-8822ce) += RTW88_8822CE +config-$(call config_package,rtw88-8822cu) += RTW88_8822CU config-$(call config_package,rtw88-8723d) += RTW88_8723D config-$(call config_package,rtw88-8723de) += RTW88_8723DE config-$(CONFIG_PACKAGE_RTW88_DEBUG) += RTW88_DEBUG @@ -196,16 +201,25 @@ endef define KernelPackage/rtw88-usb $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTW88 USB chips support - DEPENDS+= @USB_SUPPORT +kmod-rtw88 + DEPENDS+= @USB_SUPPORT +kmod-rtw88 +kmod-usb-core FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_usb.ko AUTOLOAD:=$(call AutoProbe,rtw88_usb) HIDDEN:=1 endef +define KernelPackage/rtw88-8821c + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTL8821C family support + DEPENDS+= +kmod-rtw88 +rtl8821ce-firmware +@DRIVER_11AC_SUPPORT + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8821c.ko + AUTOLOAD:=$(call AutoProbe,rtw88_8821c) + HIDDEN:=1 +endef + define KernelPackage/rtw88-8822b $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8822B family support - DEPENDS+= +kmod-rtw88 +@DRIVER_11AC_SUPPORT + DEPENDS+= +kmod-rtw88 +rtl8822be-firmware +@DRIVER_11AC_SUPPORT FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko AUTOLOAD:=$(call AutoProbe,rtw88_8822b) HIDDEN:=1 @@ -214,7 +228,7 @@ endef define KernelPackage/rtw88-8822c $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8822C family support - DEPENDS+= +kmod-rtw88 +@DRIVER_11AC_SUPPORT + DEPENDS+= +kmod-rtw88 +rtl8822ce-firmware +@DRIVER_11AC_SUPPORT FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822c.ko AUTOLOAD:=$(call AutoProbe,rtw88_8822c) HIDDEN:=1 @@ -223,12 +237,28 @@ endef define KernelPackage/rtw88-8723d $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8723D family support - DEPENDS+= +kmod-rtw88 + DEPENDS+= +kmod-rtw88 +rtl8723de-firmware FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723d.ko AUTOLOAD:=$(call AutoProbe,rtw88_8723d) HIDDEN:=1 endef +define KernelPackage/rtw88-8821ce + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTL8821CE support + DEPENDS+= +kmod-rtw88-pci +kmod-rtw88-8821c + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8821ce.ko + AUTOLOAD:=$(call AutoProbe,rtw88_8821ce) +endef + +define KernelPackage/rtw88-8821cu + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTL8821CU support + DEPENDS+= +kmod-rtw88-usb +kmod-rtw88-8821c + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8821cu.ko + AUTOLOAD:=$(call AutoProbe,rtw88_8821cu) +endef + define KernelPackage/rtw88-8822be $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8822BE support @@ -240,7 +270,7 @@ endef define KernelPackage/rtw88-8822bu $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8822BU support - DEPENDS+= +kmod-rtw88-usb +rtl8822be-firmware +kmod-rtw88-8822b + DEPENDS+= +kmod-rtw88-usb +kmod-rtw88-8822b FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822bu.ko AUTOLOAD:=$(call AutoProbe,rtw88_8822bu) endef @@ -253,6 +283,14 @@ define KernelPackage/rtw88-8822ce AUTOLOAD:=$(call AutoProbe,rtw88_8822ce) endef +define KernelPackage/rtw88-8822cu + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTL8822CU support + DEPENDS+= +kmod-rtw88-usb +kmod-rtw88-8822c + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822cu.ko + AUTOLOAD:=$(call AutoProbe,rtw88_8822cu) +endef + define KernelPackage/rtw88-8723de $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8723DE support diff --git a/package/kernel/qca-ssdk/Makefile b/package/kernel/qca-ssdk/Makefile index 4107208c0eb..d8c8d6cb167 100644 --- a/package/kernel/qca-ssdk/Makefile +++ b/package/kernel/qca-ssdk/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qca-ssdk -PKG_RELEASE:=2 +PKG_RELEASE:=4 PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-ssdk.git PKG_SOURCE_PROTO:=git @@ -43,10 +43,13 @@ MAKE_FLAGS+= \ TARGET_SUFFIX=$(CONFIG_TARGET_SUFFIX) \ GCC_VERSION=$(GCC_VERSION) \ EXTRA_CFLAGS=-fno-stack-protector -I$(STAGING_DIR)/usr/include \ + SoC=$(CONFIG_TARGET_SUBTARGET) \ + PTP_FEATURE=disable SWCONFIG_FEATURE=disable \ + ISISC_ENABLE=disable IN_QCA803X_PHY=FALSE \ $(LNX_CONFIG_OPTS) ifeq ($(CONFIG_TARGET_SUBTARGET), "ipq807x") - MAKE_FLAGS+= CHIP_TYPE=HPPE PTP_FEATURE=disable SWCONFIG_FEATURE=disable + MAKE_FLAGS+= CHIP_TYPE=HPPE endif define Build/InstallDev diff --git a/package/kernel/qca-ssdk/patches/100-malibu-phy-add-support-for-manual-define-of-first-ph.patch b/package/kernel/qca-ssdk/patches/100-malibu-phy-add-support-for-manual-define-of-first-ph.patch new file mode 100644 index 00000000000..6aaa579c09e --- /dev/null +++ b/package/kernel/qca-ssdk/patches/100-malibu-phy-add-support-for-manual-define-of-first-ph.patch @@ -0,0 +1,131 @@ +From a651d10fbd880098d7b98dee27dfd1eb15146fb2 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Sun, 12 Nov 2023 18:40:22 +0100 +Subject: [PATCH] malibu-phy: add support for manual define of first phy addr + +The usage of first_phy_addr is EXTREMELY FRAGILE and results +in dangerous results if the OEM (or anyone that by chance try to +implement things in a logical manner) deviates from the default values +from the "magical template". + +To be in more details. With QSDK 12.4, some tweaks were done to improve +autoneg and now on every call of port status, the phydev is tried to +add. This resulted in the call and log spam of an error with ports that +are actually not present on the system with qsdk reporting phydev is +NULL. This itself is not an error and printing the error is correct. + +What is actually an error from ages is setting generic bitmap reporting +presence of port that are actually not present. This is very common on +OEM where the switch_lan_bmp is always a variant of 0x1e (that on bitmap +results in PORT1 PORT2 PORT3 PORT4 present) or 0x3e (PORT1 PORT2 PORT3 +PORT4 PORT5). Reality is that many device are used as AP with one LAN +port or one WAN port. (or even exotic configuration with PORT1 not +present and PORT2 PORT3 PORT4 present (Xiaomi 3600) + +With this finding one can say... ok nice, then lets update the DT and +set the correct bitmap... + +Again world is a bad place and reality is that this cause wonderful +regression in some case of by extreme luck the first ever connected +port working and the rest of the switch dead. + +The problem has been bisected to all the device that doesn't have the +PORT1 declared in any of the bitmap. + +With this prefaction in mind, on to the REAL problem. + +malibu_phy_hw_init FOR SOME REASON, set a global variable first_phy_addr +to the first detected PHY addr that coincidentally is always PORT1. +PORT1 addr is 0x0. The entire code in malibu_phy use this variable to +derive the phy addrs in some function. + +Declaring a bitmap where the PORT1 is missing (or worse PORT4 the only +one connected) result in first_phy_addr set to 1 or whatever phy addr is +detected first setting wrong value all over the init stage. + +To fix this, introduce a new binding malibu_first_phy_addr to manually +declare the first phy that the malibu PHY driver should use and permit +to detach it from port bmp detection. The legacy detection is kept for +compatibility reason. + +Signed-off-by: Christian Marangi +--- + include/init/ssdk_dts.h | 1 + + include/init/ssdk_init.h | 2 ++ + src/hsl/phy/malibu_phy.c | 5 +++++ + src/init/ssdk_dts.c | 15 +++++++++++++++ + 4 files changed, 23 insertions(+) + +--- a/include/init/ssdk_dts.h ++++ b/include/init/ssdk_dts.h +@@ -146,6 +146,7 @@ a_uint32_t ssdk_wan_bmp_get(a_uint32_t d + sw_error_t ssdk_lan_bmp_set(a_uint32_t dev_id, a_uint32_t lan_bmp); + sw_error_t ssdk_wan_bmp_set(a_uint32_t dev_id, a_uint32_t wan_bmp); + a_uint32_t ssdk_inner_bmp_get(a_uint32_t dev_id); ++a_uint32_t ssdk_malibu_first_phy_addr_get(a_uint32_t dev_id); + hsl_reg_mode ssdk_switch_reg_access_mode_get(a_uint32_t dev_id); + void ssdk_switch_reg_map_info_get(a_uint32_t dev_id, ssdk_reg_map_info *info); + a_uint32_t ssdk_switch_pcie_base_get(a_uint32_t dev_id); +--- a/include/init/ssdk_init.h ++++ b/include/init/ssdk_init.h +@@ -194,6 +194,7 @@ enum ssdk_port_wrapper_cfg { + a_uint32_t lan_bmp; + a_uint32_t wan_bmp; + a_uint32_t inner_bmp; ++ a_uint32_t malibu_first_phy_addr; + } ssdk_port_cfg; + + typedef struct +@@ -384,6 +385,7 @@ ssdk_hsl_access_mode_set(a_uint32_t dev_ + + a_uint32_t ssdk_dt_global_get_mac_mode(a_uint32_t dev_id, a_uint32_t index); + a_uint32_t ssdk_dt_global_set_mac_mode(a_uint32_t dev_id, a_uint32_t index, a_uint32_t mode); ++a_uint32_t ssdk_malibu_first_phy_addr_get(a_uint32_t dev_id); + + a_uint32_t + qca_hppe_port_mac_type_get(a_uint32_t dev_id, a_uint32_t port_id); +--- a/src/hsl/phy/malibu_phy.c ++++ b/src/hsl/phy/malibu_phy.c +@@ -1945,6 +1945,11 @@ static int malibu_phy_api_ops_init(void) + int malibu_phy_init(a_uint32_t dev_id, a_uint32_t port_bmp) + { + static a_uint32_t phy_ops_flag = 0; ++ a_uint32_t malibu_first_phy_addr; ++ ++ malibu_first_phy_addr = ssdk_malibu_first_phy_addr_get(dev_id); ++ if (malibu_first_phy_addr != MAX_PHY_ADDR) ++ first_phy_addr = malibu_first_phy_addr; + + if(phy_ops_flag == 0) { + malibu_phy_api_ops_init(); +--- a/src/init/ssdk_dts.c ++++ b/src/init/ssdk_dts.c +@@ -186,6 +186,13 @@ a_uint32_t ssdk_inner_bmp_get(a_uint32_t + return cfg->port_cfg.inner_bmp; + } + ++a_uint32_t ssdk_malibu_first_phy_addr_get(a_uint32_t dev_id) ++{ ++ ssdk_dt_cfg* cfg = ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]; ++ ++ return cfg->port_cfg.malibu_first_phy_addr; ++} ++ + hsl_reg_mode ssdk_switch_reg_access_mode_get(a_uint32_t dev_id) + { + ssdk_dt_cfg* cfg = ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]; +@@ -1039,6 +1046,14 @@ static void ssdk_dt_parse_port_bmp(a_uin + cfg->port_cfg.inner_bmp; + } + ++ /* Permit to manually declare start phy addr for malibu PHY. If not found set to legacy detection. */ ++ if (!of_property_read_u32(switch_node, "malibu_first_phy_addr", &cfg->port_cfg.malibu_first_phy_addr)) { ++ ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]->port_cfg.malibu_first_phy_addr = ++ cfg->port_cfg.malibu_first_phy_addr; ++ } else { ++ ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]->port_cfg.malibu_first_phy_addr = MAX_PHY_ADDR; ++ } ++ + ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]->port_cfg.cpu_bmp = cfg->port_cfg.cpu_bmp; + ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]->port_cfg.lan_bmp = cfg->port_cfg.lan_bmp; + ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]->port_cfg.wan_bmp = cfg->port_cfg.wan_bmp; diff --git a/package/kernel/qca-ssdk/patches/100-malibu-phy-drop-usage-of-first_phy_addr.patch b/package/kernel/qca-ssdk/patches/100-malibu-phy-drop-usage-of-first_phy_addr.patch deleted file mode 100644 index 905f1cde011..00000000000 --- a/package/kernel/qca-ssdk/patches/100-malibu-phy-drop-usage-of-first_phy_addr.patch +++ /dev/null @@ -1,264 +0,0 @@ -From 46ed8163ac0d9a11a629f1c446e8c5e711cf35d6 Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Sat, 11 Nov 2023 18:13:02 +0100 -Subject: [PATCH] malibu-phy: drop usage of first_phy_addr - -I'm very confused by this and to me it's not clear the real usage of -this logic. - -From what I can see the usage of this is EXTREMELY FRAGILE and results -in dangerous results if the OEM (or anyone that by chance try to -implement things in a logical manner) deviates from the default values -from the "magical template". - -To be in more details. With QSDK 12.4, some tweaks were done to improve -autoneg and now on every call of port status, the phydev is tried to -add. This resulted in the call and log spam of an error with ports that -are actually not present on the system with qsdk reporting phydev is -NULL. This itself is not an error and printing the error is correct. - -What is actually an error from ages is setting generic bitmap reporting -presence of port that are actually not present. This is very common on -OEM where the switch_lan_bmp is always a variant of 0x1e (that on bitmap -results in PORT1 PORT2 PORT3 PORT4 present) or 0x3e (PORT1 PORT2 PORT3 -PORT4 PORT5). Reality is that many device are used as AP with one LAN -port or one WAN port. (or even exotic configuration with PORT1 not -present and PORT2 PORT3 PORT4 present (Xiaomi 3600) - -With this finding one can say... ok nice, then lets update the DT and -set the correct bitmap... - -Again world is a bad place and reality is that this cause wonderful -regression in some case of by extreme luck the first ever connected -port working and the rest of the switch dead. - -The problem has been bisected to all the device that doesn't have the -PORT1 declared in any of the bitmap. - -With this perfection in mind, on to the REAL problem. - -malibu_phy_hw_init FOR SOME REASON, set a global variable first_phy_addr -to the first detected PHY addr that coincidentally is always PORT1. -PORT1 addr is 0x0. The entire code in malibu_phy use this variable to -derive the phy addrs in some function. - -Declaring a bitmap where the PORT1 is missing (or worse PORT4 the only -one connected) result in first_phy_addr set to 1 or whatever phy addr is -detected first setting wrong value all over the init stage. - -To fix this, just drop this variable and hardcode everything to assume -the first phy adrr is ALWAYS 0 and remove calculation and use define for -special case. - -With the following change normal switch traffic is restored and ports -function is recovered. - -Signed-off-by: Christian Marangi ---- - src/hsl/phy/malibu_phy.c | 63 +++++++++++++++++----------------------- - 1 file changed, 26 insertions(+), 37 deletions(-) - ---- a/src/hsl/phy/malibu_phy.c -+++ b/src/hsl/phy/malibu_phy.c -@@ -26,8 +26,9 @@ - #include "qcaphy_common.h" - #include "ssdk_plat.h" - --static a_uint32_t first_phy_addr = MAX_PHY_ADDR; - static a_uint32_t combo_phy_addr = MAX_PHY_ADDR; -+#define PORT4_PHY_ID 0x4 -+#define PORT5_PHY_ID 0x5 - #define COMBO_PHY_ID combo_phy_addr - - /****************************************************************************** -@@ -1250,10 +1251,10 @@ sw_error_t - malibu_phy_serdes_reset(a_uint32_t dev_id) - { - -- hsl_phy_mii_reg_write(dev_id, first_phy_addr + MALIBU_PHY_PSGMII_ADDR_INC, -+ hsl_phy_mii_reg_write(dev_id, MALIBU_PHY_PSGMII_ADDR_INC, - MALIBU_MODE_RESET_REG, MALIBU_MODE_CHANAGE_RESET); - mdelay(100); -- hsl_phy_mii_reg_write(dev_id, first_phy_addr + MALIBU_PHY_PSGMII_ADDR_INC, -+ hsl_phy_mii_reg_write(dev_id, MALIBU_PHY_PSGMII_ADDR_INC, - MALIBU_MODE_RESET_REG, MALIBU_MODE_RESET_DEFAULT_VALUE); - - return SW_OK; -@@ -1271,8 +1272,7 @@ malibu_phy_interface_set_mode(a_uint32_t - a_uint16_t phy_data = 0; - static fal_port_interface_mode_t phy_mode = PORT_INTERFACE_MODE_MAX; - -- if ((phy_addr < first_phy_addr) || -- (phy_addr > (first_phy_addr + MALIBU_PHY_MAX_ADDR_INC))) -+ if (phy_addr > MALIBU_PHY_MAX_ADDR_INC) - return SW_NOT_SUPPORTED; - /*if interface_mode have been configured, then no need to configure again*/ - if(phy_mode == interface_mode) -@@ -1295,20 +1295,19 @@ malibu_phy_interface_set_mode(a_uint32_t - return SW_BAD_PARAM; - } - -- hsl_phy_modify_mii(dev_id, -- first_phy_addr + MALIBU_PHY_MAX_ADDR_INC, MALIBU_PHY_CHIP_CONFIG, -+ hsl_phy_modify_mii(dev_id, MALIBU_PHY_MAX_ADDR_INC, MALIBU_PHY_CHIP_CONFIG, - BITS(0, 4), phy_data); - - /* reset operation */ - malibu_phy_serdes_reset(dev_id); - - if (interface_mode == PHY_PSGMII_FIBER) { -- hsl_phy_mii_reg_write(dev_id, first_phy_addr + MALIBU_PHY_MAX_ADDR_INC, -+ hsl_phy_mii_reg_write(dev_id, MALIBU_PHY_MAX_ADDR_INC, - MALIBU_PHY_CHIP_CONFIG, MALIBU_MODECTRL_DFLT); -- hsl_phy_mii_reg_write(dev_id, first_phy_addr + MALIBU_PHY_MAX_ADDR_INC, -+ hsl_phy_mii_reg_write(dev_id, MALIBU_PHY_MAX_ADDR_INC, - MALIBU_PHY_CONTROL, MALIBU_MIICTRL_DFLT); - hsl_phy_phydev_autoneg_update(dev_id, -- first_phy_addr + MALIBU_PHY_MAX_ADDR_INC, A_FALSE, 0); -+ MALIBU_PHY_MAX_ADDR_INC, A_FALSE, 0); - } - phy_mode = interface_mode; - SSDK_DEBUG("malibu phy is configured as phy_mode:0x%x\n", phy_mode); -@@ -1329,13 +1328,12 @@ malibu_phy_interface_get_mode(a_uint32_t - a_uint16_t phy_data; - a_uint16_t copper_mode; - -- if ((phy_addr < first_phy_addr) || -- (phy_addr > (first_phy_addr + MALIBU_PHY_MAX_ADDR_INC))) { -+ if (phy_addr > MALIBU_PHY_MAX_ADDR_INC) { - return SW_NOT_SUPPORTED; - } - - phy_data = hsl_phy_mii_reg_read(dev_id, -- first_phy_addr + MALIBU_PHY_MAX_ADDR_INC, MALIBU_PHY_CHIP_CONFIG); -+ MALIBU_PHY_MAX_ADDR_INC, MALIBU_PHY_CHIP_CONFIG); - copper_mode = ((phy_data & MALIBU_PHY_COPPER_MODE) >> 0xf); - phy_data &= 0x000f; - -@@ -1344,13 +1342,13 @@ malibu_phy_interface_get_mode(a_uint32_t - *interface_mode = PHY_PSGMII_BASET; - break; - case MALIBU_PHY_PSGMII_BX1000: -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode = PHY_PSGMII_BX1000; - else - *interface_mode = PHY_PSGMII_BASET; - break; - case MALIBU_PHY_PSGMII_FX100: -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode = PHY_PSGMII_FX100; - else - *interface_mode = PHY_PSGMII_BASET; -@@ -1359,14 +1357,14 @@ malibu_phy_interface_get_mode(a_uint32_t - if (copper_mode) { - *interface_mode = PHY_PSGMII_BASET; - } else { -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode = PHY_PSGMII_FIBER; - else - *interface_mode = PHY_PSGMII_BASET; - } - break; - case MALIBU_PHY_SGMII_BASET: -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode = PHY_SGMII_BASET; - else - *interface_mode = PORT_QSGMII; -@@ -1392,13 +1390,12 @@ malibu_phy_interface_get_mode_status(a_u - a_uint16_t phy_data, phy_mode, phy_mode_status; - a_uint16_t copper_mode; - -- if ((phy_addr < first_phy_addr) || -- (phy_addr > (first_phy_addr + MALIBU_PHY_MAX_ADDR_INC))) { -+ if (phy_addr > MALIBU_PHY_MAX_ADDR_INC) { - return SW_NOT_SUPPORTED; - } - - phy_data = hsl_phy_mii_reg_read(dev_id, -- first_phy_addr + MALIBU_PHY_MAX_ADDR_INC, MALIBU_PHY_CHIP_CONFIG); -+ MALIBU_PHY_MAX_ADDR_INC, MALIBU_PHY_CHIP_CONFIG); - copper_mode = ((phy_data & MALIBU_PHY_COPPER_MODE) >> 0xf); - phy_mode = phy_data & 0x000f; - phy_mode_status = (phy_data & 0x00f0) >> 0x4; -@@ -1407,7 +1404,7 @@ malibu_phy_interface_get_mode_status(a_u - if (copper_mode) { - *interface_mode_status = PHY_PSGMII_BASET; - } else { -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode_status = PHY_PSGMII_FIBER; - else - *interface_mode_status = PHY_PSGMII_BASET; -@@ -1418,19 +1415,19 @@ malibu_phy_interface_get_mode_status(a_u - *interface_mode_status = PHY_PSGMII_BASET; - break; - case MALIBU_PHY_PSGMII_BX1000: -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode_status = PHY_PSGMII_BX1000; - else - *interface_mode_status = PHY_PSGMII_BASET; - break; - case MALIBU_PHY_PSGMII_FX100: -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode_status = PHY_PSGMII_FX100; - else - *interface_mode_status = PHY_PSGMII_BASET; - break; - case MALIBU_PHY_SGMII_BASET: -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode_status = PHY_SGMII_BASET; - else - *interface_mode_status = PORT_QSGMII; -@@ -1795,10 +1792,6 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_ - { - phy_cnt ++; - phy_addr = qca_ssdk_port_to_phy_addr(dev_id, port_id); -- if (phy_addr < first_phy_addr) -- { -- first_phy_addr = phy_addr; -- } - /*enable phy power saving function by default */ - malibu_phy_set_8023az(dev_id, phy_addr, A_TRUE); - malibu_phy_set_powersave(dev_id, phy_addr, A_TRUE); -@@ -1824,29 +1817,25 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_ - MALIBU_EXTENDED_NEXT_PAGE_EN, 0); - } - } -- /* qca 8072 two ports phy chip's firstly address to init phy chip */ -- if ((phy_cnt == QCA8072_PHY_NUM) && (first_phy_addr >= 0x3)) { -- first_phy_addr = first_phy_addr - 0x3; -- } - - /*workaround to enable AZ transmitting ability*/ -- hsl_phy_mmd_reg_write(dev_id, first_phy_addr + 5, A_FALSE, MALIBU_PHY_MMD1_NUM, -+ hsl_phy_mmd_reg_write(dev_id, PORT5_PHY_ID, A_FALSE, MALIBU_PHY_MMD1_NUM, - MALIBU_PSGMII_MODE_CTRL, MALIBU_PHY_PSGMII_MODE_CTRL_ADJUST_VALUE); - - /* adjust psgmii serdes tx amp */ -- hsl_phy_mii_reg_write(dev_id, first_phy_addr + 5, -+ hsl_phy_mii_reg_write(dev_id, PORT5_PHY_ID, - MALIBU_PSGMII_TX_DRIVER_1_CTRL, MALIBU_PHY_PSGMII_REDUCE_SERDES_TX_AMP); - - /* to avoid psgmii module goes into hibernation, work with psgmii self test*/ -- hsl_phy_modify_mmd(dev_id, first_phy_addr + 4, A_FALSE, MALIBU_PHY_MMD3_NUM, -+ hsl_phy_modify_mmd(dev_id, PORT4_PHY_ID, A_FALSE, MALIBU_PHY_MMD3_NUM, - MALIBU_PHY_MMD3_ADDR_REMOTE_LOOPBACK_CTRL, BIT(1), 0); - - mode = ssdk_dt_global_get_mac_mode(dev_id, 0); - if (mode == PORT_WRAPPER_PSGMII_FIBER) -- malibu_phy_interface_set_mode(dev_id, first_phy_addr, PHY_PSGMII_FIBER); -+ malibu_phy_interface_set_mode(dev_id, 0x0, PHY_PSGMII_FIBER); - - /*init combo phy address*/ -- combo_phy_addr = first_phy_addr+4; -+ combo_phy_addr = PORT4_PHY_ID; - - return SW_OK; - } diff --git a/package/libs/udebug/Makefile b/package/libs/udebug/Makefile new file mode 100644 index 00000000000..04fd7419572 --- /dev/null +++ b/package/libs/udebug/Makefile @@ -0,0 +1,82 @@ +# +# Copyright (C) 2023 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=udebug +CMAKE_INSTALL:=1 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/udebug.git +PKG_MIRROR_HASH:=baf437fb12b1faaf6c7eea3fea253c6d87c31b85f768b48d3984fe398e5b20b8 +PKG_SOURCE_DATE:=2023-11-20 +PKG_SOURCE_VERSION:=759d9404034b7da97b3950c806ace7296a0f7a12 +PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) + +PKG_LICENSE:=GPL-2.0 +PKG_MAINTAINER:=Felix Fietkau + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/libudebug + SECTION:=libs + CATEGORY:=Libraries + TITLE:=udebug client library + DEPENDS:=+libubox +endef + +define Package/udebugd + SECTION:=utils + CATEGORY:=Utilities + TITLE:=OpenWrt debug service + DEPENDS:=+libudebug +libubus +endef + +define Package/udebugd/conffiles +/etc/config/udebug +endef + +define Package/ucode-mod-udebug + SECTION:=utils + CATEGORY:=Utilities + TITLE:=ucode udebug module + DEPENDS:=+libucode +libudebug +endef + +define Package/udebug-cli + SECTION:=utils + CATEGORY:=Utilities + TITLE:=OpenWrt debug service CLI + DEPENDS:=+udebugd +ucode-mod-udebug +endef + +define Package/libudebug/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib +endef + +define Package/ucode-mod-udebug/install + $(INSTALL_DIR) $(1)/usr/lib/ucode + $(CP) $(PKG_INSTALL_DIR)/usr/lib/ucode/*.so $(1)/usr/lib/ucode +endef + +define Package/udebugd/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config + $(INSTALL_BIN) ./files/udebug.config $(1)/etc/config/udebug + $(INSTALL_BIN) ./files/udebug.init $(1)/etc/init.d/udebug + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/udebugd $(1)/usr/sbin +endef + +define Package/udebug-cli/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/udebug-cli $(1)/usr/sbin/udebug +endef + +$(eval $(call BuildPackage,libudebug)) +$(eval $(call BuildPackage,udebugd)) +$(eval $(call BuildPackage,ucode-mod-udebug)) +$(eval $(call BuildPackage,udebug-cli)) diff --git a/package/libs/udebug/files/udebug.config b/package/libs/udebug/files/udebug.config new file mode 100644 index 00000000000..36b653e3065 --- /dev/null +++ b/package/libs/udebug/files/udebug.config @@ -0,0 +1,8 @@ +config service hostapd + option enabled 0 + +config service wpa_supplicant + option enabled 0 + +config service netifd + option enabled 0 diff --git a/package/libs/udebug/files/udebug.init b/package/libs/udebug/files/udebug.init new file mode 100755 index 00000000000..b57e962f6fa --- /dev/null +++ b/package/libs/udebug/files/udebug.init @@ -0,0 +1,55 @@ +#!/bin/sh /etc/rc.common +# Copyright (c) 2021 OpenWrt.org + +START=11 + +USE_PROCD=1 +PROG=/usr/sbin/udebugd + +start_service() { + procd_open_instance + procd_set_param command "$PROG" + procd_set_param respawn + procd_close_instance +} + +get_vars() { + local cfg="$1" + uci show "udebug.$cfg" | while read LINE; do + cur="${LINE##udebug.$1.}" + [[ "$cur" = "$LINE" ]] && continue + var="${cur%%=*}" + [[ "$cur" = "$var" ]] && continue + echo "$var" + done +} + +add_debug_service() { + local cfg="$1" + + json_add_object "$cfg" + for var in $(get_vars "$cfg"); do + config_get val "$cfg" "$var" + json_add_string "$var" "$val" + done + json_close_object "$cfg" +} + +reload_service() { + config_load udebug + + json_init + json_add_object service + config_foreach add_debug_service service + json_close_object + ubus call udebug set_config "$(json_dump)" +} + +service_triggers() { + procd_add_reload_trigger udebug +} + +service_started() { + ubus -t 10 wait_for udebug + [ $? = 0 ] && reload_service +} diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index eb4363e9c69..ccd566e0a76 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2023-11-11 -PKG_SOURCE_VERSION:=c739dee0a37bc593aaed7ae3f0a61e3d7c1fb1ac -PKG_MIRROR_HASH:=5e3dc0ce4774cd738b2d6363b642ee0501bd6b7f8061d5d82151af2069e7fbfd +PKG_SOURCE_DATE:=2023-11-20 +PKG_SOURCE_VERSION:=f3e06e81b347bbdec1c6c71603328b6e442728d4 +PKG_MIRROR_HASH:=f16dd61aede5597fd7b5ee8e7752a916494281bc981b35c16e788ddb7409584a PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 @@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/cmake.mk define Package/netifd SECTION:=base CATEGORY:=Base system - DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn +libubox + DEPENDS:=+libuci +libnl-tiny +libubus +ubus +ubusd +jshn +libubox +libudebug TITLE:=OpenWrt Network Interface Configuration Daemon endef diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index e442d0005b9..241f3463e2f 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_UPSTREAM_VERSION:=2.89 PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION))) -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz PKG_SOURCE_URL:=https://thekelleys.org.uk/dnsmasq/ diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 8ba7e3e3774..16966e103fa 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -539,8 +539,13 @@ dhcp_add() { # Do not support non-static interfaces for now [ static = "$proto" ] || return 0 + ipaddr="${subnet%%/*}" + prefix_or_netmask="${subnet##*/}" + # Override interface netmask with dhcp config if applicable - config_get netmask "$cfg" netmask "${subnet##*/}" + config_get netmask "$cfg" netmask + + [ -n "$netmask" ] && prefix_or_netmask="$netmask" #check for an already active dhcp server on the interface, unless 'force' is set config_get_bool force "$cfg" force 0 @@ -583,7 +588,7 @@ dhcp_add() { nettag="${networkid:+set:${networkid},}" # make sure the DHCP range is not empty - if [ "$dhcpv4" != "disabled" ] && ipcalc "${subnet%%/*}" "$netmask" "$start" "$limit" ; then + if [ "$dhcpv4" != "disabled" ] && ipcalc "$ipaddr/$prefix_or_netmask" "$start" "$limit" ; then [ "$dynamicdhcpv4" = "0" ] && END="static" xappend "--dhcp-range=$tags$nettag$START,$END,$NETMASK,$leasetime${options:+ $options}" diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index f46c6275ef6..17f9dcb581d 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -79,7 +79,7 @@ ifneq ($(CONFIG_DRIVER_11AX_SUPPORT),) HOSTAPD_IEEE80211AX:=y endif -CORE_DEPENDS = +ucode +libubus +libucode +ucode-mod-fs +ucode-mod-nl80211 +ucode-mod-rtnl +ucode-mod-ubus +ucode-mod-uloop +libblobmsg-json +CORE_DEPENDS = +ucode +libubus +libucode +ucode-mod-fs +ucode-mod-nl80211 +ucode-mod-rtnl +ucode-mod-ubus +ucode-mod-uloop +libblobmsg-json +libudebug OPENSSL_DEPENDS = +PACKAGE_$(1):libopenssl +PACKAGE_$(1):libopenssl-legacy DRIVER_MAKEOPTS= \ @@ -585,7 +585,7 @@ TARGET_CPPFLAGS := \ -D_GNU_SOURCE \ $(if $(CONFIG_WPA_MSG_MIN_PRIORITY),-DCONFIG_MSG_MIN_PRIORITY=$(CONFIG_WPA_MSG_MIN_PRIORITY)) -TARGET_LDFLAGS += -lubox -lubus -lblobmsg_json -lucode -lm -lnl-tiny +TARGET_LDFLAGS += -lubox -lubus -lblobmsg_json -lucode -lm -lnl-tiny -ludebug ifdef CONFIG_WPA_ENABLE_WEP DRIVER_MAKEOPTS += CONFIG_WEP=y diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index 593840cca88..84138f29a58 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -278,12 +278,12 @@ function iface_reload_config(phydev, config, old_config) return false; let iface = hostapd.interfaces[phy]; + let iface_name = old_config.bss[0].ifname; if (!iface) { hostapd.printf(`Could not find previous interface ${iface_name}`); return false; } - let iface_name = old_config.bss[0].ifname; let first_bss = hostapd.bss[iface_name]; if (!first_bss) { hostapd.printf(`Could not find bss of previous interface ${iface_name}`); @@ -782,8 +782,33 @@ let main_obj = { }, }; +function handle_debug_config(cfg) { + hostapd.printf(`handle_debug_config: ${cfg}\n`); + if (!cfg) + return; + + let data = cfg.service; + if (!data) + return; + + data = data.hostapd; + if (!data) + return; + + hostapd.udebug_set(!!+data.enabled); +} + hostapd.data.ubus = ubus; hostapd.data.obj = ubus.publish("hostapd", main_obj); +hostapd.data.debug_sub = ubus.subscriber((req) => { + if (req.type != "config") + return; + + handle_debug_config(req.data); +}); + +hostapd.data.debug_sub.subscribe("udebug"); +handle_debug_config(ubus.call("udebug", "get_config", {})); function bss_event(type, name, data) { let ubus = hostapd.data.ubus; diff --git a/package/network/services/hostapd/files/wpa_supplicant.uc b/package/network/services/hostapd/files/wpa_supplicant.uc index d624f27cddc..aac144b3399 100644 --- a/package/network/services/hostapd/files/wpa_supplicant.uc +++ b/package/network/services/hostapd/files/wpa_supplicant.uc @@ -244,8 +244,32 @@ let main_obj = { }, }; +function handle_debug_config(cfg) { + if (!cfg) + return; + + let data = cfg.service; + if (!data) + return; + + data = data.wpa_supplicant; + if (!data) + return; + + wpas.udebug_set(!!+data.enabled); +} + wpas.data.ubus = ubus; wpas.data.obj = ubus.publish("wpa_supplicant", main_obj); +wpas.data.debug_sub = ubus.subscriber((req) => { + if (req.type != "config") + return; + + handle_debug_config(req.data); +}); + +wpas.data.debug_sub.subscribe("udebug"); +handle_debug_config(ubus.call("udebug", "get_config", {})); function iface_event(type, name, data) { let ubus = wpas.data.ubus; diff --git a/package/network/services/hostapd/files/wpad_acl.json b/package/network/services/hostapd/files/wpad_acl.json index d00fd945ba5..7532953cabd 100644 --- a/package/network/services/hostapd/files/wpad_acl.json +++ b/package/network/services/hostapd/files/wpad_acl.json @@ -9,8 +9,12 @@ }, "hostapd": { "methods": [ "apsta_state" ] + }, + "udebug": { + "methods": [ "get_config" ] } }, + "subscribe": [ "udebug" ], "publish": [ "hostapd", "hostapd.*", "wpa_supplicant", "wpa_supplicant.*" ], "send": [ "bss.*", "wps_credentials" ] } diff --git a/package/network/services/hostapd/patches/601-ucode_support.patch b/package/network/services/hostapd/patches/601-ucode_support.patch index 23f535b6852..cfdb51f356c 100644 --- a/package/network/services/hostapd/patches/601-ucode_support.patch +++ b/package/network/services/hostapd/patches/601-ucode_support.patch @@ -196,7 +196,7 @@ #ifdef CONFIG_BGSCAN if (state == WPA_COMPLETED && wpa_s->current_ssid != wpa_s->bgscan_ssid) -@@ -7596,6 +7597,7 @@ struct wpa_supplicant * wpa_supplicant_a +@@ -7594,6 +7595,7 @@ struct wpa_supplicant * wpa_supplicant_a #endif /* CONFIG_P2P */ wpas_ubus_add_bss(wpa_s); @@ -204,7 +204,7 @@ return wpa_s; } -@@ -7623,6 +7625,7 @@ int wpa_supplicant_remove_iface(struct w +@@ -7621,6 +7623,7 @@ int wpa_supplicant_remove_iface(struct w struct wpa_supplicant *parent = wpa_s->parent; #endif /* CONFIG_MESH */ @@ -212,7 +212,7 @@ wpas_ubus_free_bss(wpa_s); /* Remove interface from the global list of interfaces */ -@@ -7933,6 +7936,7 @@ struct wpa_global * wpa_supplicant_init( +@@ -7931,6 +7934,7 @@ struct wpa_global * wpa_supplicant_init( eloop_register_timeout(WPA_SUPPLICANT_CLEANUP_INTERVAL, 0, wpas_periodic, global, NULL); @@ -220,7 +220,7 @@ return global; } -@@ -7971,12 +7975,8 @@ int wpa_supplicant_run(struct wpa_global +@@ -7969,12 +7973,8 @@ int wpa_supplicant_run(struct wpa_global eloop_register_signal_terminate(wpa_supplicant_terminate, global); eloop_register_signal_reconfig(wpa_supplicant_reconfig, global); @@ -233,7 +233,7 @@ return 0; } -@@ -8009,6 +8009,8 @@ void wpa_supplicant_deinit(struct wpa_gl +@@ -8007,6 +8007,8 @@ void wpa_supplicant_deinit(struct wpa_gl wpas_notify_supplicant_deinitialized(global); @@ -395,7 +395,60 @@ { --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -1333,7 +1333,7 @@ static void wpa_driver_nl80211_event_rtm +@@ -73,6 +73,16 @@ enum nlmsgerr_attrs { + + #endif /* ANDROID */ + ++static void handle_nl_debug_hook(struct nl_msg *msg, int tx) ++{ ++ const struct nlmsghdr *nlh; ++ ++ if (!wpa_netlink_hook) ++ return; ++ ++ nlh = nlmsg_hdr(msg); ++ wpa_netlink_hook(tx, nlh, nlh->nlmsg_len); ++} + + static struct nl_sock * nl_create_handle(struct nl_cb *cb, const char *dbg) + { +@@ -379,6 +389,11 @@ static int no_seq_check(struct nl_msg *m + return NL_OK; + } + ++static int debug_handler(struct nl_msg *msg, void *arg) ++{ ++ handle_nl_debug_hook(msg, 0); ++ return NL_OK; ++} + + static void nl80211_nlmsg_clear(struct nl_msg *msg) + { +@@ -415,6 +430,7 @@ static int send_and_recv(struct nl80211_ + if (!msg) + return -ENOMEM; + ++ handle_nl_debug_hook(msg, 1); + cb = nl_cb_clone(global->nl_cb); + if (!cb) + goto out; +@@ -443,6 +459,7 @@ static int send_and_recv(struct nl80211_ + + err = 1; + ++ nl_cb_set(cb, NL_CB_MSG_IN, NL_CB_CUSTOM, debug_handler, NULL); + nl_cb_err(cb, NL_CB_CUSTOM, error_handler, &err); + nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, finish_handler, &err); + if (ack_handler_custom) { +@@ -919,6 +936,7 @@ nl80211_get_wiphy_data_ap(struct i802_bs + os_free(w); + return NULL; + } ++ nl_cb_set(w->nl_cb, NL_CB_MSG_IN, NL_CB_CUSTOM, debug_handler, NULL); + nl_cb_set(w->nl_cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM, + no_seq_check, NULL); + nl_cb_set(w->nl_cb, NL_CB_VALID, NL_CB_CUSTOM, +@@ -1333,7 +1351,7 @@ static void wpa_driver_nl80211_event_rtm } wpa_printf(MSG_DEBUG, "nl80211: Interface down (%s/%s)", namebuf, ifname); @@ -404,7 +457,7 @@ wpa_printf(MSG_DEBUG, "nl80211: Not the main interface (%s) - do not indicate interface down", drv->first_bss->ifname); -@@ -1369,7 +1369,7 @@ static void wpa_driver_nl80211_event_rtm +@@ -1369,7 +1387,7 @@ static void wpa_driver_nl80211_event_rtm } wpa_printf(MSG_DEBUG, "nl80211: Interface up (%s/%s)", namebuf, ifname); @@ -413,7 +466,23 @@ wpa_printf(MSG_DEBUG, "nl80211: Not the main interface (%s) - do not indicate interface up", drv->first_bss->ifname); -@@ -8432,6 +8432,7 @@ static void *i802_init(struct hostapd_da +@@ -1992,6 +2010,7 @@ static int wpa_driver_nl80211_init_nl_gl + /* Continue without vendor events */ + } + ++ nl_cb_set(global->nl_cb, NL_CB_MSG_IN, NL_CB_CUSTOM, debug_handler, NULL); + nl_cb_set(global->nl_cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM, + no_seq_check, NULL); + nl_cb_set(global->nl_cb, NL_CB_VALID, NL_CB_CUSTOM, +@@ -2160,6 +2179,7 @@ static int nl80211_init_bss(struct i802_ + if (!bss->nl_cb) + return -1; + ++ nl_cb_set(bss->nl_cb, NL_CB_MSG_IN, NL_CB_CUSTOM, debug_handler, NULL); + nl_cb_set(bss->nl_cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM, + no_seq_check, NULL); + nl_cb_set(bss->nl_cb, NL_CB_VALID, NL_CB_CUSTOM, +@@ -8432,6 +8452,7 @@ static void *i802_init(struct hostapd_da char master_ifname[IFNAMSIZ]; int ifindex, br_ifindex = 0; int br_added = 0; @@ -421,7 +490,7 @@ bss = wpa_driver_nl80211_drv_init(hapd, params->ifname, params->global_priv, 1, -@@ -8491,21 +8492,17 @@ static void *i802_init(struct hostapd_da +@@ -8491,21 +8512,17 @@ static void *i802_init(struct hostapd_da (params->num_bridge == 0 || !params->bridge[0])) add_ifidx(drv, br_ifindex, drv->ifindex); @@ -453,7 +522,7 @@ } if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) { -@@ -8875,6 +8872,50 @@ static int wpa_driver_nl80211_if_remove( +@@ -8875,6 +8892,50 @@ static int wpa_driver_nl80211_if_remove( return 0; } @@ -504,7 +573,7 @@ static int cookie_handler(struct nl_msg *msg, void *arg) { -@@ -10513,6 +10554,37 @@ static int driver_nl80211_if_remove(void +@@ -10513,6 +10574,37 @@ static int driver_nl80211_if_remove(void } @@ -542,7 +611,7 @@ static int driver_nl80211_send_mlme(void *priv, const u8 *data, size_t data_len, int noack, unsigned int freq, -@@ -13697,6 +13769,8 @@ const struct wpa_driver_ops wpa_driver_n +@@ -13697,6 +13789,8 @@ const struct wpa_driver_ops wpa_driver_n .set_acl = wpa_driver_nl80211_set_acl, .if_add = wpa_driver_nl80211_if_add, .if_remove = driver_nl80211_if_remove, @@ -551,3 +620,52 @@ .send_mlme = driver_nl80211_send_mlme, .get_hw_feature_data = nl80211_get_hw_feature_data, .sta_add = wpa_driver_nl80211_sta_add, +--- a/src/utils/wpa_debug.c ++++ b/src/utils/wpa_debug.c +@@ -26,6 +26,10 @@ static FILE *wpa_debug_tracing_file = NU + #define WPAS_TRACE_PFX "wpas <%d>: " + #endif /* CONFIG_DEBUG_LINUX_TRACING */ + ++void (*wpa_printf_hook)(int level, const char *fmt, va_list ap); ++void (*wpa_hexdump_hook)(int level, const char *title, const void *buf, ++ size_t len); ++void (*wpa_netlink_hook)(int tx, const void *data, size_t len); + + int wpa_debug_level = MSG_INFO; + int wpa_debug_show_keys = 0; +@@ -210,6 +214,12 @@ void _wpa_printf(int level, const char * + { + va_list ap; + ++ if (wpa_printf_hook) { ++ va_start(ap, fmt); ++ wpa_printf_hook(level, fmt, ap); ++ va_end(ap); ++ } ++ + if (level >= wpa_debug_level) { + #ifdef CONFIG_ANDROID_LOG + va_start(ap, fmt); +@@ -260,6 +270,9 @@ void _wpa_hexdump(int level, const char + { + size_t i; + ++ if (wpa_hexdump_hook) ++ wpa_hexdump_hook(level, title, buf, len); ++ + #ifdef CONFIG_DEBUG_LINUX_TRACING + if (wpa_debug_tracing_file != NULL) { + fprintf(wpa_debug_tracing_file, +--- a/src/utils/wpa_debug.h ++++ b/src/utils/wpa_debug.h +@@ -11,6 +11,10 @@ + + #include "wpabuf.h" + ++extern void (*wpa_printf_hook)(int level, const char *fmt, va_list ap); ++extern void (*wpa_hexdump_hook)(int level, const char *title, ++ const void *buf, size_t len); ++extern void (*wpa_netlink_hook)(int tx, const void *data, size_t len); + extern int wpa_debug_level; + extern int wpa_debug_show_keys; + extern int wpa_debug_timestamp; diff --git a/package/network/services/hostapd/src/src/ap/ucode.c b/package/network/services/hostapd/src/src/ap/ucode.c index af97091be55..16d1b515360 100644 --- a/package/network/services/hostapd/src/src/ap/ucode.c +++ b/package/network/services/hostapd/src/src/ap/ucode.c @@ -711,6 +711,7 @@ int hostapd_ucode_init(struct hapd_interfaces *ifaces) { "freq_info", uc_wpa_freq_info }, { "add_iface", uc_hostapd_add_iface }, { "remove_iface", uc_hostapd_remove_iface }, + { "udebug_set", uc_wpa_udebug_set }, }; static const uc_function_list_t bss_fns[] = { { "ctrl", uc_hostapd_bss_ctrl }, diff --git a/package/network/services/hostapd/src/src/utils/ucode.c b/package/network/services/hostapd/src/src/utils/ucode.c index 2beeb9a7ff6..14fd6bc5ec9 100644 --- a/package/network/services/hostapd/src/src/utils/ucode.c +++ b/package/network/services/hostapd/src/src/utils/ucode.c @@ -4,12 +4,20 @@ #include "crypto/crypto.h" #include "crypto/sha1.h" #include "common/ieee802_11_common.h" +#include +#include +#include #include #include +#include static uc_value_t *registry; static uc_vm_t vm; static struct uloop_timeout gc_timer; +static struct udebug ud; +static struct udebug_buf ud_log, ud_nl[3]; + +#define UDEBUG_FLAG_RX_FRAME (1ULL << 0) static void uc_gc_timer(struct uloop_timeout *timeout) { @@ -251,6 +259,115 @@ int wpa_ucode_call_prepare(const char *fname) return 0; } +static void udebug_printf_hook(int level, const char *fmt, va_list ap) +{ + udebug_entry_init(&ud_log); + udebug_entry_vprintf(&ud_log, fmt, ap); + udebug_entry_add(&ud_log); +} + +static void udebug_hexdump_hook(int level, const char *title, + const void *data, size_t len) +{ + char *buf; + + udebug_entry_init(&ud_log); + udebug_entry_printf(&ud_log, "%s - hexdump:", title); + buf = udebug_entry_append(&ud_log, NULL, 3 * len); + for (size_t i = 0; i < len; i++) + buf += sprintf(buf, " %02x", *(uint8_t *)(data + i)); + udebug_entry_add(&ud_log); +} + +static void udebug_netlink_hook(int tx, const void *data, size_t len) +{ + struct { + uint16_t pkttype; + uint16_t arphdr; + uint16_t _pad[5]; + uint16_t proto; + } hdr = { + .pkttype = host_to_be16(tx ? 7 : 6), + .arphdr = host_to_be16(824), + .proto = host_to_be16(16), + }; + const struct nlmsghdr *nlh = data; + const struct genlmsghdr *gnlh = data + NLMSG_HDRLEN; + struct udebug_buf *buf = &ud_nl[!!tx]; + + if (nlh->nlmsg_type == 0x10) + buf = &ud_nl[2]; + else if (!tx && gnlh->cmd == NL80211_CMD_FRAME && + !(udebug_buf_flags(buf) & UDEBUG_FLAG_RX_FRAME)) + return; + + udebug_entry_init(buf); + udebug_entry_append(buf, &hdr, sizeof(hdr)); + udebug_entry_append(buf, data, len); + udebug_entry_add(buf); +} + +uc_value_t *uc_wpa_udebug_set(uc_vm_t *vm, size_t nargs) +{ + static const struct udebug_buf_meta meta_log = { + .name = "wpa_log", + .format = UDEBUG_FORMAT_STRING, + }; + static const struct udebug_buf_meta meta_nl_ll = { + .name = "wpa_nl_ctrl", + .format = UDEBUG_FORMAT_PACKET, + .sub_format = UDEBUG_DLT_NETLINK, + }; + static const struct udebug_buf_meta meta_nl_tx = { + .name = "wpa_nl_tx", + .format = UDEBUG_FORMAT_PACKET, + .sub_format = UDEBUG_DLT_NETLINK, + }; + static const struct udebug_buf_flag rx_flags[] = { + { "rx_frame", UDEBUG_FLAG_RX_FRAME }, + }; + static const struct udebug_buf_meta meta_nl_rx = { + .name = "wpa_nl_rx", + .format = UDEBUG_FORMAT_PACKET, + .sub_format = UDEBUG_DLT_NETLINK, + .flags = rx_flags, + .n_flags = ARRAY_SIZE(rx_flags), + }; + bool val = ucv_is_truish(uc_fn_arg(0)); + static bool enabled = false; + + if (enabled == val) + return ucv_boolean_new(true); + + enabled = val; + if (val) { + udebug_init(&ud); + udebug_auto_connect(&ud, NULL); + udebug_buf_init(&ud_log, 1024, 64 * 1024); + udebug_buf_add(&ud, &ud_log, &meta_log); + udebug_buf_init(&ud_nl[0], 1024, 256 * 1024); + udebug_buf_add(&ud, &ud_nl[0], &meta_nl_rx); + udebug_buf_init(&ud_nl[1], 1024, 64 * 1024); + udebug_buf_add(&ud, &ud_nl[1], &meta_nl_tx); + udebug_buf_init(&ud_nl[2], 256, 32 * 1024); + udebug_buf_add(&ud, &ud_nl[2], &meta_nl_ll); + + wpa_printf_hook = udebug_printf_hook; + wpa_hexdump_hook = udebug_hexdump_hook; + wpa_netlink_hook = udebug_netlink_hook; + } else { + for (size_t i = 0; i < ARRAY_SIZE(ud_nl); i++) + udebug_buf_free(&ud_nl[i]); + udebug_buf_free(&ud_log); + udebug_free(&ud); + wpa_printf_hook = NULL; + wpa_hexdump_hook = NULL; + wpa_netlink_hook = NULL; + } + + return ucv_boolean_new(true); +} + uc_value_t *wpa_ucode_global_init(const char *name, uc_resource_type_t *global_type) { uc_value_t *global = uc_resource_new(global_type, NULL); diff --git a/package/network/services/hostapd/src/src/utils/ucode.h b/package/network/services/hostapd/src/src/utils/ucode.h index 2c1886976ee..c083241e079 100644 --- a/package/network/services/hostapd/src/src/utils/ucode.h +++ b/package/network/services/hostapd/src/src/utils/ucode.h @@ -21,6 +21,7 @@ int wpa_ucode_registry_add(uc_value_t *reg, uc_value_t *val); uc_value_t *wpa_ucode_registry_get(uc_value_t *reg, int idx); uc_value_t *wpa_ucode_registry_remove(uc_value_t *reg, int idx); +uc_value_t *uc_wpa_udebug_set(uc_vm_t *vm, size_t nargs); uc_value_t *uc_wpa_printf(uc_vm_t *vm, size_t nargs); uc_value_t *uc_wpa_getpid(uc_vm_t *vm, size_t nargs); uc_value_t *uc_wpa_sha1(uc_vm_t *vm, size_t nargs); diff --git a/package/network/services/hostapd/src/wpa_supplicant/ucode.c b/package/network/services/hostapd/src/wpa_supplicant/ucode.c index 6cba73dcd53..397f85bde7f 100644 --- a/package/network/services/hostapd/src/wpa_supplicant/ucode.c +++ b/package/network/services/hostapd/src/wpa_supplicant/ucode.c @@ -262,6 +262,7 @@ int wpas_ucode_init(struct wpa_global *gl) { "getpid", uc_wpa_getpid }, { "add_iface", uc_wpas_add_iface }, { "remove_iface", uc_wpas_remove_iface }, + { "udebug_set", uc_wpa_udebug_set }, }; static const uc_function_list_t iface_fns[] = { { "status", uc_wpas_iface_status }, diff --git a/package/network/services/umdns/Makefile b/package/network/services/umdns/Makefile index 4510bdeb688..5689a6d78d2 100644 --- a/package/network/services/umdns/Makefile +++ b/package/network/services/umdns/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=umdns -PKG_RELEASE:=5 +PKG_RELEASE:=1 PKG_SOURCE_URL=$(PROJECT_GIT)/project/mdnsd.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2023-10-19 -PKG_SOURCE_VERSION:=d45c443aa1e6514aab58bbbf9311913e484d31a6 -PKG_MIRROR_HASH:=20d91d867f4f34a37c7b2a600327884375f9f16c1ea9bbb3199347d8b617d856 +PKG_SOURCE_DATE:=2023-11-21 +PKG_SOURCE_VERSION:=b1e023eda3584da4a5dfbc33016839f977a02040 +PKG_MIRROR_HASH:=e0619afc3b8e1b8a627b35bbe0734746303db02e6d62fd8a3ff047d4fbaa0522 PKG_MAINTAINER:=John Crispin PKG_LICENSE:=LGPL-2.1 @@ -27,7 +27,7 @@ define Package/umdns SECTION:=net CATEGORY:=Network TITLE:=OpenWrt Multicast DNS Daemon - DEPENDS:=+libubox +libubus +libblobmsg-json + DEPENDS:=+libubox +libubus +libblobmsg-json +libudebug endef TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include diff --git a/package/network/services/umdns/files/umdns.json b/package/network/services/umdns/files/umdns.json index 554b6166330..032b498e680 100644 --- a/package/network/services/umdns/files/umdns.json +++ b/package/network/services/umdns/files/umdns.json @@ -19,6 +19,7 @@ "fcntl", "fcntl64", "fstat", + "ftruncate", "getdents64", "getsockname", "getrandom", @@ -48,6 +49,7 @@ "statx", "time", "uname", + "unlinkat", "write", "writev" ], diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index 82c4dc601a2..42737ff470a 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git -PKG_SOURCE_DATE:=2023-06-05 -PKG_SOURCE_VERSION:=f787c97b34894a38b15599886cacbca01271684f -PKG_MIRROR_HASH:=f4e898eb9207f069652f1767835f6aa9f015df2282d51e50ab57a0c3736f36e3 +PKG_SOURCE_DATE:=2023-11-14 +PKG_SOURCE_VERSION:=b3e8c4ef07ebb6f0f34a5c1f0dc1539068363619 +PKG_MIRROR_HASH:=bb7296b17d5a59b9080d4c9ae188dee49f49c0ce88a5cbe0317102123583d663 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) CMAKE_INSTALL:=1 diff --git a/package/utils/firmware-utils/Makefile b/package/utils/firmware-utils/Makefile index 1316fa5c6b1..432d3797ac0 100644 --- a/package/utils/firmware-utils/Makefile +++ b/package/utils/firmware-utils/Makefile @@ -3,13 +3,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=firmware-utils -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git -PKG_SOURCE_DATE:=2023-05-18 -PKG_SOURCE_VERSION:=02cdbc6a4d61605c008efef09162f772f553fcde -PKG_MIRROR_HASH:=f5188fc38bb03ddbcc34763ff049597e2d8af98c0854910dc87f10e5927096e2 +PKG_SOURCE_DATE:=2023-11-21 +PKG_SOURCE_VERSION:=12bf1a99bd6eebae90caa144bb4d8b0cd763ff8f +PKG_MIRROR_HASH:=f711bf80123a6f14737da27ab8dfff87a4d429c74057de355b1693e89f223abc PKG_BUILD_DEPENDS:=openssl zlib diff --git a/scripts/dump-target-info.pl b/scripts/dump-target-info.pl index 0e4af17fe04..eec06ed6c49 100755 --- a/scripts/dump-target-info.pl +++ b/scripts/dump-target-info.pl @@ -4,7 +4,7 @@ use warnings; use Cwd; -my (%targets, %architectures, %kernels); +my (%targets, %architectures, %kernels, %devices); $ENV{'TOPDIR'} = Cwd::getcwd(); @@ -56,6 +56,68 @@ sub parse_targetinfo { } } +sub parse_devices { + my ($target_dir, $subtarget) = @_; + + if (open M, "make -C '$target_dir' --no-print-directory DUMP=1 TARGET_BUILD=1 SUBTARGET='$subtarget' V=s |") { + my ($device_profile, $device_name, @device_alt_names, $device_is_alt); + while (defined(my $line = readline M)) { + chomp $line; + + if ($line =~ /^Target-Profile-Name: (.+)$/) { + $device_name = $1; + } + elsif ($line =~ /^Target-Profile: DEVICE_(.+)$/) { + $device_profile = $1; + } + # Logic behind this. + # DUMP duplicate info for each alternative device name and + # the alternative device name are printed first before the + # primary device name + # Alternative device titles always have the full list of + # all the alternative device name. + # The device name pattern for an alternative device name is + # Target-Profile-Name: ALT_NAME (PRIMARY_NAME) + # We compare the detected device name and check if it does + # match the alternative device name pattern with one of + # the alternative device name in Alternative device titles: + # If an alternative device name is detected, + # alternative device is skipped. + elsif ($line =~ /^Alternative device titles:$/) { + while (defined($line = readline M)) { + if ($line =~ /^- (.+)$/) { + if ($device_name =~ /^\Q$1\E \((.+)\)$/) { + $device_is_alt = 1; + last; + } + push @device_alt_names, $1; + } + else { + last; + } + } + } + if ($line =~ /^@\@$/) { + if ($device_name && $device_profile && ! $device_is_alt) { + push @{$devices{$device_profile}}, $device_name; + + if (scalar @device_alt_names) { + foreach my $device_alt_name (sort values @device_alt_names) { + push @{$devices{$device_profile}}, $device_alt_name; + } + } + } + + undef $device_name; + undef $device_profile; + undef $device_is_alt; + @device_alt_names = (); + } + } + close M; + } +} + sub get_targetinfo { foreach my $target_makefile (glob "target/linux/*/Makefile") { my ($target_dir) = $target_makefile =~ m!^(.+)/Makefile$!; @@ -86,6 +148,15 @@ sub get_targetinfo { } } +sub get_devices { + my ($target_subtarget) = @_; + my ($target, $subtarget) = split /\//, $target_subtarget; + + my ($target_dir) = "target/linux/" . $target; + + parse_devices($target_dir, $subtarget) +} + if (@ARGV == 1 && $ARGV[0] eq 'targets') { get_targetinfo(); foreach my $target_name (sort keys %targets) { @@ -104,8 +175,15 @@ sub get_targetinfo { printf "%s %s\n", $target_name, join ' ', @{$kernels{$target_name}}; } } +elsif (@ARGV == 2 && $ARGV[0] eq 'devices') { + get_devices($ARGV[1]); + foreach my $device (sort keys %devices) { + printf "%s \"%s\"\n", $device, join '" "', @{$devices{$device}}; + } +} else { print "Usage: $0 targets\n"; print "Usage: $0 architectures\n"; print "Usage: $0 kernels\n"; + print "Usage: $0 devices \n"; } diff --git a/target/linux/armsr/base-files.mk b/target/linux/armsr/base-files.mk new file mode 100644 index 00000000000..88ba97d38a3 --- /dev/null +++ b/target/linux/armsr/base-files.mk @@ -0,0 +1,8 @@ +GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL)) +ifeq ($(GRUB_SERIAL),) +$(error This platform requires CONFIG_GRUB_SERIAL be set!) +endif + +define Package/base-files/install-target + $(SED) "s#@GRUB_SERIAL@#$(GRUB_SERIAL)#" $(1)/etc/inittab +endef diff --git a/target/linux/armsr/base-files/etc/inittab b/target/linux/armsr/base-files/etc/inittab index 51832eb7756..87d5460d323 100644 --- a/target/linux/armsr/base-files/etc/inittab +++ b/target/linux/armsr/base-files/etc/inittab @@ -1,7 +1,7 @@ ::sysinit:/etc/init.d/rcS S boot ::shutdown:/etc/init.d/rcS K shutdown ttyAMA0::askfirst:/usr/libexec/login.sh -ttyS0::askfirst:/usr/libexec/login.sh +@GRUB_SERIAL@::askfirst:/usr/libexec/login.sh tty0::askfirst:/usr/libexec/login.sh hvc0::askfirst:/usr/libexec/login.sh ttymxc0::askfirst:/usr/libexec/login.sh diff --git a/target/linux/armsr/image/Makefile b/target/linux/armsr/image/Makefile index e2e3e555e06..f04313d3862 100644 --- a/target/linux/armsr/image/Makefile +++ b/target/linux/armsr/image/Makefile @@ -17,14 +17,10 @@ endif GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL)) -ifneq ($(GRUB_SERIAL),) - GRUB_SERIAL_CONFIG := serial --unit=0 --speed=$(CONFIG_GRUB_BAUDRATE) --word=8 --parity=no --stop=1 --rtscts=$(if $(CONFIG_GRUB_FLOWCONTROL),on,off) - GRUB_TERMINALS += serial -endif +GRUB_SERIAL_CONFIG := serial --unit=0 --speed=$(CONFIG_GRUB_BAUDRATE) --word=8 --parity=no --stop=1 --rtscts=$(if $(CONFIG_GRUB_FLOWCONTROL),on,off) +GRUB_TERMINALS += serial -ifneq ($(GRUB_TERMINALS),) - GRUB_TERMINAL_CONFIG := terminal_input $(GRUB_TERMINALS); terminal_output $(GRUB_TERMINALS) -endif +GRUB_TERMINAL_CONFIG := terminal_input $(GRUB_TERMINALS); terminal_output $(GRUB_TERMINALS) ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME)) ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(IMG_PART_SIGNATURE)-02) diff --git a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts index de6b709b5cb..6286f203efc 100644 --- a/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts +++ b/target/linux/ath79/dts/ar9331_embeddedwireless_dorin.dts @@ -85,6 +85,18 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_1002: macaddr@1002 { + compatible = "mac-base"; + reg = <0x1002 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -93,10 +105,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 0x400000>; nvmem-cell-names = "mac-address"; - mac-address-increment-byte = <3>; - mac-address-increment = <0x40>; }; &mdio1 { @@ -108,13 +118,3 @@ mtd-cal-data = <&art 0x1000>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; - }; -}; diff --git a/target/linux/ath79/dts/ar9344_embeddedwireless_balin.dts b/target/linux/ath79/dts/ar9344_embeddedwireless_balin.dts index a84c273f862..de138658180 100644 --- a/target/linux/ath79/dts/ar9344_embeddedwireless_balin.dts +++ b/target/linux/ath79/dts/ar9344_embeddedwireless_balin.dts @@ -83,16 +83,20 @@ reg = <0xff0000 0x010000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - calibration_art_1000: calibration_data@1000 { - reg = <0x1000 0x440>; - }; - - macaddr_art_1002: macaddr@1002 { - reg = <0x1002 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_art_1000: calibration_data@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_1002: macaddr@1002 { + compatible = "mac-base"; + reg = <0x1002 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; @@ -106,10 +110,8 @@ ð1 { status = "okay"; - nvmem-cells = <&macaddr_art_1002>; + nvmem-cells = <&macaddr_art_1002 0x400000>; nvmem-cell-names = "mac-address"; - mac-address-increment-byte = <3>; - mac-address-increment = <0x40>; gmac-config { device = <&gmac>; @@ -121,7 +123,7 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_art_1002>, <&calibration_art_1000>; + nvmem-cells = <&macaddr_art_1002 0>, <&calibration_art_1000>; nvmem-cell-names = "mac-address", "calibration"; }; diff --git a/target/linux/ath79/dts/qca9563_dlink_covr-p2500-a1.dts b/target/linux/ath79/dts/qca9563_dlink_covr-p2500-a1.dts new file mode 100644 index 00000000000..43113ea7b56 --- /dev/null +++ b/target/linux/ath79/dts/qca9563_dlink_covr-p2500-a1.dts @@ -0,0 +1,211 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include +#include +#include + +/ { + compatible = "dlink,covr-p2500-a1", "qca,qca9563"; + model = "D-Link COVR-P2500 A1"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_red; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&jtag_disable_pins>; + + lan { + label = "green:lan"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + + led_power_green: power_green { + label = "green:power"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan5g { + label = "green:wlan5g"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0radio"; + }; + + led_power_red: power_red { + label = "red:power"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "green:wlan2g"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1radio"; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + compatible = "openwrt,uimage", "denx,uimage"; + openwrt,ih-magic = <0x68737173>; + label = "firmware"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x40000 0x10000>; + read-only; + }; + + fwconcat0: partition@50000 { + label = "fwconcat0"; + reg = <0x50000 0xe30000>; + }; + + partition@e80000 { + label = "loader"; + reg = <0xe80000 0x10000>; + read-only; + }; + + fwconcat1: partition@e90000 { + label = "fwconcat1"; + reg = <0xe90000 0x160000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x10000>; + read-only; + + compatible = "nvmem-cells"; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + calibration_ath9k: calibration@1000 { + reg = <0x1000 0x440>; + }; + + precalibration_ath10k: pre-calibration@5000 { + reg = <0x5000 0x2f20>; + }; + }; + }; + }; + }; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + + nvmem-cells = <&precalibration_ath10k>; + nvmem-cell-names = "pre-calibration"; + }; +}; + +&gpio { + phy-reset { + gpio-hog; + gpios = <11 GPIO_ACTIVE_LOW>; + output-low; + line-name = "phy-reset"; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + qca,mib-poll-interval = <500>; + + qca,ar8327-initvals = < + 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ + 0x10 0x81000080 /* POWER_ON_STRAP */ + 0x50 0xcc35cc35 /* LED_CTRL0 */ + 0x54 0xcb37cb37 /* LED_CTRL1 */ + 0x58 0x00000000 /* LED_CTRL2 */ + 0x5c 0x00f3cf00 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x03000101 0x00000101 0x00001919>; + + phy-mode = "sgmii"; + phy-handle = <&phy0>; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&calibration_ath9k>; + nvmem-cell-names = "calibration"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 4ee347c1415..c1d411b9a9c 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -230,6 +230,9 @@ devolo,dlan-pro-1200plus-ac|\ devolo,magic-2-wifi) ucidef_set_led_netdev "plcw" "dLAN" "white:dlan" "eth0.1" "rx" ;; +dlink,covr-p2500-a1) + ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x0e" "" "link" + ;; dlink,dap-1330-a1|\ dlink,dap-1365-a1) ucidef_set_rssimon "wlan0" "200000" "1" diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 5d87ea8405d..a9b78e4350d 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -286,6 +286,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:wan" "3:lan" "4:lan" ;; + dlink,covr-p2500-a1) + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan" "2:lan" "3:wan" "4:plc" + ;; dlink,dap-2695-a1) ucidef_add_switch "switch0" \ "0@eth0" "2:lan" "3:wan" "6@eth1" @@ -634,6 +638,13 @@ ath79_setup_macs() devolo,magic-2-wifi) label_mac=$(macaddr_add "$(mtd_get_mac_binary art 0x1002)" 3) ;; + dlink,covr-p2500-a1) + lan_mac=$(mtd_get_mac_ascii art "protest_lan_mac") + wan_mac=$(mtd_get_mac_ascii art "protest_lan_mac") + label_mac=$(mtd_get_mac_ascii art "protest_plc_mac") + plc_mac=$(mtd_get_mac_ascii art "protest_plc_mac") + [ -n "$plc_mac" ] && ucidef_set_interface_macaddr "plc" $plc_mac + ;; dlink,dap-1330-a1|\ dlink,dap-1365-a1|\ dlink,dch-g020-a1) diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 5d74208a5d8..ccff35e5c63 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -17,6 +17,12 @@ case "$board" in adtran,bsap1840) macaddr_add "$(mtd_get_mac_binary 'Board data' 2)" $(($PHYNBR * 8 + 1)) > /sys${DEVPATH}/macaddress ;; + dlink,covr-p2500-a1) + [ "$PHYNBR" -eq 0 ] && \ + mtd_get_mac_ascii art "protest_ath1_mac" > /sys${DEVPATH}/macaddress + [ "$PHYNBR" -eq 1 ] && \ + mtd_get_mac_ascii art "protest_ath0_mac" > /sys${DEVPATH}/macaddress + ;; dlink,dap-1330-a1|\ dlink,dap-1365-a1|\ dlink,dch-g020-a1) diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index a645040902d..dd76bd9d6fc 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -33,6 +33,17 @@ define Build/cybertan-trx -rm $@-empty.bin endef +define Build/dlink-sge-signature + ( \ + crc=$$(gzip -c $@ | tail -c 8 | od -An -tx4 --endian little | cut -d " " -f2); \ + cat $@; \ + $(MKHASH) md5 $@ ; \ + echo $(1); \ + echo -n $$crc; \ + ) > $@.new + mv $@.new $@ +endef + define Build/edimax-headers $(eval edimax_magic=$(word 1,$(1))) $(eval edimax_model=$(word 2,$(1))) @@ -995,6 +1006,26 @@ define Device/devolo_magic-2-wifi endef TARGET_DEVICES += devolo_magic-2-wifi +define Device/dlink_covr-p2500-a1 + $(Device/loader-okli-uimage) + SOC := qca9563 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := COVR-P2500 + DEVICE_VARIANT := A1 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct + LOADER_FLASH_OFFS := 0x050000 + LOADER_KERNEL_MAGIC := 0x68737173 + KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x68737173 + IMAGE_SIZE := 14528k + IMAGES += factory.bin recovery.bin + IMAGE/recovery.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | pad-to 14528k | \ + append-loader-okli-uimage $(1) | pad-to 15616k + IMAGE/factory.bin := $$(IMAGE/recovery.bin) | \ + dlink-sge-image COVR-P2500 | dlink-sge-signature COVR-P2500 +endef +TARGET_DEVICES += dlink_covr-p2500-a1 + define Device/dlink_dap-13xx SOC := qca9533 DEVICE_VENDOR := D-Link diff --git a/target/linux/bmips/dts/bcm63167-sercomm-h500-s.dtsi b/target/linux/bmips/dts/bcm63167-sercomm-h500-s.dtsi index 95f330d6c53..4e4431f27ce 100644 --- a/target/linux/bmips/dts/bcm63167-sercomm-h500-s.dtsi +++ b/target/linux/bmips/dts/bcm63167-sercomm-h500-s.dtsi @@ -187,6 +187,16 @@ label = "cferom"; reg = <0x0000000 0x0020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cferom_6a0: macaddr@6a0 { + reg = <0x6a0 0x6>; + }; + }; }; partition@20000 { @@ -284,13 +294,3 @@ &usbh { status = "okay"; }; - -&cferom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cferom_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm63168-comtrend-vr-3032u.dts b/target/linux/bmips/dts/bcm63168-comtrend-vr-3032u.dts index 5196f90afa8..d4520661a58 100644 --- a/target/linux/bmips/dts/bcm63168-comtrend-vr-3032u.dts +++ b/target/linux/bmips/dts/bcm63168-comtrend-vr-3032u.dts @@ -170,6 +170,16 @@ label = "cferom"; reg = <0x0000000 0x0020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cferom_6a0: macaddr@6a0 { + reg = <0x6a0 0x6>; + }; + }; }; partition@20000 { @@ -228,13 +238,3 @@ &usbh { status = "okay"; }; - -&cferom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cferom_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm63168-sercomm-shg2500.dts b/target/linux/bmips/dts/bcm63168-sercomm-shg2500.dts index 7b0ebf2aefc..bfa9835b26e 100644 --- a/target/linux/bmips/dts/bcm63168-sercomm-shg2500.dts +++ b/target/linux/bmips/dts/bcm63168-sercomm-shg2500.dts @@ -46,9 +46,8 @@ pci-bus = <1>; pci-dev = <0>; - nvmem-cells = <&macaddr_cferom_6a0>; + nvmem-cells = <&macaddr_cferom_6a0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; brcm,sprom = "brcm/bcm4360-sprom.bin"; }; @@ -61,7 +60,7 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_cferom_6a0>; + nvmem-cells = <&macaddr_cferom_6a0 0>; nvmem-cell-names = "mac-address"; }; @@ -196,6 +195,18 @@ label = "cferom"; reg = <0x0000000 0x0020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cferom_6a0: macaddr@6a0 { + compatible = "mac-base"; + reg = <0x6a0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -309,13 +320,3 @@ &usbh { status = "okay"; }; - -&cferom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cferom_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm63169-comtrend-vg-8050.dts b/target/linux/bmips/dts/bcm63169-comtrend-vg-8050.dts index bf96673af8a..be7f90fbd93 100644 --- a/target/linux/bmips/dts/bcm63169-comtrend-vg-8050.dts +++ b/target/linux/bmips/dts/bcm63169-comtrend-vg-8050.dts @@ -185,6 +185,16 @@ label = "cferom"; reg = <0x0000000 0x0020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cferom_6a0: macaddr@6a0 { + reg = <0x6a0 0x6>; + }; + }; }; partition@20000 { @@ -225,13 +235,3 @@ &usbh { status = "okay"; }; - -&cferom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cferom_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6318-comtrend-ar-5315u.dts b/target/linux/bmips/dts/bcm6318-comtrend-ar-5315u.dts index 45ed6e2a3b7..3321bbd0045 100644 --- a/target/linux/bmips/dts/bcm6318-comtrend-ar-5315u.dts +++ b/target/linux/bmips/dts/bcm6318-comtrend-ar-5315u.dts @@ -38,9 +38,8 @@ pci-bus = <1>; pci-dev = <0>; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; brcm,sprom = "brcm/bcm43217-sprom.bin"; brcm,sprom-fixups = <6 0x1c00>, @@ -64,7 +63,7 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 0>; nvmem-cell-names = "mac-address"; }; @@ -90,6 +89,18 @@ reg = <0x000000 0x010000>; label = "cfe"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + compatible = "mac-base"; + reg = <0x6a0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@10000 { @@ -247,13 +258,3 @@ &usbh { status = "okay"; }; - -&cfe { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cfe_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6328-arcadyan-ar7516.dts b/target/linux/bmips/dts/bcm6328-arcadyan-ar7516.dts index cc50f575499..779f1da1b9f 100644 --- a/target/linux/bmips/dts/bcm6328-arcadyan-ar7516.dts +++ b/target/linux/bmips/dts/bcm6328-arcadyan-ar7516.dts @@ -36,9 +36,8 @@ pci-bus = <1>; pci-dev = <0>; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; brcm,sprom = "brcm/bcm43227-sprom.bin"; }; @@ -51,7 +50,7 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 0>; nvmem-cell-names = "mac-address"; }; @@ -74,6 +73,18 @@ label = "cfe"; reg = <0x000000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + compatible = "mac-base"; + reg = <0x6a0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@10000 { @@ -174,13 +185,3 @@ &usbh { status = "okay"; }; - -&cfe { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cfe_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6328-comtrend-ar-5381u.dts b/target/linux/bmips/dts/bcm6328-comtrend-ar-5381u.dts index 7499e7090ff..fc7462810c9 100644 --- a/target/linux/bmips/dts/bcm6328-comtrend-ar-5381u.dts +++ b/target/linux/bmips/dts/bcm6328-comtrend-ar-5381u.dts @@ -31,9 +31,8 @@ pci-bus = <1>; pci-dev = <0>; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; brcm,sprom = "brcm/bcm43225-sprom.bin"; brcm,sprom-fixups = <97 0xfee5>, @@ -52,7 +51,7 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 0>; nvmem-cell-names = "mac-address"; }; @@ -78,6 +77,18 @@ reg = <0x000000 0x010000>; label = "cfe"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + compatible = "mac-base"; + reg = <0x6a0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@10000 { @@ -178,13 +189,3 @@ &usbh { status = "okay"; }; - -&cfe { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cfe_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6328-comtrend-ar-5387un.dts b/target/linux/bmips/dts/bcm6328-comtrend-ar-5387un.dts index a0d1c117f74..ba15a642654 100644 --- a/target/linux/bmips/dts/bcm6328-comtrend-ar-5387un.dts +++ b/target/linux/bmips/dts/bcm6328-comtrend-ar-5387un.dts @@ -31,9 +31,8 @@ pci-bus = <1>; pci-dev = <0>; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; brcm,sprom = "brcm/bcm43225-sprom.bin"; brcm,sprom-fixups = <2 0x05bb>, @@ -70,7 +69,7 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 0>; nvmem-cell-names = "mac-address"; }; @@ -96,6 +95,18 @@ reg = <0x000000 0x010000>; label = "cfe"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + compatible = "mac-base"; + reg = <0x6a0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@10000 { @@ -205,13 +216,3 @@ &usbh { status = "okay"; }; - -&cfe { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cfe_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6328-nucom-r5010unv2.dts b/target/linux/bmips/dts/bcm6328-nucom-r5010unv2.dts index 826b2a61e25..b9cbae7af8e 100644 --- a/target/linux/bmips/dts/bcm6328-nucom-r5010unv2.dts +++ b/target/linux/bmips/dts/bcm6328-nucom-r5010unv2.dts @@ -38,9 +38,8 @@ pci-bus = <1>; pci-dev = <0>; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; brcm,sprom = "brcm/bcm43217-sprom.bin"; }; @@ -53,7 +52,7 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 0>; nvmem-cell-names = "mac-address"; }; @@ -76,6 +75,18 @@ label = "cfe"; reg = <0x000000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + compatible = "mac-base"; + reg = <0x6a0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@10000 { @@ -204,13 +215,3 @@ &usbh { status = "okay"; }; - -&cfe { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cfe_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6328-sercomm-ad1018.dts b/target/linux/bmips/dts/bcm6328-sercomm-ad1018.dts index 5d182668188..aefa72235f1 100644 --- a/target/linux/bmips/dts/bcm6328-sercomm-ad1018.dts +++ b/target/linux/bmips/dts/bcm6328-sercomm-ad1018.dts @@ -45,9 +45,8 @@ pci-bus = <1>; pci-dev = <0>; - nvmem-cells = <&macaddr_cferom_6a0>; + nvmem-cells = <&macaddr_cferom_6a0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; brcm,sprom = "brcm/bcm43217-sprom.bin"; brcm,sprom-fixups = <6 0x1c00>, @@ -77,7 +76,7 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_cferom_6a0>; + nvmem-cells = <&macaddr_cferom_6a0 0>; nvmem-cell-names = "mac-address"; }; @@ -192,6 +191,18 @@ label = "cferom"; reg = <0x0000000 0x0020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cferom_6a0: macaddr@6a0 { + compatible = "mac-base"; + reg = <0x6a0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -300,13 +311,3 @@ &usbh { status = "okay"; }; - -&cferom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cferom_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts b/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts index d5f162846d2..c30612191eb 100644 --- a/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts +++ b/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts @@ -134,7 +134,7 @@ ðernet1 { status = "okay"; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 0>; nvmem-cell-names = "mac-address"; phy-mode = "mii"; @@ -162,9 +162,8 @@ qca,no-eeprom; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; #gpio-cells = <2>; gpio-controller; @@ -183,6 +182,18 @@ label = "cfe"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + compatible = "mac-base"; + reg = <0x6a0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -195,6 +206,16 @@ label = "cal_data"; reg = <0xee0000 0x100000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_data_1e000: cal@1e000 { + reg = <0x1e000 0xeb8>; + }; + }; }; partition@fe0000 { @@ -211,23 +232,3 @@ &usbh { status = "okay"; }; - -&cal_data { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_data_1e000: cal@1e000 { - reg = <0x1e000 0xeb8>; - }; -}; - -&cfe { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cfe_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6362-huawei-hg253s-v2.dts b/target/linux/bmips/dts/bcm6362-huawei-hg253s-v2.dts index f562bcd9b2b..47be99133d3 100644 --- a/target/linux/bmips/dts/bcm6362-huawei-hg253s-v2.dts +++ b/target/linux/bmips/dts/bcm6362-huawei-hg253s-v2.dts @@ -164,6 +164,16 @@ label = "cferom"; reg = <0x0000000 0x0020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cferom_6a0: macaddr@6a0 { + reg = <0x6a0 0x6>; + }; + }; }; partition@20000 { @@ -224,13 +234,3 @@ &usbh { status = "okay"; }; - -&cferom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cferom_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6362-netgear-dgnd3700-v2.dts b/target/linux/bmips/dts/bcm6362-netgear-dgnd3700-v2.dts index a335218be07..53a1c0c01fc 100644 --- a/target/linux/bmips/dts/bcm6362-netgear-dgnd3700-v2.dts +++ b/target/linux/bmips/dts/bcm6362-netgear-dgnd3700-v2.dts @@ -216,6 +216,16 @@ label = "cferom"; reg = <0x0000000 0x0004000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cferom_6a0: macaddr@6a0 { + reg = <0x6a0 0x6>; + }; + }; }; partition@4000 { @@ -298,13 +308,3 @@ &usbh { status = "okay"; }; - -&cferom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cferom_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6368-actiontec-r1000h.dts b/target/linux/bmips/dts/bcm6368-actiontec-r1000h.dts index ff115afb8fb..c5e2e7f67f5 100644 --- a/target/linux/bmips/dts/bcm6368-actiontec-r1000h.dts +++ b/target/linux/bmips/dts/bcm6368-actiontec-r1000h.dts @@ -178,6 +178,16 @@ label = "CFE"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + reg = <0x6a0 0x6>; + }; + }; }; partition@20000 { @@ -208,13 +218,3 @@ &usbh { status = "okay"; }; - -&cfe { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cfe_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6368-comtrend-vr-3025u.dts b/target/linux/bmips/dts/bcm6368-comtrend-vr-3025u.dts index e67db8b6bde..eecf3806f2c 100644 --- a/target/linux/bmips/dts/bcm6368-comtrend-vr-3025u.dts +++ b/target/linux/bmips/dts/bcm6368-comtrend-vr-3025u.dts @@ -61,9 +61,8 @@ pci-bus = <0>; pci-dev = <1>; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; brcm,sprom = "brcm/bcm43222-sprom.bin"; brcm,sprom-fixups = <97 0xfeb3>, @@ -82,7 +81,7 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 0>; nvmem-cell-names = "mac-address"; }; @@ -106,6 +105,18 @@ label = "CFE"; reg = <0x0000000 0x0020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + compatible = "mac-base"; + reg = <0x6a0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -170,13 +181,3 @@ &usbh { status = "okay"; }; - -&cfe { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cfe_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6368-comtrend-vr-3025un.dts b/target/linux/bmips/dts/bcm6368-comtrend-vr-3025un.dts index 3256783e0e8..fb86adb8991 100644 --- a/target/linux/bmips/dts/bcm6368-comtrend-vr-3025un.dts +++ b/target/linux/bmips/dts/bcm6368-comtrend-vr-3025un.dts @@ -61,9 +61,8 @@ pci-bus = <0>; pci-dev = <1>; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; brcm,sprom = "brcm/bcm43222-sprom.bin"; brcm,sprom-fixups = <97 0xfeb3>, @@ -82,7 +81,7 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 0>; nvmem-cell-names = "mac-address"; }; @@ -106,6 +105,18 @@ label = "CFE"; reg = <0x000000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + compatible = "mac-base"; + reg = <0x6a0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -170,13 +181,3 @@ &usbh { status = "okay"; }; - -&cfe { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cfe_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6368-netgear-dgnd3700.dtsi b/target/linux/bmips/dts/bcm6368-netgear-dgnd3700.dtsi index c878dd2cffa..97836e92e03 100644 --- a/target/linux/bmips/dts/bcm6368-netgear-dgnd3700.dtsi +++ b/target/linux/bmips/dts/bcm6368-netgear-dgnd3700.dtsi @@ -207,6 +207,16 @@ label = "CFE"; reg = <0x0000000 0x0020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + reg = <0x6a0 0x6>; + }; + }; }; partition@20000 { @@ -253,13 +263,3 @@ &usbh { status = "okay"; }; - -&cfe { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cfe_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6368-observa-vh4032n.dts b/target/linux/bmips/dts/bcm6368-observa-vh4032n.dts index 14fbd856f8f..8d6135fbdd1 100644 --- a/target/linux/bmips/dts/bcm6368-observa-vh4032n.dts +++ b/target/linux/bmips/dts/bcm6368-observa-vh4032n.dts @@ -83,9 +83,8 @@ pci-bus = <0>; pci-dev = <1>; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; brcm,sprom = "brcm/bcm43222-sprom.bin"; brcm,sprom-fixups = <2 0x04d2>, <4 0x4350>, @@ -124,7 +123,7 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 0>; nvmem-cell-names = "mac-address"; }; @@ -157,6 +156,18 @@ label = "CFE"; reg = <0x0000000 0x0020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + compatible = "mac-base"; + reg = <0x6a0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -221,13 +232,3 @@ &usbh { status = "okay"; }; - -&cfe { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cfe_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6369-comtrend-wap-5813n.dts b/target/linux/bmips/dts/bcm6369-comtrend-wap-5813n.dts index 517a894cf50..53d20ecba32 100644 --- a/target/linux/bmips/dts/bcm6369-comtrend-wap-5813n.dts +++ b/target/linux/bmips/dts/bcm6369-comtrend-wap-5813n.dts @@ -80,9 +80,8 @@ pci-bus = <0>; pci-dev = <1>; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; brcm,sprom = "brcm/bcm4322-sprom.bin"; brcm,sprom-fixups = <97 0xfeed>, @@ -101,7 +100,7 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 0>; nvmem-cell-names = "mac-address"; }; @@ -170,6 +169,18 @@ label = "CFE"; reg = <0x000000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + compatible = "mac-base"; + reg = <0x6a0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -218,13 +229,3 @@ &usbh { status = "okay"; }; - -&cfe { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cfe_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/bmips/dts/bcm6369-netgear-evg2000.dts b/target/linux/bmips/dts/bcm6369-netgear-evg2000.dts index 460c88f755c..db7f9b0e5b6 100644 --- a/target/linux/bmips/dts/bcm6369-netgear-evg2000.dts +++ b/target/linux/bmips/dts/bcm6369-netgear-evg2000.dts @@ -88,9 +88,8 @@ pci-bus = <0>; pci-dev = <1>; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; brcm,sprom = "brcm/bcm4322-sprom.bin"; brcm,sprom-fixups = <219 0xec08>; @@ -104,7 +103,7 @@ ðernet { status = "okay"; - nvmem-cells = <&macaddr_cfe_6a0>; + nvmem-cells = <&macaddr_cfe_6a0 0>; nvmem-cell-names = "mac-address"; }; @@ -189,6 +188,18 @@ label = "CFE"; reg = <0x000000 0x020000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_cfe_6a0: macaddr@6a0 { + compatible = "mac-base"; + reg = <0x6a0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -225,13 +236,3 @@ &usbh { status = "okay"; }; - -&cfe { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_cfe_6a0: macaddr@6a0 { - reg = <0x6a0 0x6>; - }; -}; diff --git a/target/linux/generic/config-6.1 b/target/linux/generic/config-6.1 index 76392d6904b..66c8c6fb4de 100644 --- a/target/linux/generic/config-6.1 +++ b/target/linux/generic/config-6.1 @@ -1514,6 +1514,7 @@ CONFIG_DEVPORT=y # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set # CONFIG_DEVTMPFS is not set # CONFIG_DEVTMPFS_MOUNT is not set +# CONFIG_DEVTMPFS_SAFE is not set # CONFIG_DEV_DAX is not set # CONFIG_DGAP is not set # CONFIG_DGNC is not set diff --git a/target/linux/generic/pending-5.15/682-of_net-add-mac-address-increment-support.patch b/target/linux/generic/pending-5.15/682-of_net-add-mac-address-increment-support.patch index f6ae9f31f1f..73eabf4f376 100644 --- a/target/linux/generic/pending-5.15/682-of_net-add-mac-address-increment-support.patch +++ b/target/linux/generic/pending-5.15/682-of_net-add-mac-address-increment-support.patch @@ -20,14 +20,12 @@ Signed-off-by: Ansuel Smith --- a/net/core/of_net.c +++ b/net/core/of_net.c -@@ -119,28 +119,63 @@ static int of_get_mac_addr_nvmem(struct +@@ -119,10 +119,19 @@ static int of_get_mac_addr_nvmem(struct * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists * but is all zeros. * + * DT can tell the system to increment the mac-address after is extracted by + * using: -+ * - mac-address-increment-byte to decide what byte to increase -+ * (if not defined is increased the last byte) + * - mac-address-increment to decide how much to increase. The value WILL + * overflow to other bytes if the increment is over 255 or the total + * increment will exceed 255 of the current byte. @@ -38,19 +36,11 @@ Signed-off-by: Ansuel Smith */ int of_get_mac_address(struct device_node *np, u8 *addr) { -+ u32 inc_idx, mac_inc, mac_val; ++ u32 mac_inc, mac_val; int ret; -+ /* Check first if the increment byte is present and valid. -+ * If not set assume to increment the last byte if found. -+ */ -+ if (of_property_read_u32(np, "mac-address-increment-byte", &inc_idx)) -+ inc_idx = 5; -+ if (inc_idx < 3 || inc_idx > 5) -+ return -EINVAL; -+ if (!np) - return -ENODEV; +@@ -130,17 +139,33 @@ int of_get_mac_address(struct device_nod ret = of_get_mac_addr(np, "mac-address", addr); if (!ret) @@ -75,7 +65,7 @@ Signed-off-by: Ansuel Smith + if (!of_property_read_u32(np, "mac-address-increment", &mac_inc)) { + /* Convert to a contiguous value */ + mac_val = (addr[3] << 16) + (addr[4] << 8) + addr[5]; -+ mac_val += mac_inc << 8 * (5-inc_idx); ++ mac_val += mac_inc; + + /* Apply the incremented value handling overflow case */ + addr[3] = (mac_val >> 16) & 0xff; diff --git a/target/linux/generic/pending-5.15/683-of_net-add-mac-address-to-of-tree.patch b/target/linux/generic/pending-5.15/683-of_net-add-mac-address-to-of-tree.patch index f7ef06a14ad..29144ce8b40 100644 --- a/target/linux/generic/pending-5.15/683-of_net-add-mac-address-to-of-tree.patch +++ b/target/linux/generic/pending-5.15/683-of_net-add-mac-address-to-of-tree.patch @@ -45,7 +45,7 @@ property. This way, the MAC address can be accessed using procfs. /** * of_get_mac_address() * @np: Caller's Device Node -@@ -175,6 +196,7 @@ found: +@@ -165,6 +186,7 @@ found: addr[5] = (mac_val >> 0) & 0xff; } diff --git a/target/linux/generic/pending-5.15/684-of_net-do-mac-address-increment-only-once.patch b/target/linux/generic/pending-5.15/684-of_net-do-mac-address-increment-only-once.patch index 44d88e31a2e..c37c4519899 100644 --- a/target/linux/generic/pending-5.15/684-of_net-do-mac-address-increment-only-once.patch +++ b/target/linux/generic/pending-5.15/684-of_net-do-mac-address-increment-only-once.patch @@ -16,16 +16,15 @@ Signed-off-by: Will Moss --- a/net/core/of_net.c +++ b/net/core/of_net.c -@@ -194,6 +194,12 @@ found: +@@ -184,6 +184,11 @@ found: addr[3] = (mac_val >> 16) & 0xff; addr[4] = (mac_val >> 8) & 0xff; addr[5] = (mac_val >> 0) & 0xff; + -+ /* Remove mac-address-increment and mac-address-increment-byte -+ * DT property to make sure MAC address would not get incremented -+ * more if this function is stared again. */ ++ /* Remove mac-address-increment DT property to make sure MAC ++ * address would not get incremented more if this function is ++ * stared again. */ + of_remove_property(np, of_find_property(np, "mac-address-increment", NULL)); -+ of_remove_property(np, of_find_property(np, "mac-address-increment-byte", NULL)); } of_add_mac_address(np, addr); diff --git a/target/linux/generic/pending-6.1/682-of_net-add-mac-address-increment-support.patch b/target/linux/generic/pending-6.1/682-of_net-add-mac-address-increment-support.patch index f6ae9f31f1f..73eabf4f376 100644 --- a/target/linux/generic/pending-6.1/682-of_net-add-mac-address-increment-support.patch +++ b/target/linux/generic/pending-6.1/682-of_net-add-mac-address-increment-support.patch @@ -20,14 +20,12 @@ Signed-off-by: Ansuel Smith --- a/net/core/of_net.c +++ b/net/core/of_net.c -@@ -119,28 +119,63 @@ static int of_get_mac_addr_nvmem(struct +@@ -119,10 +119,19 @@ static int of_get_mac_addr_nvmem(struct * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists * but is all zeros. * + * DT can tell the system to increment the mac-address after is extracted by + * using: -+ * - mac-address-increment-byte to decide what byte to increase -+ * (if not defined is increased the last byte) + * - mac-address-increment to decide how much to increase. The value WILL + * overflow to other bytes if the increment is over 255 or the total + * increment will exceed 255 of the current byte. @@ -38,19 +36,11 @@ Signed-off-by: Ansuel Smith */ int of_get_mac_address(struct device_node *np, u8 *addr) { -+ u32 inc_idx, mac_inc, mac_val; ++ u32 mac_inc, mac_val; int ret; -+ /* Check first if the increment byte is present and valid. -+ * If not set assume to increment the last byte if found. -+ */ -+ if (of_property_read_u32(np, "mac-address-increment-byte", &inc_idx)) -+ inc_idx = 5; -+ if (inc_idx < 3 || inc_idx > 5) -+ return -EINVAL; -+ if (!np) - return -ENODEV; +@@ -130,17 +139,33 @@ int of_get_mac_address(struct device_nod ret = of_get_mac_addr(np, "mac-address", addr); if (!ret) @@ -75,7 +65,7 @@ Signed-off-by: Ansuel Smith + if (!of_property_read_u32(np, "mac-address-increment", &mac_inc)) { + /* Convert to a contiguous value */ + mac_val = (addr[3] << 16) + (addr[4] << 8) + addr[5]; -+ mac_val += mac_inc << 8 * (5-inc_idx); ++ mac_val += mac_inc; + + /* Apply the incremented value handling overflow case */ + addr[3] = (mac_val >> 16) & 0xff; diff --git a/target/linux/generic/pending-6.1/683-of_net-add-mac-address-to-of-tree.patch b/target/linux/generic/pending-6.1/683-of_net-add-mac-address-to-of-tree.patch index f7ef06a14ad..29144ce8b40 100644 --- a/target/linux/generic/pending-6.1/683-of_net-add-mac-address-to-of-tree.patch +++ b/target/linux/generic/pending-6.1/683-of_net-add-mac-address-to-of-tree.patch @@ -45,7 +45,7 @@ property. This way, the MAC address can be accessed using procfs. /** * of_get_mac_address() * @np: Caller's Device Node -@@ -175,6 +196,7 @@ found: +@@ -165,6 +186,7 @@ found: addr[5] = (mac_val >> 0) & 0xff; } diff --git a/target/linux/generic/pending-6.1/684-of_net-do-mac-address-increment-only-once.patch b/target/linux/generic/pending-6.1/684-of_net-do-mac-address-increment-only-once.patch index 44d88e31a2e..c37c4519899 100644 --- a/target/linux/generic/pending-6.1/684-of_net-do-mac-address-increment-only-once.patch +++ b/target/linux/generic/pending-6.1/684-of_net-do-mac-address-increment-only-once.patch @@ -16,16 +16,15 @@ Signed-off-by: Will Moss --- a/net/core/of_net.c +++ b/net/core/of_net.c -@@ -194,6 +194,12 @@ found: +@@ -184,6 +184,11 @@ found: addr[3] = (mac_val >> 16) & 0xff; addr[4] = (mac_val >> 8) & 0xff; addr[5] = (mac_val >> 0) & 0xff; + -+ /* Remove mac-address-increment and mac-address-increment-byte -+ * DT property to make sure MAC address would not get incremented -+ * more if this function is stared again. */ ++ /* Remove mac-address-increment DT property to make sure MAC ++ * address would not get incremented more if this function is ++ * stared again. */ + of_remove_property(np, of_find_property(np, "mac-address-increment", NULL)); -+ of_remove_property(np, of_find_property(np, "mac-address-increment-byte", NULL)); } of_add_mac_address(np, addr); diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds index 511adc5a50f..0b2ce2b7d55 100644 --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds @@ -10,15 +10,15 @@ board=$(board_name) case "$board" in askey,rt4230w-rev6) - ucidef_set_led_netdev "wan-port-link" "WAN-PORT-LINK" "qca8k-0.0:00:green:wan" "wan" "link-10 link-100 link-1000" + ucidef_set_led_netdev "wan-port-link" "WAN-PORT-LINK" "qca8k-0.0:00:green:wan" "wan" "link_10 link_100 link_1000" ucidef_set_led_netdev "wan-port-activity" "WAN-PORT-ACTIVITY" "qca8k-0.0:00:amber:wan" "wan" "tx rx" - ucidef_set_led_netdev "lan1-port-link" "LAN1-PORT-LINK" "qca8k-0.0:01:green:lan" "lan1" "link-10 link-100 link-1000" + ucidef_set_led_netdev "lan1-port-link" "LAN1-PORT-LINK" "qca8k-0.0:01:green:lan" "lan1" "link_10 link_100 link_1000" ucidef_set_led_netdev "lan1-port-activity" "LAN1-PORT-ACTIVITY" "qca8k-0.0:01:amber:lan" "lan1" "tx rx" - ucidef_set_led_netdev "lan2-port-link" "LAN2-PORT-LINK" "qca8k-0.0:02:green:lan" "lan2" "link-10 link-100 link-1000" + ucidef_set_led_netdev "lan2-port-link" "LAN2-PORT-LINK" "qca8k-0.0:02:green:lan" "lan2" "link_10 link_100 link_1000" ucidef_set_led_netdev "lan2-port-activity" "LAN2-PORT-ACTIVITY" "qca8k-0.0:02:amber:lan" "lan2" "tx rx" - ucidef_set_led_netdev "lan3-port-link" "LAN3-PORT-LINK" "qca8k-0.0:03:green:lan" "lan3" "link-10 link-100 link-1000" + ucidef_set_led_netdev "lan3-port-link" "LAN3-PORT-LINK" "qca8k-0.0:03:green:lan" "lan3" "link_10 link_100 link_1000" ucidef_set_led_netdev "lan3-port-activity" "LAN3-PORT-ACTIVITY" "qca8k-0.0:03:amber:lan" "lan3" "tx rx" - ucidef_set_led_netdev "lan4-port-link" "LAN4-PORT-LINK" "qca8k-0.0:04:green:lan" "lan4" "link-10 link-100 link-1000" + ucidef_set_led_netdev "lan4-port-link" "LAN4-PORT-LINK" "qca8k-0.0:04:green:lan" "lan4" "link_10 link_100 link_1000" ucidef_set_led_netdev "lan4-port-activity" "LAN4-PORT-ACTIVITY" "qca8k-0.0:04:amber:lan" "lan4" "tx rx" ;; buffalo,wxr-2533dhp) @@ -48,21 +48,21 @@ nec,wg2600hp) ;; nec,wg2600hp3) ucidef_set_led_netdev "wan" "WAN" "green:active" "wan" - ucidef_set_led_netdev "wan-port-10" "WAN-PORT-10" "qca8k-0.0:00:green:wan-1" "wan" "tx rx link-10" - ucidef_set_led_netdev "wan-port-100" "WAN-PORT-100" "qca8k-0.0:00:green:wan-2" "wan" "tx rx link-100" - ucidef_set_led_netdev "wan-port-1000" "WAN-PORT-1000" "qca8k-0.0:00:green:wan-3" "wan" "tx rx link-1000" - ucidef_set_led_netdev "lan1-port-10" "LAN1-PORT-10" "qca8k-0.0:01:green:lan-1" "lan1" "tx rx link-10" - ucidef_set_led_netdev "lan1-port-100" "LAN1-PORT-100" "qca8k-0.0:01:green:lan-2" "lan1" "tx rx link-100" - ucidef_set_led_netdev "lan1-port-1000" "LAN1-PORT-1000" "qca8k-0.0:01:green:lan-3" "lan1" "tx rx link-1000" - ucidef_set_led_netdev "lan2-port-10" "LAN2-PORT-10" "qca8k-0.0:02:green:lan-1" "lan2" "tx rx link-10" - ucidef_set_led_netdev "lan2-port-100" "LAN2-PORT-100" "qca8k-0.0:02:green:lan-2" "lan2" "tx rx link-100" - ucidef_set_led_netdev "lan2-port-1000" "LAN2-PORT-1000" "qca8k-0.0:02:green:lan-3" "lan2" "tx rx link-1000" - ucidef_set_led_netdev "lan3-port-10" "LAN3-PORT-10" "qca8k-0.0:03:green:lan-1" "lan3" "tx rx link-10" - ucidef_set_led_netdev "lan3-port-100" "LAN3-PORT-100" "qca8k-0.0:03:green:lan-2" "lan3" "tx rx link-100" - ucidef_set_led_netdev "lan3-port-1000" "LAN3-PORT-1000" "qca8k-0.0:03:green:lan-3" "lan3" "tx rx link-1000" - ucidef_set_led_netdev "lan4-port-10" "LAN4-PORT-10" "qca8k-0.0:04:green:lan-1" "lan4" "tx rx link-10" - ucidef_set_led_netdev "lan4-port-100" "LAN4-PORT-100" "qca8k-0.0:04:green:lan-2" "lan4" "tx rx link-100" - ucidef_set_led_netdev "lan4-port-1000" "LAN4-PORT-1000" "qca8k-0.0:04:green:lan-3" "lan4" "tx rx link-1000" + ucidef_set_led_netdev "wan-port-10" "WAN-PORT-10" "qca8k-0.0:00:green:wan-1" "wan" "tx rx link_10" + ucidef_set_led_netdev "wan-port-100" "WAN-PORT-100" "qca8k-0.0:00:green:wan-2" "wan" "tx rx link_100" + ucidef_set_led_netdev "wan-port-1000" "WAN-PORT-1000" "qca8k-0.0:00:green:wan-3" "wan" "tx rx link_1000" + ucidef_set_led_netdev "lan1-port-10" "LAN1-PORT-10" "qca8k-0.0:01:green:lan-1" "lan1" "tx rx link_10" + ucidef_set_led_netdev "lan1-port-100" "LAN1-PORT-100" "qca8k-0.0:01:green:lan-2" "lan1" "tx rx link_100" + ucidef_set_led_netdev "lan1-port-1000" "LAN1-PORT-1000" "qca8k-0.0:01:green:lan-3" "lan1" "tx rx link_1000" + ucidef_set_led_netdev "lan2-port-10" "LAN2-PORT-10" "qca8k-0.0:02:green:lan-1" "lan2" "tx rx link_10" + ucidef_set_led_netdev "lan2-port-100" "LAN2-PORT-100" "qca8k-0.0:02:green:lan-2" "lan2" "tx rx link_100" + ucidef_set_led_netdev "lan2-port-1000" "LAN2-PORT-1000" "qca8k-0.0:02:green:lan-3" "lan2" "tx rx link_1000" + ucidef_set_led_netdev "lan3-port-10" "LAN3-PORT-10" "qca8k-0.0:03:green:lan-1" "lan3" "tx rx link_10" + ucidef_set_led_netdev "lan3-port-100" "LAN3-PORT-100" "qca8k-0.0:03:green:lan-2" "lan3" "tx rx link_100" + ucidef_set_led_netdev "lan3-port-1000" "LAN3-PORT-1000" "qca8k-0.0:03:green:lan-3" "lan3" "tx rx link_1000" + ucidef_set_led_netdev "lan4-port-10" "LAN4-PORT-10" "qca8k-0.0:04:green:lan-1" "lan4" "tx rx link_10" + ucidef_set_led_netdev "lan4-port-100" "LAN4-PORT-100" "qca8k-0.0:04:green:lan-2" "lan4" "tx rx link_100" + ucidef_set_led_netdev "lan4-port-1000" "LAN4-PORT-1000" "qca8k-0.0:04:green:lan-3" "lan4" "tx rx link_1000" ;; netgear,d7800 |\ netgear,r7500 |\ diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts index 04f4b7cd023..0c669dcbfe6 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts @@ -319,22 +319,47 @@ label = "PRODUCTDATA"; reg = <0x02b0000 0x0030000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_factory_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_PRODUCTDATA_c: macaddr@c { + reg = <0xc 0x6>; + }; + + macaddr_PRODUCTDATA_12: macaddr@12 { + reg = <0x12 0x6>; + }; + }; }; partition@2e0000 { label = "ART"; reg = <0x02e0000 0x0040000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_ART_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_ART_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_ART_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_ART_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -691,28 +716,6 @@ }; }; -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_factory_6: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_PRODUCTDATA_c: macaddr@c { - reg = <0xc 0x6>; - }; - - macaddr_PRODUCTDATA_12: macaddr@12 { - reg = <0x12 0x6>; - }; -}; - &hs_phy_0 { status = "okay"; }; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi index c425c9cd2ed..f306201754e 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi @@ -162,16 +162,19 @@ label = "radio"; reg = <0x1b0000 0x40000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_radio_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_radio_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_radio_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_radio_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -189,6 +192,18 @@ label = "default-mac"; reg = <0x1ef0000 0x00200>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_defaultmac_8: macaddr@8 { + compatible = "mac-base"; + reg = <0x8 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@1ef0200 { @@ -304,9 +319,8 @@ compatible = "pci168c,0040"; reg = <0x00010000 0 0 0 0>; - nvmem-cells = <&macaddr_defaultmac_8>, <&precal_radio_1000>; + nvmem-cells = <&macaddr_defaultmac_8 (-1)>, <&precal_radio_1000>; nvmem-cell-names = "mac-address", "pre-calibration"; - mac-address-increment = <(-1)>; }; }; }; @@ -325,7 +339,7 @@ compatible = "pci168c,0040"; reg = <0x00010000 0 0 0 0>; - nvmem-cells = <&macaddr_defaultmac_8>, <&precal_radio_5000>; + nvmem-cells = <&macaddr_defaultmac_8 0>, <&precal_radio_5000>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; @@ -445,9 +459,8 @@ pinctrl-0 = <&rgmii2_pins>; pinctrl-names = "default"; - nvmem-cells = <&macaddr_defaultmac_8>; + nvmem-cells = <&macaddr_defaultmac_8 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; fixed-link { speed = <1000>; @@ -460,7 +473,7 @@ phy-mode = "sgmii"; qcom,id = <2>; - nvmem-cells = <&macaddr_defaultmac_8>; + nvmem-cells = <&macaddr_defaultmac_8 0>; nvmem-cell-names = "mac-address"; fixed-link { @@ -472,13 +485,3 @@ &adm_dma { status = "okay"; }; - -&defaultmac { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_defaultmac_8: macaddr@8 { - reg = <0x8 0x6>; - }; -}; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts index 7e4e0c829c2..18563c19f7b 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts @@ -209,9 +209,8 @@ compatible = "pci168c,0040"; reg = <0x00010000 0 0 0 0>; - nvmem-cells = <&macaddr_art_6>, <&precal_art_1000>; + nvmem-cells = <&macaddr_art_6 1>, <&precal_art_1000>; nvmem-cell-names = "mac-address", "pre-calibration"; - mac-address-increment = <(1)>; }; }; }; @@ -233,9 +232,8 @@ compatible = "pci168c,0040"; reg = <0x00010000 0 0 0 0>; - nvmem-cells = <&macaddr_art_6>, <&precal_art_5000>; + nvmem-cells = <&macaddr_art_6 2>, <&precal_art_5000>; nvmem-cell-names = "mac-address", "pre-calibration"; - mac-address-increment = <(2)>; }; }; }; @@ -288,24 +286,29 @@ label = "art"; reg = <0x1200000 0x0140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + macaddr_art_6: macaddr@6 { + compatible = "mac-base"; + reg = <0x6 0x6>; + #nvmem-cell-cells = <1>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -448,7 +451,7 @@ pinctrl-0 = <&rgmii2_pins>; pinctrl-names = "default"; - nvmem-cells = <&macaddr_art_6>; + nvmem-cells = <&macaddr_art_6 0>; nvmem-cell-names = "mac-address"; fixed-link { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-mi-router-hd.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-mi-router-hd.dts index 1c11ab5e1da..e183dfe62bb 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-mi-router-hd.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-mi-router-hd.dts @@ -220,7 +220,7 @@ compatible = "pci168c,0040"; reg = <0x00010000 0 0 0 0>; - nvmem-cells = <&macaddr_art_1006>, <&precal_art_1000>; + nvmem-cells = <&macaddr_art_1006 0>, <&precal_art_1000>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; @@ -243,7 +243,7 @@ compatible = "pci168c,0040"; reg = <0x00010000 0 0 0 0>; - nvmem-cells = <&macaddr_art_5006>, <&precal_art_5000>; + nvmem-cells = <&macaddr_art_5006 0>, <&precal_art_5000>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; @@ -333,26 +333,42 @@ read-only; compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { // WAN (label) - reg = <0x0 0x6>; - }; - macaddr_art_6: macaddr@6 { // LAN - reg = <0x6 0x6>; - }; - macaddr_art_1006: macaddr@1006 { // WiFi 2g - reg = <0x1006 0x6>; - }; - macaddr_art_5006: macaddr@5006 { // WiFi 5g - reg = <0x5006 0x6>; - }; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_art_6: macaddr@6 { + compatible = "mac-base"; + reg = <0x6 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_art_1006: macaddr@1006 { + compatible = "mac-base"; + reg = <0x1006 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_art_5006: macaddr@5006 { + compatible = "mac-base"; + reg = <0x5006 0x6>; + #nvmem-cell-cells = <1>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -507,7 +523,7 @@ pinctrl-0 = <&rgmii2_pins>; pinctrl-names = "default"; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; fixed-link { @@ -521,7 +537,7 @@ phy-mode = "sgmii"; qcom,id = <2>; - nvmem-cells = <&macaddr_art_6>; + nvmem-cells = <&macaddr_art_6 0>; nvmem-cell-names = "mac-address"; fixed-link { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi index ba53a7391de..5b8de27ad69 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi @@ -454,6 +454,7 @@ #size-cells = <2>; #address-cells = <3>; device_type = "pci"; + interrupt-controller; ath10k@0,0 { reg = <0 0 0 0 0>; @@ -473,6 +474,7 @@ #size-cells = <2>; #address-cells = <3>; device_type = "pci"; + interrupt-controller; ath10k@0,0 { reg = <0 0 0 0 0>; @@ -492,6 +494,7 @@ #size-cells = <2>; #address-cells = <3>; device_type = "pci"; + interrupt-controller; ath10k@0,0 { reg = <0 0 0 0 0>; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500.dts index c58c289d35d..41360b4a55b 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500.dts @@ -221,6 +221,20 @@ label = "art"; reg = <0x1200000 0x0140000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; kernel@1340000 { @@ -393,17 +407,3 @@ &adm_dma { status = "okay"; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; -}; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts index 719a423cad3..47f653ac763 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts @@ -213,9 +213,8 @@ compatible = "pci168c,0040"; reg = <0x00010000 0 0 0 0>; - nvmem-cells = <&macaddr_art_6>, <&precal_art_1000>; + nvmem-cells = <&macaddr_art_6 1>, <&precal_art_1000>; nvmem-cell-names = "mac-address", "pre-calibration"; - mac-address-increment = <(1)>; }; }; }; @@ -237,9 +236,8 @@ compatible = "pci168c,0040"; reg = <0x00010000 0 0 0 0>; - nvmem-cells = <&macaddr_art_6>, <&precal_art_5000>; + nvmem-cells = <&macaddr_art_6 2>, <&precal_art_5000>; nvmem-cell-names = "mac-address", "pre-calibration"; - mac-address-increment = <(2)>; }; }; }; @@ -285,24 +283,29 @@ label = "art"; reg = <0x1200000 0x0140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + macaddr_art_6: macaddr@6 { + compatible = "mac-base"; + reg = <0x6 0x6>; + #nvmem-cell-cells = <1>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -445,7 +448,7 @@ pinctrl-0 = <&rgmii2_pins>; pinctrl-names = "default"; - nvmem-cells = <&macaddr_art_6>; + nvmem-cells = <&macaddr_art_6 0>; nvmem-cell-names = "mac-address"; fixed-link { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-unifi-ac-hd.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-unifi-ac-hd.dts index 90927ddb856..fac41897d4f 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-unifi-ac-hd.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-unifi-ac-hd.dts @@ -179,6 +179,20 @@ label = "EEPROM"; reg = <0x1c0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_eeprom_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_eeprom_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; partition@1d0000 { @@ -299,17 +313,3 @@ &usb3_1 { status = "okay"; }; - -&eeprom { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_eeprom_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_eeprom_6: macaddr@6 { - reg = <0x6 0x6>; - }; -}; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts index 8104ce18298..ac62470df48 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts @@ -268,12 +268,16 @@ reg = <0xfaf100 0x00200>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_defaultmac_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_defaultmac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -282,16 +286,18 @@ reg = <0xfc0000 0x40000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_ART_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + precal_ART_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_ART_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_ART_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; }; @@ -336,9 +342,8 @@ compatible = "pci168c,0040"; reg = <0x00010000 0 0 0 0>; - nvmem-cells = <&macaddr_defaultmac_0>, <&precal_ART_1000>; + nvmem-cells = <&macaddr_defaultmac_0 (-1)>, <&precal_ART_1000>; nvmem-cell-names = "mac-address", "pre-calibration"; - mac-address-increment = <(-1)>; }; }; }; @@ -357,7 +362,7 @@ compatible = "pci168c,0040"; reg = <0x00010000 0 0 0 0>; - nvmem-cells = <&macaddr_defaultmac_0>, <&precal_ART_5000>; + nvmem-cells = <&macaddr_defaultmac_0 0>, <&precal_ART_5000>; nvmem-cell-names = "mac-address", "pre-calibration"; }; }; @@ -477,9 +482,8 @@ pinctrl-0 = <&rgmii2_pins>; pinctrl-names = "default"; - nvmem-cells = <&macaddr_defaultmac_0>; + nvmem-cells = <&macaddr_defaultmac_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; fixed-link { speed = <1000>; @@ -492,7 +496,7 @@ phy-mode = "sgmii"; qcom,id = <2>; - nvmem-cells = <&macaddr_defaultmac_0>; + nvmem-cells = <&macaddr_defaultmac_0 0>; nvmem-cell-names = "mac-address"; fixed-link { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts index 87b05b57ba9..a376eb0e2fe 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts @@ -360,22 +360,47 @@ switch@10 { label = "PRODUCTDATA"; reg = <0x2b0000 0x30000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_PRODUCTDATA_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_PRODUCTDATA_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_PRODUCTDATA_c: macaddr@c { + reg = <0xc 0x6>; + }; + + macaddr_PRODUCTDATA_12: macaddr@12 { + reg = <0x12 0x6>; + }; + }; }; ART@2e0000 { label = "ART"; reg = <0x2e0000 0x40000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - precal_ART_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - precal_ART_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_ART_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_ART_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; @@ -522,25 +547,3 @@ switch@10 { }; }; }; - -&PRODUCTDATA { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_PRODUCTDATA_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_PRODUCTDATA_6: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_PRODUCTDATA_c: macaddr@c { - reg = <0xc 0x6>; - }; - - macaddr_PRODUCTDATA_12: macaddr@12 { - reg = <0x12 0x6>; - }; -}; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts index 2d761ee3557..d484ba9c603 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts @@ -420,32 +420,34 @@ reg = <0x180000 0x40000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_ART_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_ART_6: macaddr@6 { - reg = <0x6 0x6>; - }; - - macaddr_ART_18: macaddr@18 { - reg = <0x18 0x6>; - }; - - macaddr_ART_1e: macaddr@1e { - reg = <0x1e 0x6>; - }; - - precal_ART_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; - - precal_ART_5000: precal@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_ART_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_ART_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + macaddr_ART_18: macaddr@18 { + reg = <0x18 0x6>; + }; + + macaddr_ART_1e: macaddr@1e { + reg = <0x1e 0x6>; + }; + + precal_ART_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_ART_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nighthawk.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nighthawk.dtsi index 51ad5ac8eef..4662e2843cb 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nighthawk.dtsi +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nighthawk.dtsi @@ -261,24 +261,33 @@ label = "art"; reg = <0x1200000 0x0140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_art_0: macaddr@0 { - reg = <0x0 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_art_6: macaddr@6 { - reg = <0x6 0x6>; - }; + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; - precal_art_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + macaddr_art_6: macaddr@6 { + compatible = "mac-base"; + reg = <0x6 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_art_c: macaddr@c { + reg = <0xc 0x6>; + }; + + precal_art_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_art_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_art_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-r7800.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-r7800.dts index bf7c963944b..3440c52699e 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-r7800.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-r7800.dts @@ -36,13 +36,11 @@ }; &wifi0 { - nvmem-cells = <&macaddr_art_6>, <&precal_art_1000>; + nvmem-cells = <&macaddr_art_6 1>, <&precal_art_1000>; nvmem-cell-names = "mac-address", "pre-calibration"; - mac-address-increment = <(1)>; }; &wifi1 { - nvmem-cells = <&macaddr_art_6>, <&precal_art_5000>; + nvmem-cells = <&macaddr_art_6 2>, <&precal_art_5000>; nvmem-cell-names = "mac-address", "pre-calibration"; - mac-address-increment = <(2)>; }; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts index 5453f9fcb3c..3f5e8075919 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts @@ -209,24 +209,27 @@ label = "0:ART"; reg = <0x1200000 0x0140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - macaddr_ART_0: macaddr@0 { - reg = <0x0 0x6>; - }; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_ART_6: macaddr@6 { - reg = <0x6 0x6>; - }; + macaddr_ART_0: macaddr@0 { + reg = <0x0 0x6>; + }; - precal_ART_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; + macaddr_ART_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + precal_ART_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; - precal_ART_5000: precal@5000 { - reg = <0x5000 0x2f20>; + precal_ART_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-tr4400-v2.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-tr4400-v2.dts index 600bcc8421d..7679f28eef1 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-tr4400-v2.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-tr4400-v2.dts @@ -188,15 +188,17 @@ reg = <0x1200000 0x0140000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - precal_ART_1000: precal@1000 { - reg = <0x1000 0x2f20>; - }; - precal_ART_5000: precal@5000 { - reg = <0x5000 0x2f20>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + precal_ART_1000: precal@1000 { + reg = <0x1000 0x2f20>; + }; + precal_ART_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; }; }; stock_partition@1340000 { @@ -273,24 +275,26 @@ label = "fw_env"; reg = <0x6400000 0x0100000>; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_fw_env_0: macaddr@0 { - reg = <0x00 0x6>; - }; - macaddr_fw_env_6: macaddr@6 { - reg = <0x06 0x6>; - }; - macaddr_fw_env_c: macaddr@c { - reg = <0x0c 0x6>; - }; - macaddr_fw_env_12: macaddr@12 { - reg = <0x12 0x6>; - }; - macaddr_fw_env_18: macaddr@18 { - reg = <0x18 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_fw_env_0: macaddr@0 { + reg = <0x00 0x6>; + }; + macaddr_fw_env_6: macaddr@6 { + reg = <0x06 0x6>; + }; + macaddr_fw_env_c: macaddr@c { + reg = <0x0c 0x6>; + }; + macaddr_fw_env_12: macaddr@12 { + reg = <0x12 0x6>; + }; + macaddr_fw_env_18: macaddr@18 { + reg = <0x18 0x6>; + }; }; }; partition@6500000 { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-xr450.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-xr450.dts index 4353aec7ac0..1d4e9d36fe4 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-xr450.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-xr450.dts @@ -42,9 +42,3 @@ nvmem-cells = <&macaddr_art_0>, <&precal_art_5000>; nvmem-cell-names = "mac-address", "pre-calibration"; }; - -&art { - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; -}; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-xr500.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-xr500.dts index f584735e155..9eef59eaf3d 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-xr500.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-xr500.dts @@ -42,9 +42,3 @@ nvmem-cells = <&macaddr_art_0>, <&precal_art_5000>; nvmem-cell-names = "mac-address", "pre-calibration"; }; - -&art { - macaddr_art_c: macaddr@c { - reg = <0xc 0x6>; - }; -}; diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-mr42.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-mr42.dts index cfbfafb1793..d9d284fcfaf 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-mr42.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-mr42.dts @@ -58,7 +58,7 @@ phy-mode = "sgmii"; phy-handle = <&phy2>; - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 0>; nvmem-cell-names = "mac-address"; }; @@ -84,11 +84,17 @@ pagesize = <32>; reg = <0x56>; read-only; - #address-cells = <1>; - #size-cells = <1>; - mac_address: mac-address@66 { - reg = <0x66 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + mac_address: mac-address@66 { + compatible = "mac-base"; + reg = <0x66 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; @@ -186,21 +192,18 @@ }; &wifi0 { - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &wifi1 { - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &wifi2 { - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; }; &hs_phy_0 { diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-mr52.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-mr52.dts index f81e3ef690d..522fa12fd97 100644 --- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-mr52.dts +++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8068-mr52.dts @@ -80,7 +80,7 @@ phy-mode = "sgmii"; phy-handle = <&phy0>; - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 0>; nvmem-cell-names = "mac-address"; }; @@ -93,9 +93,8 @@ phy-mode = "sgmii"; phy-handle = <&phy4>; - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &gsbi7 { @@ -142,11 +141,17 @@ pagesize = <32>; reg = <0x52>; read-only; - #address-cells = <1>; - #size-cells = <1>; - mac_address: mac-address@66 { - reg = <0x66 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + mac_address: mac-address@66 { + compatible = "mac-base"; + reg = <0x66 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; @@ -212,21 +217,18 @@ }; &wifi0 { - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 4>; nvmem-cell-names = "mac-address"; - mac-address-increment = <4>; }; &wifi1 { - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; }; &wifi2 { - nvmem-cells = <&mac_address>; + nvmem-cells = <&mac_address 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &hs_phy_0 { diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7312.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7312.dts index c8e67537a94..ba2b82dd670 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7312.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7312.dts @@ -97,9 +97,8 @@ &gsw { phy-mode = "rmii"; phy-handle = <&phy0>; - nvmem-cells = <&macaddr_ath9k_cal_a91>; + nvmem-cells = <&macaddr_ath9k_cal_a91 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; mdio-bus { #address-cells = <1>; @@ -128,6 +127,18 @@ label = "urlader"; reg = <0x00000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_ath9k_cal_a91: macaddr@a91 { + compatible = "mac-base"; + reg = <0xa91 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -171,13 +182,3 @@ qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:00:0e.0.bin */ }; }; - -&ath9k_cal { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_ath9k_cal_a91: macaddr@a91 { - reg = <0xa91 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts index cd7b29ca6d1..b04efd8a846 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts @@ -99,9 +99,8 @@ &gsw { phy-mode = "mii"; phy-handle = <&phy0>; - nvmem-cells = <&macaddr_ath9k_cal_a91>; + nvmem-cells = <&macaddr_ath9k_cal_a91 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; mdio-bus { #address-cells = <1>; @@ -155,6 +154,18 @@ label = "urlader"; reg = <0x00000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_ath9k_cal_a91: macaddr@a91 { + compatible = "mac-base"; + reg = <0xa91 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -215,13 +226,3 @@ status = "okay"; vbus-supply = <&usb1_vbus>; }; - -&ath9k_cal { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_ath9k_cal_a91: macaddr@a91 { - reg = <0xa91 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts index 8eaf566b261..7e0f157bf32 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts @@ -175,6 +175,16 @@ label = "board"; reg = <0x1fc0000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_10024: macaddr@10024 { + reg = <0x10024 0x6>; + }; + }; }; partition@1fe0000 { @@ -194,13 +204,3 @@ status = "okay"; vbus-supply = <&usb_vbus>; }; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_10024: macaddr@10024 { - reg = <0x10024 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi index b5e4537838b..3d56e76c46e 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi @@ -160,6 +160,16 @@ label = "boardconfig"; reg = <0x3f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_16: macaddr@16 { + reg = <0x16 0x6>; + }; + }; }; }; }; @@ -199,13 +209,3 @@ status = "okay"; gpios = <&gpio 31 GPIO_ACTIVE_HIGH>; }; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_16: macaddr@16 { - reg = <0x16 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts index 35caf647a71..72f8c3bc661 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts @@ -167,6 +167,16 @@ label = "boardconfig"; reg = <0x3f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_16: macaddr@16 { + reg = <0x16 0x6>; + }; + }; }; }; }; @@ -202,13 +212,3 @@ status = "okay"; gpios = <&gpio 31 GPIO_ACTIVE_HIGH>; }; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_16: macaddr@16 { - reg = <0x16 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts index 9a1c8b1bcb2..775aab4ba96 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts @@ -180,6 +180,16 @@ label = "boardconfig"; reg = <0x3f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_16: macaddr@16 { + reg = <0x16 0x6>; + }; + }; }; }; }; @@ -219,13 +229,3 @@ gpios = <&gpio 31 GPIO_ACTIVE_HIGH &gpiomm 7 GPIO_ACTIVE_HIGH>; }; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_16: macaddr@16 { - reg = <0x16 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts index 650c8872c95..182b0c0bb18 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4525pw.dts @@ -129,6 +129,16 @@ label = "boardconfig"; reg = <0x3f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_16: macaddr@16 { + reg = <0x16 0x6>; + }; + }; }; }; }; @@ -148,13 +158,3 @@ status = "okay"; gpios = <&gpio 31 GPIO_ACTIVE_HIGH>; }; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_16: macaddr@16 { - reg = <0x16 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts index dddf904af4c..4825eb2952e 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts @@ -198,6 +198,16 @@ label = "boardconfig"; reg = <0x3f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_16: macaddr@16 { + reg = <0x16 0x6>; + }; + }; }; }; }; @@ -237,13 +247,3 @@ gpios = <&gpio 31 GPIO_ACTIVE_HIGH &gpiomm 7 GPIO_ACTIVE_HIGH>; }; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_16: macaddr@16 { - reg = <0x16 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts index cfa5dba7c6c..3f957c63a60 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7506pw11.dts @@ -100,7 +100,7 @@ /* GPIO 19: switch reset */ &gsw { phy-mode = "rmii"; - nvmem-cells = <&macaddr_boardconfig_16>; + nvmem-cells = <&macaddr_boardconfig_16 0>; nvmem-cell-names = "mac-address"; }; @@ -136,6 +136,18 @@ label = "board_config"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_16: macaddr@16 { + compatible = "mac-base"; + reg = <0x16 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -155,18 +167,7 @@ reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; ralink,eeprom-swap; - nvmem-cells = <&macaddr_boardconfig_16>; + nvmem-cells = <&macaddr_boardconfig_16 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; - }; -}; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_16: macaddr@16 { - reg = <0x16 0x6>; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts index 9299f11fe32..52ba5e1a3bf 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts @@ -153,6 +153,16 @@ label = "board_config"; reg = <0xfe0000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_16: macaddr@16 { + reg = <0x16 0x6>; + }; + }; }; }; }; @@ -195,13 +205,3 @@ status = "okay"; gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; }; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_16: macaddr@16 { - reg = <0x16 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts index a327635c331..fb3363b2e2a 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts @@ -149,7 +149,7 @@ */ &gsw { phy-mode = "mii"; - nvmem-cells = <&macaddr_boardconfig_16>; + nvmem-cells = <&macaddr_boardconfig_16 0>; nvmem-cell-names = "mac-address"; }; @@ -184,6 +184,18 @@ label = "boardconfig"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_16: macaddr@16 { + compatible = "mac-base"; + reg = <0x16 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -213,9 +225,8 @@ compatible = "pci168c,0029"; reg = <0x7000 0 0 0 0>; qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:00:0e.0.bin */ - nvmem-cells = <&macaddr_boardconfig_16>; + nvmem-cells = <&macaddr_boardconfig_16 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; @@ -231,13 +242,3 @@ &vmmc { status = "okay"; }; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_16: macaddr@16 { - reg = <0x16 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts index 4f8f941c8b7..1f8db69f309 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7519pw.dts @@ -179,6 +179,16 @@ label = "board_config"; reg = <0xfe0000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_16: macaddr@16 { + reg = <0x16 0x6>; + }; + }; }; }; }; @@ -214,13 +224,3 @@ &vmmc { status = "okay"; }; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_16: macaddr@16 { - reg = <0x16 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts index 12de92ec530..d67efb4fca5 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7525pw.dts @@ -122,6 +122,16 @@ label = "board_config"; reg = <0x3f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_16: macaddr@16 { + reg = <0x16 0x6>; + }; + }; }; }; }; @@ -146,13 +156,3 @@ status = "okay"; gpios = <&gpio 31 GPIO_ACTIVE_HIGH>; }; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_16: macaddr@16 { - reg = <0x16 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts index f0900b56cc5..41a0e1b74a9 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts @@ -192,6 +192,16 @@ label = "board_config"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_16: macaddr@16 { + reg = <0x16 0x6>; + }; + }; }; }; }; @@ -241,13 +251,3 @@ status = "okay"; gpios = <&gpiomm 1 GPIO_ACTIVE_HIGH>; }; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_16: macaddr@16 { - reg = <0x16 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts index 8897c9703cd..4fb135763d5 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts @@ -207,6 +207,16 @@ label = "board_config"; reg = <0x7f0000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_16: macaddr@16 { + reg = <0x16 0x6>; + }; + }; }; }; }; @@ -285,13 +295,3 @@ status = "okay"; gpios = <&gpiomm 1 GPIO_ACTIVE_HIGH>; }; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_16: macaddr@16 { - reg = <0x16 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv8539pw22.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv8539pw22.dts index 83a303b9e82..d6a917057d7 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv8539pw22.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv8539pw22.dts @@ -107,7 +107,7 @@ &gsw { phy-mode = "mii"; - nvmem-cells = <&macaddr_art_16>; + nvmem-cells = <&macaddr_art_16 0>; nvmem-cell-names = "mac-address"; }; @@ -143,6 +143,18 @@ label = "art"; reg = <0x7f0000 0x10000>; /* 64 KiB*/ read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_16: macaddr@16 { + compatible = "mac-base"; + reg = <0x16 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -160,9 +172,8 @@ compatible = "pci168c,0029"; reg = <0x7000 0 0 0 0>; qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:00:0e.0.bin */ - nvmem-cells = <&macaddr_art_16>; + nvmem-cells = <&macaddr_art_16 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; @@ -179,13 +190,3 @@ status = "okay"; gpios = <&gpio 31 GPIO_ACTIVE_HIGH>; }; - -&art { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_art_16: macaddr@16 { - reg = <0x16 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts index 343f3533d8b..935aa08cb90 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts @@ -207,6 +207,16 @@ label = "boardconfig"; reg = <0x1f80000 0x80000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_16: macaddr@16 { + reg = <0x16 0x6>; + }; + }; }; }; }; @@ -234,13 +244,3 @@ status = "okay"; vbus-supply = <&usb_vbus>; }; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_16: macaddr@16 { - reg = <0x16 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi index 1f8ad430c00..69685d801b8 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi @@ -108,7 +108,7 @@ }; ð0 { - nvmem-cells = <&macaddr_boardconfig_16>; + nvmem-cells = <&macaddr_boardconfig_16 0>; nvmem-cell-names = "mac-address"; }; @@ -207,6 +207,18 @@ label = "board_config"; reg = <0xfe0000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_16: macaddr@16 { + compatible = "mac-base"; + reg = <0x16 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -221,9 +233,8 @@ reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; ralink,eeprom-swap; - nvmem-cells = <&macaddr_boardconfig_16>; + nvmem-cells = <&macaddr_boardconfig_16 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; @@ -246,13 +257,3 @@ &gpio 31 GPIO_ACTIVE_HIGH //still unknown &gpio 3 GPIO_ACTIVE_HIGH>; //reset_slic? }; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_16: macaddr@16 { - reg = <0x16 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519.dtsi index 5e6a6f0c64f..71046cfd58c 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519.dtsi @@ -127,9 +127,8 @@ }; ð0 { - nvmem-cells = <&macaddr_boardconfig_16>; + nvmem-cells = <&macaddr_boardconfig_16 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; &gphy0 { @@ -225,6 +224,18 @@ label = "board_config"; reg = <0x40000 0x10000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_boardconfig_16: macaddr@16 { + compatible = "mac-base"; + reg = <0x16 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -239,9 +250,8 @@ reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; ralink,eeprom-swap; - nvmem-cells = <&macaddr_boardconfig_16>; + nvmem-cells = <&macaddr_boardconfig_16 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; }; @@ -280,13 +290,3 @@ &gpio 31 GPIO_ACTIVE_HIGH //still unknown &gpio 3 GPIO_ACTIVE_HIGH>; //reset_slic? }; - -&boardconfig { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_boardconfig_16: macaddr@16 { - reg = <0x16 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts index a30746cde2b..cc15324b56e 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts @@ -43,16 +43,20 @@ reg = <0x00000 0x20000>; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - cal_urlader_985: cal@985 { - reg = <0x985 0x440>; - }; - - macaddr_urlader_a91: macaddr@a91 { - reg = <0xa91 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_urlader_985: cal@985 { + reg = <0x985 0x440>; + }; + + macaddr_urlader_a91: macaddr@a91 { + compatible = "mac-base"; + reg = <0xa91 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -77,9 +81,8 @@ }; ð0 { - nvmem-cells = <&macaddr_urlader_a91>; + nvmem-cells = <&macaddr_urlader_a91 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &phy0 { diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts index 31523eaae00..cbe6c14c991 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts @@ -43,6 +43,18 @@ label = "urlader"; reg = <0x00000 0x20000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_urlader_a91: macaddr@a91 { + compatible = "mac-base"; + reg = <0xa91 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@20000 { @@ -66,9 +78,8 @@ }; ð0 { - nvmem-cells = <&macaddr_urlader_a91>; + nvmem-cells = <&macaddr_urlader_a91 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &phy0 { @@ -78,13 +89,3 @@ &phy1 { reset-gpios = <&gpio 44 GPIO_ACTIVE_LOW>; }; - -&urlader { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_urlader_a91: macaddr@a91 { - reg = <0xa91 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts index 7995b34971a..7929bde6cfe 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts @@ -47,6 +47,18 @@ reg = <0x0 0x40000>; label = "urlader"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_urlader_a91: macaddr@a91 { + compatible = "mac-base"; + reg = <0xa91 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@40000 { @@ -104,9 +116,8 @@ }; ð0 { - nvmem-cells = <&macaddr_urlader_a91>; + nvmem-cells = <&macaddr_urlader_a91 (-2)>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(-2)>; }; &phy0 { @@ -116,13 +127,3 @@ &phy1 { reset-gpios = <&gpio 44 GPIO_ACTIVE_LOW>; }; - -&urlader { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_urlader_a91: macaddr@a91 { - reg = <0xa91 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi index 5b7c10bb9dd..39d7b4908cd 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi @@ -110,7 +110,7 @@ }; ð0 { - nvmem-cells = <&macaddr_ath9k_cal_f100>; + nvmem-cells = <&macaddr_ath9k_cal_f100 0>; nvmem-cell-names = "mac-address"; }; @@ -204,9 +204,8 @@ gpio-controller; qca,no-eeprom; ieee80211-freq-limit = <2402000 2482000>; - nvmem-cells = <&macaddr_ath9k_cal_f100>; + nvmem-cells = <&macaddr_ath9k_cal_f100 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; }; }; @@ -246,6 +245,18 @@ reg = <0x7d0000 0x30000>; label = "boardconfig"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_ath9k_cal_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; }; }; @@ -268,13 +279,3 @@ status = "okay"; vbus-supply = <&usb_vbus>; }; - -&ath9k_cal { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_ath9k_cal_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi index e37f1ab37c8..acb54ee80b3 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi @@ -100,7 +100,7 @@ }; ð0 { - nvmem-cells = <&macaddr_romfile_f100>; + nvmem-cells = <&macaddr_romfile_f100 0>; nvmem-cell-names = "mac-address"; }; @@ -192,9 +192,8 @@ mediatek,mtd-eeprom = <&radio 0x0000>; big-endian; ieee80211-freq-limit = <5000000 6000000>; - nvmem-cells = <&macaddr_romfile_f100>; + nvmem-cells = <&macaddr_romfile_f100 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; }; }; @@ -245,6 +244,18 @@ reg = <0xfd0000 0x10000>; label = "romfile"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_romfile_f100: macaddr@f100 { + compatible = "mac-base"; + reg = <0xf100 0x6>; + #nvmem-cell-cells = <1>; + }; + }; }; partition@fe0000 { @@ -279,13 +290,3 @@ status = "okay"; vbus-supply = <&usb_vbus>; }; - -&romfile { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_romfile_f100: macaddr@f100 { - reg = <0xf100 0x6>; - }; -}; diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile index dfbda85b365..f2ac9b6f048 100644 --- a/target/linux/layerscape/image/Makefile +++ b/target/linux/layerscape/image/Makefile @@ -8,8 +8,11 @@ include $(INCLUDE_DIR)/image.mk LS_SD_KERNELPART_SIZE = 40 LS_SD_KERNELPART_OFFSET = 16 LS_SD_ROOTFSPART_OFFSET = 64 + +ifeq ($(DUMP),) LS_SD_IMAGE_SIZE = $(shell echo $$((($(LS_SD_ROOTFSPART_OFFSET) + \ $(CONFIG_TARGET_ROOTFS_PARTSIZE))))) +endif # The limitation of flash sysupgrade.bin is 1MB dtb + 16MB kernel + 32MB rootfs LS_SYSUPGRADE_IMAGE_SIZE = 49m diff --git a/target/linux/mediatek/dts/mt7981b-abt-asr3000-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-abt-asr3000-ubootmod.dts index 4dbcf9eaacb..0dee4f42e5c 100644 --- a/target/linux/mediatek/dts/mt7981b-abt-asr3000-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7981b-abt-asr3000-ubootmod.dts @@ -61,7 +61,7 @@ mesh_led: led-2 { label = "green:mesh"; - gpios = <&pio 15 GPIO_ACTIVE_LOW>; + gpios = <&pio 15 GPIO_ACTIVE_HIGH>; }; led-3 { @@ -109,7 +109,7 @@ }; &mdio_bus { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dtsi b/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dtsi index 9154e3fa385..4102fc933f1 100644 --- a/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dtsi +++ b/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dtsi @@ -80,7 +80,7 @@ }; &mdio_bus { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/mediatek/dts/mt7981b-cmcc-a10-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-cmcc-a10-ubootmod.dts index 10f060c4ca2..29f486108ef 100644 --- a/target/linux/mediatek/dts/mt7981b-cmcc-a10-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7981b-cmcc-a10-ubootmod.dts @@ -85,7 +85,7 @@ }; &mdio_bus { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m.dts b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m.dts index e9c850e85b0..3f330f40fae 100644 --- a/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m.dts +++ b/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m.dts @@ -90,7 +90,7 @@ }; &mdio_bus { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts b/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts index 7975d247b15..56e90b17228 100644 --- a/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts +++ b/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts @@ -112,7 +112,7 @@ }; &mdio_bus { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/mediatek/dts/mt7981b-h3c-magic-nx30-pro.dts b/target/linux/mediatek/dts/mt7981b-h3c-magic-nx30-pro.dts index a75f5146360..e7c75d9c5e5 100644 --- a/target/linux/mediatek/dts/mt7981b-h3c-magic-nx30-pro.dts +++ b/target/linux/mediatek/dts/mt7981b-h3c-magic-nx30-pro.dts @@ -81,7 +81,7 @@ }; &mdio_bus { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/mediatek/dts/mt7981b-imou-lc-hx3001-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-imou-lc-hx3001-ubootmod.dts index fe7dace67a3..e75f855e496 100644 --- a/target/linux/mediatek/dts/mt7981b-imou-lc-hx3001-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7981b-imou-lc-hx3001-ubootmod.dts @@ -103,7 +103,7 @@ }; &mdio_bus { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/mediatek/dts/mt7981b-jcg-q30-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-jcg-q30-ubootmod.dts index 8e4ddf10b66..4bfd7ee27d7 100644 --- a/target/linux/mediatek/dts/mt7981b-jcg-q30-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7981b-jcg-q30-ubootmod.dts @@ -4,246 +4,38 @@ */ /dts-v1/; -#include -#include - -#include "mt7981.dtsi" +#include "mt7981b-jcg-q30.dts" / { model = "JCG Q30 (custom U-Boot layout)"; compatible = "jcg,q30-ubootmod", "mediatek,mt7981"; - - aliases { - led-boot = &status_red_led; - led-failsafe = &status_red_led; - led-running = &status_blue_led; - led-upgrade = &status_blue_led; - serial0 = &uart0; - }; - - chosen { - stdout-path = "serial0:115200n8"; - }; - - memory { - reg = <0 0x40000000 0 0x10000000>; - }; - - gpio-keys { - compatible = "gpio-keys"; - - button-reset { - label = "reset"; - linux,code = ; - gpios = <&pio 1 GPIO_ACTIVE_LOW>; - }; - - button-wps { - label = "wps"; - linux,code = ; - gpios = <&pio 0 GPIO_ACTIVE_HIGH>; - }; - }; - - gpio-leds { - compatible = "gpio-leds"; - - status_red_led: led-0 { - label = "red:status"; - gpios = <&pio 8 GPIO_ACTIVE_HIGH>; - }; - - status_blue_led: led-1 { - label = "blue:status"; - gpios = <&pio 13 GPIO_ACTIVE_LOW>; - }; - }; }; -ð { - pinctrl-names = "default"; - pinctrl-0 = <&mdio_pins>; - - status = "okay"; - - gmac0: mac@0 { - compatible = "mediatek,eth-mac"; - reg = <0>; - phy-mode = "2500base-x"; - - nvmem-cells = <&macaddr_factory_a002a 0>; - nvmem-cell-names = "mac-address"; - - fixed-link { - speed = <2500>; - full-duplex; - pause; - }; - }; -}; - -&mdio_bus { - switch: switch@0 { - compatible = "mediatek,mt7531"; - reg = <31>; - reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; - interrupt-controller; - #interrupt-cells = <1>; - interrupt-parent = <&pio>; - interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; - }; -}; - -&spi0 { - pinctrl-names = "default"; - pinctrl-0 = <&spi0_flash_pins>; - status = "okay"; - - spi_nand: flash@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "spi-nand"; - reg = <0>; - spi-max-frequency = <52000000>; +&spi_nand { + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; - spi-cal-enable; - spi-cal-mode = "read-data"; - spi-cal-datalen = <7>; - spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>; - spi-cal-addrlen = <5>; - spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>; - - spi-tx-bus-width = <4>; - spi-rx-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>; - - partition@0 { - label = "BL2"; - reg = <0x00000 0x100000>; - }; - - partition@100000 { - label = "u-boot-env"; - reg = <0x100000 0x80000>; - }; - - factory: partition@180000 { - label = "Factory"; - reg = <0x180000 0x200000>; - - compatible = "nvmem-cells"; - nvmem-layout { - compatible = "fixed-layout"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_a002a: macaddr@a002a { - compatible = "mac-base"; - reg = <0xa002a 0x6>; - #nvmem-cell-cells = <1>; - }; - - macaddr_factory_a0024: macaddr@a0024 { - compatible = "mac-base"; - reg = <0xa0024 0x6>; - #nvmem-cell-cells = <1>; - }; - }; - }; - - partition@380000 { - label = "FIP"; - reg = <0x380000 0x200000>; - }; - - partition@580000 { - label = "ubi"; - reg = <0x580000 0x6e80000>; - }; - }; - }; + spi-cal-enable; + spi-cal-mode = "read-data"; + spi-cal-datalen = <7>; + spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>; + spi-cal-addrlen = <5>; + spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>; }; -&switch { - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - label = "wan"; - - nvmem-cells = <&macaddr_factory_a0024 0>; - nvmem-cell-names = "mac-address"; - }; - - port@1 { - reg = <1>; - label = "lan1"; - }; - - port@2 { - reg = <2>; - label = "lan2"; - }; - - port@3 { - reg = <3>; - label = "lan3"; - }; - - port@6 { - reg = <6>; - ethernet = <&gmac0>; - phy-mode = "2500base-x"; - - fixed-link { - speed = <2500>; - full-duplex; - pause; - }; - }; +&spi0_flash_pins { + conf-pu { + /delete-property/ mediatek,pull-up-adv; + bias-pull-up = ; }; -}; - -&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 = <8>; - bias-pull-up = <103>; - }; - - conf-pd { - pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; - drive-strength = <8>; - bias-pull-down = <103>; - }; + conf-pd { + /delete-property/ mediatek,pull-up-adv; + bias-pull-up = ; }; }; -&uart0 { - status = "okay"; -}; - -&watchdog { - status = "okay"; -}; - -&wifi { - status = "okay"; - - mediatek,mtd-eeprom = <&factory 0x0>; +&ubi { + reg = <0x580000 0x6e80000>; }; diff --git a/target/linux/mediatek/dts/mt7981b-jcg-q30.dts b/target/linux/mediatek/dts/mt7981b-jcg-q30.dts new file mode 100644 index 00000000000..ff586862479 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-jcg-q30.dts @@ -0,0 +1,240 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include +#include + +#include "mt7981.dtsi" + +/ { + model = "JCG Q30"; + compatible = "jcg,q30", "mediatek,mt7981"; + + aliases { + led-boot = &status_red_led; + led-failsafe = &status_red_led; + led-running = &status_blue_led; + led-upgrade = &status_blue_led; + serial0 = &uart0; + label-mac-device = &gmac0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory { + reg = <0 0x40000000 0 0x10000000>; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + + button-wps { + label = "wps"; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + status_red_led: led-0 { + label = "red:status"; + gpios = <&pio 8 GPIO_ACTIVE_HIGH>; + }; + + status_blue_led: led-1 { + label = "blue:status"; + gpios = <&pio 13 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cells = <&macaddr_factory_a002a 0>; + nvmem-cell-names = "mac-address"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + spi_nand: flash@0 { + #address-cells = <1>; + #size-cells = <1>; + 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 = <0x00000 0x100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x100000 0x80000>; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x200000>; + read-only; + + compatible = "nvmem-cells"; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_a002a: macaddr@a002a { + compatible = "mac-base"; + reg = <0xa002a 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_a0024: macaddr@a0024 { + compatible = "mac-base"; + reg = <0xa0024 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@380000 { + label = "fip"; + reg = <0x380000 0x200000>; + read-only; + }; + + ubi: partition@580000 { + label = "ubi"; + reg = <0x580000 0x7000000>; + }; + }; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "wan"; + + nvmem-cells = <&macaddr_factory_a0024 0>; + nvmem-cell-names = "mac-address"; + }; + + port@1 { + reg = <1>; + label = "lan1"; + }; + + port@2 { + reg = <2>; + label = "lan2"; + }; + + port@3 { + reg = <3>; + label = "lan3"; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&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 = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&wifi { + status = "okay"; + + mediatek,mtd-eeprom = <&factory 0x0>; +}; diff --git a/target/linux/mediatek/dts/mt7981b-livinet-zr-3020.dts b/target/linux/mediatek/dts/mt7981b-livinet-zr-3020.dts index 3d0934c9995..c1607665729 100644 --- a/target/linux/mediatek/dts/mt7981b-livinet-zr-3020.dts +++ b/target/linux/mediatek/dts/mt7981b-livinet-zr-3020.dts @@ -110,7 +110,7 @@ }; &mdio_bus { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/mediatek/dts/mt7981b-qihoo-360t7-ubootmod.dts b/target/linux/mediatek/dts/mt7981b-qihoo-360t7-ubootmod.dts index 1285a5f8e05..f0ec2f69d13 100644 --- a/target/linux/mediatek/dts/mt7981b-qihoo-360t7-ubootmod.dts +++ b/target/linux/mediatek/dts/mt7981b-qihoo-360t7-ubootmod.dts @@ -69,7 +69,7 @@ phy-mode = "2500base-x"; nvmem-cells = <&macaddr_factory_14 0>; - nvmem-cell-names = "mac-address-ascii"; + nvmem-cell-names = "mac-address"; fixed-link { speed = <2500>; @@ -80,7 +80,7 @@ }; &mdio_bus { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; @@ -205,7 +205,7 @@ label = "wan"; nvmem-cells = <&macaddr_factory_14 1>; - nvmem-cell-names = "mac-address-ascii"; + nvmem-cell-names = "mac-address"; }; port@6 { diff --git a/target/linux/mediatek/dts/mt7981b-qihoo-360t7.dts b/target/linux/mediatek/dts/mt7981b-qihoo-360t7.dts index d897697ef23..cd6f6b30c3e 100644 --- a/target/linux/mediatek/dts/mt7981b-qihoo-360t7.dts +++ b/target/linux/mediatek/dts/mt7981b-qihoo-360t7.dts @@ -74,7 +74,7 @@ }; &mdio_bus { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u.dtsi b/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u.dtsi index 7ab94f36230..d09ae2a3e78 100644 --- a/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u.dtsi +++ b/target/linux/mediatek/dts/mt7981b-xiaomi-mi-router-wr30u.dtsi @@ -86,7 +86,7 @@ }; &mdio_bus { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts b/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts index 35a2c30bb45..6bff786558b 100644 --- a/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts +++ b/target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts @@ -229,7 +229,7 @@ mxl,led-config = <0x0 0x0 0x370 0x80>; }; - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; diff --git a/target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200.dts b/target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200.dts index ac854f10d13..2af18958bc5 100644 --- a/target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200.dts +++ b/target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200.dts @@ -136,7 +136,7 @@ mxl,led-config = <0x03f0 0x0 0x0 0x0>; }; - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; @@ -361,4 +361,4 @@ &usb_phy { status = "okay"; -}; \ No newline at end of file +}; diff --git a/target/linux/mediatek/dts/mt7986a-asus-tuf-ax6000.dts b/target/linux/mediatek/dts/mt7986a-asus-tuf-ax6000.dts index 2e9114f99c0..41e6d2471d0 100644 --- a/target/linux/mediatek/dts/mt7986a-asus-tuf-ax6000.dts +++ b/target/linux/mediatek/dts/mt7986a-asus-tuf-ax6000.dts @@ -142,7 +142,7 @@ mxl,led-config = <0x03f0 0x0 0x0 0x0>; }; - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; @@ -379,4 +379,4 @@ &usb_phy { status = "okay"; -}; \ No newline at end of file +}; diff --git a/target/linux/mediatek/dts/mt7986a-glinet-gl-mt6000.dts b/target/linux/mediatek/dts/mt7986a-glinet-gl-mt6000.dts index 2be1907f632..fded507039b 100644 --- a/target/linux/mediatek/dts/mt7986a-glinet-gl-mt6000.dts +++ b/target/linux/mediatek/dts/mt7986a-glinet-gl-mt6000.dts @@ -122,7 +122,7 @@ realtek,aldps-enable; }; - switch: switch@31 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 18 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi b/target/linux/mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi index 84eb8cf3fe8..717acfec168 100644 --- a/target/linux/mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi +++ b/target/linux/mediatek/dts/mt7986a-tplink-tl-xdr-common.dtsi @@ -143,7 +143,7 @@ realtek,led-link-select = <0xa7 0x0 0x0>; }; - switch: switch@31 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dtsi b/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dtsi index 9ae44184292..573d7ac23ca 100644 --- a/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dtsi +++ b/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dtsi @@ -72,7 +72,7 @@ }; &mdio { - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-stock.dts b/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-stock.dts index 2469d3d77d1..331150d85db 100644 --- a/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-stock.dts +++ b/target/linux/mediatek/dts/mt7986a-zyxel-ex5601-t0-stock.dts @@ -199,7 +199,7 @@ reg = <6>; }; - switch@0 { + switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/mediatek/dts/mt7986b-mercusys-mr90x-v1.dts b/target/linux/mediatek/dts/mt7986b-mercusys-mr90x-v1.dts index e42b2c47c31..31a96cf7901 100644 --- a/target/linux/mediatek/dts/mt7986b-mercusys-mr90x-v1.dts +++ b/target/linux/mediatek/dts/mt7986b-mercusys-mr90x-v1.dts @@ -120,7 +120,7 @@ reg = <6>; }; - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; diff --git a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts index 1d3c575b7d4..d326c416a9d 100644 --- a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts +++ b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts @@ -200,7 +200,7 @@ }; &mdio { - switch: switch@31 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; interrupt-controller; diff --git a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi index 1ab56e37f74..26d560bd4bc 100644 --- a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi +++ b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi @@ -99,7 +99,7 @@ reg = <6>; }; - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 5 0>; diff --git a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts index 83d51916717..8cd094f7c3e 100644 --- a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts +++ b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts @@ -108,7 +108,7 @@ phy-mode = "2500base-x"; }; - switch@0 { + switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 5 0>; diff --git a/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi b/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi index 1ab56e37f74..26d560bd4bc 100644 --- a/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi +++ b/target/linux/mediatek/files-6.1/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi @@ -99,7 +99,7 @@ reg = <6>; }; - switch: switch@0 { + switch: switch@1f { compatible = "mediatek,mt7531"; reg = <31>; reset-gpios = <&pio 5 0>; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 1c8784560b2..870250ab6fe 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -42,6 +42,7 @@ mediatek_setup_interfaces() cetron,ct3003-ubootmod|\ cmcc,a10-ubootmod|\ cudy,wr3000-v1|\ + jcg,q30|\ jcg,q30-ubootmod|\ livinet,zr-3020|\ livinet,zr-3020-ubootmod|\ diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index cfc7e80e1bd..f00983e3764 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -91,9 +91,11 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress ;; + jcg,q30|\ jcg,q30-ubootmod) - [ "$PHYNBR" = "1" ] && \ - macaddr_setbit_la "$(mtd_get_mac_binary Factory 0x4)" > /sys${DEVPATH}/macaddress + # Originally, phy1 is phy0 mac with LA bit set. However, this would conflict + # addresses on multiple VIFs with the other radio. Use label mac to set LA bit. + [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(get_mac_label) > /sys${DEVPATH}/macaddress ;; livinet,zr-3020|\ livinet,zr-3020-ubootmod) diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index cba07bf11ea..d4ccc9a5d16 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -114,6 +114,7 @@ platform_do_upgrade() { emmc_do_upgrade "$1" ;; h3c,magic-nx30-pro|\ + jcg,q30|\ mediatek,mt7981-rfb|\ qihoo,360t7|\ tplink,tl-xdr4288|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 747a36d01b4..7f3e88c2d0b 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -213,7 +213,9 @@ define Device/bananapi_bpi-r3 pad-to 64M | append-image squashfs-sysupgrade.itb | check-size |\ ) \ gzip +ifeq ($(DUMP),) IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m +endif KERNEL := kernel-bin | gzip KERNEL_INITRAMFS := kernel-bin | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k @@ -232,7 +234,8 @@ define Device/bananapi_bpi-r3-mini DEVICE_DTC_FLAGS := --pad 4096 DEVICE_DTS_LOADADDR := 0x43f00000 DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-mt7986-firmware mt7986-wo-firmware \ - kmod-usb3 automount f2fsck mkf2fs + kmod-usb3 automount f2fsck mkf2fs \ + kmod-usb-net-cdc-mbim kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi KERNEL_LOADADDR := 0x44000000 KERNEL := kernel-bin | gzip KERNEL_INITRAMFS := kernel-bin | lzma | \ @@ -501,6 +504,35 @@ define Device/imou_lc-hx3001-ubootmod endef TARGET_DEVICES += imou_lc-hx3001-ubootmod +define Device/jcg_q30 + DEVICE_VENDOR := JCG + DEVICE_MODEL := Q30 (OpenWrt U-Boot layout) + DEVICE_ALT0_VENDOR := JCG + DEVICE_ALT0_MODEL := Q30 Pro (OpenWrt U-Boot layout) + DEVICE_ALT1_VENDOR := CMCC + DEVICE_ALT1_MODEL := MR3000D-CIq (OpenWrt U-Boot layout) + SUPPORTED_DEVICES += jcg,q30-pro + DEVICE_DTS := mt7981b-jcg-q30 + DEVICE_DTS_DIR := ../dts + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_IN_UBI := 1 + UBOOTENV_IN_UBI := 1 + IMAGES := sysupgrade.itb + 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 + IMAGE/sysupgrade.itb := append-kernel | \ + fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | append-metadata + DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware + ARTIFACTS := preloader.bin bl31-uboot.fip + ARTIFACT/preloader.bin := mt7981-bl2 spim-nand-ddr3 + ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot jcg_q30 +endef +TARGET_DEVICES += jcg_q30 + define Device/jcg_q30-ubootmod DEVICE_VENDOR := JCG DEVICE_MODEL := Q30 (custom U-Boot layout) diff --git a/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk index 85776ef6d95..e362e7428bd 100644 --- a/target/linux/mediatek/image/mt7622.mk +++ b/target/linux/mediatek/image/mt7622.mk @@ -107,7 +107,9 @@ define Device/bananapi_bpi-r64 pad-to 46080k | append-image squashfs-sysupgrade.itb | check-size |\ ) \ gzip +ifeq ($(DUMP),) IMAGE_SIZE := $$(shell expr 45 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m +endif KERNEL := kernel-bin | gzip KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb with-initrd | pad-to 128k IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb external-static-with-rootfs | append-metadata diff --git a/target/linux/mediatek/image/mt7623.mk b/target/linux/mediatek/image/mt7623.mk index 5828c4d763d..2c4402da661 100644 --- a/target/linux/mediatek/image/mt7623.mk +++ b/target/linux/mediatek/image/mt7623.mk @@ -96,7 +96,9 @@ define Device/bananapi_bpi-r2 KERNEL := kernel-bin | gzip KERNEL_INITRAMFS_SUFFIX := -recovery.itb KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb with-initrd +ifeq ($(DUMP),) IMAGE_SIZE := $$(shell expr 48 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m +endif IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb external-static-with-rootfs | append-metadata ARTIFACT/preloader.bin := mt7623-mbr emmc |\ pad-to 2k | append-preloader $$(UBOOT_TARGET) @@ -130,7 +132,9 @@ define Device/unielec_u7623-02 UBOOT_TARGET := mt7623a_unielec_u7623 UBOOT_IMAGE := u-boot-mtk.bin UBOOT_PATH := $(STAGING_DIR_IMAGE)/$$(UBOOT_TARGET)-$$(UBOOT_IMAGE) +ifeq ($(DUMP),) IMAGE_SIZE := $$(shell expr 48 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m +endif IMAGES := sysupgrade.itb KERNEL := kernel-bin | gzip KERNEL_INITRAMFS_SUFFIX := -recovery.itb diff --git a/target/linux/mediatek/patches-5.15/341-mtd-spinand-winbond-Support-for-W25MxxGV-W25NxxKV-se.patch b/target/linux/mediatek/patches-5.15/341-mtd-spinand-winbond-Support-for-W25MxxGV-W25NxxKV-se.patch new file mode 100644 index 00000000000..197c9af2b6d --- /dev/null +++ b/target/linux/mediatek/patches-5.15/341-mtd-spinand-winbond-Support-for-W25MxxGV-W25NxxKV-se.patch @@ -0,0 +1,161 @@ +From 9471c6ebf176284108115f60e22a176e70b97c0b Mon Sep 17 00:00:00 2001 +From: Chen Minqiang +Date: Thu, 12 Oct 2023 06:51:40 +0800 +Subject: [PATCH] mtd: spinand: winbond: Support for W25MxxGV W25NxxKV series + +--- + drivers/mtd/nand/spi/winbond.c | 115 +++++++++++++++++++++++++++++++++ + 1 file changed, 115 insertions(+) + +--- a/drivers/mtd/nand/spi/winbond.c ++++ b/drivers/mtd/nand/spi/winbond.c +@@ -15,6 +15,23 @@ + + #define WINBOND_CFG_BUF_READ BIT(3) + ++#define W25N02_N04KV_STATUS_ECC_MASK (3 << 4) ++#define W25N02_N04KV_STATUS_ECC_NO_BITFLIPS (0 << 4) ++#define W25N02_N04KV_STATUS_ECC_1_4_BITFLIPS (1 << 4) ++#define W25N02_N04KV_STATUS_ECC_5_8_BITFLIPS (3 << 4) ++#define W25N02_N04KV_STATUS_ECC_UNCOR_ERROR (2 << 4) ++ ++#define W25N01_M02GV_STATUS_ECC_MASK (3 << 4) ++#define W25N01_M02GV_STATUS_ECC_NO_BITFLIPS (0 << 4) ++#define W25N01_M02GV_STATUS_ECC_1_BITFLIPS (1 << 4) ++#define W25N01_M02GV_STATUS_ECC_UNCOR_ERROR (2 << 4) ++ ++#define W25N01KV_STATUS_ECC_MASK (3 << 4) ++#define W25N01KV_STATUS_ECC_NO_BITFLIPS (0 << 4) ++#define W25N01KV_STATUS_ECC_1_3_BITFLIPS (1 << 4) ++#define W25N01KV_STATUS_ECC_4_BITFLIPS (3 << 4) ++#define W25N01KV_STATUS_ECC_UNCOR_ERROR (2 << 4) ++ + static SPINAND_OP_VARIANTS(read_cache_variants, + SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0), +@@ -31,6 +48,29 @@ static SPINAND_OP_VARIANTS(update_cache_ + SPINAND_PROG_LOAD_X4(false, 0, NULL, 0), + SPINAND_PROG_LOAD(false, 0, NULL, 0)); + ++static int w25n02kv_n04kv_ooblayout_ecc(struct mtd_info *mtd, int section, ++ struct mtd_oob_region *region) ++{ ++ return -ERANGE; ++} ++ ++static int w25n02kv_n04kv_ooblayout_free(struct mtd_info *mtd, int section, ++ struct mtd_oob_region *region) ++{ ++ if (section > 3) ++ return -ERANGE; ++ ++ region->offset = (16 * section) + 2; ++ region->length = 14; ++ ++ return 0; ++} ++ ++static const struct mtd_ooblayout_ops w25n02kv_n04kv_ooblayout = { ++ .ecc = w25n02kv_n04kv_ooblayout_ecc, ++ .free = w25n02kv_n04kv_ooblayout_free, ++}; ++ + static int w25m02gv_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) + { +@@ -140,6 +180,58 @@ static int w25n02kv_ecc_get_status(struc + return -EINVAL; + } + ++static int w25n01kv_ecc_get_status(struct spinand_device *spinand, ++ u8 status) ++{ ++ switch (status & W25N01KV_STATUS_ECC_MASK) { ++ case W25N01KV_STATUS_ECC_NO_BITFLIPS: ++ return 0; ++ ++ case W25N01KV_STATUS_ECC_1_3_BITFLIPS: ++ return 3; ++ ++ case W25N01KV_STATUS_ECC_4_BITFLIPS: ++ return 4; ++ ++ case W25N01KV_STATUS_ECC_UNCOR_ERROR: ++ return -EBADMSG; ++ ++ default: ++ break; ++ } ++ ++ return -EINVAL; ++} ++ ++static int w25n02kv_n04kv_ecc_get_status(struct spinand_device *spinand, ++ u8 status) ++{ ++ switch (status & W25N02_N04KV_STATUS_ECC_MASK) { ++ case W25N02_N04KV_STATUS_ECC_NO_BITFLIPS: ++ return 0; ++ ++ case W25N02_N04KV_STATUS_ECC_1_4_BITFLIPS: ++ return 3; ++ ++ case W25N02_N04KV_STATUS_ECC_5_8_BITFLIPS: ++ return 4; ++ ++ /* W25N02_N04KV_use internal 8bit ECC algorithm. ++ * But the ECC strength is 4 bit requried. ++ * Return 3 if the bit bit flip count less than 5. ++ * Return 4 if the bit bit flip count more than 5 to 8. ++ */ ++ ++ case W25N02_N04KV_STATUS_ECC_UNCOR_ERROR: ++ return -EBADMSG; ++ ++ default: ++ break; ++ } ++ ++ return -EINVAL; ++} ++ + static const struct spinand_info winbond_spinand_table[] = { + SPINAND_INFO("W25M02GV", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xab, 0x21), +@@ -151,6 +243,16 @@ static const struct spinand_info winbond + 0, + SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL), + SPINAND_SELECT_TARGET(w25m02gv_select_target)), ++ SPINAND_INFO("W25N01KV", ++ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xae, 0x21), ++ NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1), ++ NAND_ECCREQ(4, 512), ++ SPINAND_INFO_OP_VARIANTS(&read_cache_variants, ++ &write_cache_variants, ++ &update_cache_variants), ++ 0, ++ SPINAND_ECCINFO(&w25n02kv_n04kv_ooblayout, ++ w25n01kv_ecc_get_status)), + SPINAND_INFO("W25N01GV", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa, 0x21), + NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1), +@@ -169,6 +271,19 @@ static const struct spinand_info winbond + &update_cache_variants), + 0, + SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)), ++ /* W25N04KV has 2-die(lun), however, it can select die automatically. ++ * Treat it as single die here and double block size. ++ */ ++ SPINAND_INFO("W25N04KV", ++ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa, 0x23), ++ NAND_MEMORG(1, 2048, 128, 64, 4096, 40, 2, 1, 1), ++ NAND_ECCREQ(8, 512), ++ SPINAND_INFO_OP_VARIANTS(&read_cache_variants, ++ &write_cache_variants, ++ &update_cache_variants), ++ 0, ++ SPINAND_ECCINFO(&w25n02kv_n04kv_ooblayout, ++ w25n02kv_n04kv_ecc_get_status)), + }; + + static int winbond_spinand_init(struct spinand_device *spinand) diff --git a/target/linux/mediatek/patches-6.1/010-v6.3-arm64-dts-mt7986-add-Bananapi-R3.patch b/target/linux/mediatek/patches-6.1/010-v6.3-arm64-dts-mt7986-add-Bananapi-R3.patch index b459e9dfe73..38f159c74ee 100644 --- a/target/linux/mediatek/patches-6.1/010-v6.3-arm64-dts-mt7986-add-Bananapi-R3.patch +++ b/target/linux/mediatek/patches-6.1/010-v6.3-arm64-dts-mt7986-add-Bananapi-R3.patch @@ -405,7 +405,7 @@ Signed-off-by: Matthias Brugger +}; + +&mdio { -+ switch: switch@31 { ++ switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + interrupt-controller; diff --git a/target/linux/mediatek/patches-6.1/341-mtd-spinand-winbond-Support-for-W25MxxGV-W25NxxKV-se.patch b/target/linux/mediatek/patches-6.1/341-mtd-spinand-winbond-Support-for-W25MxxGV-W25NxxKV-se.patch new file mode 100644 index 00000000000..197c9af2b6d --- /dev/null +++ b/target/linux/mediatek/patches-6.1/341-mtd-spinand-winbond-Support-for-W25MxxGV-W25NxxKV-se.patch @@ -0,0 +1,161 @@ +From 9471c6ebf176284108115f60e22a176e70b97c0b Mon Sep 17 00:00:00 2001 +From: Chen Minqiang +Date: Thu, 12 Oct 2023 06:51:40 +0800 +Subject: [PATCH] mtd: spinand: winbond: Support for W25MxxGV W25NxxKV series + +--- + drivers/mtd/nand/spi/winbond.c | 115 +++++++++++++++++++++++++++++++++ + 1 file changed, 115 insertions(+) + +--- a/drivers/mtd/nand/spi/winbond.c ++++ b/drivers/mtd/nand/spi/winbond.c +@@ -15,6 +15,23 @@ + + #define WINBOND_CFG_BUF_READ BIT(3) + ++#define W25N02_N04KV_STATUS_ECC_MASK (3 << 4) ++#define W25N02_N04KV_STATUS_ECC_NO_BITFLIPS (0 << 4) ++#define W25N02_N04KV_STATUS_ECC_1_4_BITFLIPS (1 << 4) ++#define W25N02_N04KV_STATUS_ECC_5_8_BITFLIPS (3 << 4) ++#define W25N02_N04KV_STATUS_ECC_UNCOR_ERROR (2 << 4) ++ ++#define W25N01_M02GV_STATUS_ECC_MASK (3 << 4) ++#define W25N01_M02GV_STATUS_ECC_NO_BITFLIPS (0 << 4) ++#define W25N01_M02GV_STATUS_ECC_1_BITFLIPS (1 << 4) ++#define W25N01_M02GV_STATUS_ECC_UNCOR_ERROR (2 << 4) ++ ++#define W25N01KV_STATUS_ECC_MASK (3 << 4) ++#define W25N01KV_STATUS_ECC_NO_BITFLIPS (0 << 4) ++#define W25N01KV_STATUS_ECC_1_3_BITFLIPS (1 << 4) ++#define W25N01KV_STATUS_ECC_4_BITFLIPS (3 << 4) ++#define W25N01KV_STATUS_ECC_UNCOR_ERROR (2 << 4) ++ + static SPINAND_OP_VARIANTS(read_cache_variants, + SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0), +@@ -31,6 +48,29 @@ static SPINAND_OP_VARIANTS(update_cache_ + SPINAND_PROG_LOAD_X4(false, 0, NULL, 0), + SPINAND_PROG_LOAD(false, 0, NULL, 0)); + ++static int w25n02kv_n04kv_ooblayout_ecc(struct mtd_info *mtd, int section, ++ struct mtd_oob_region *region) ++{ ++ return -ERANGE; ++} ++ ++static int w25n02kv_n04kv_ooblayout_free(struct mtd_info *mtd, int section, ++ struct mtd_oob_region *region) ++{ ++ if (section > 3) ++ return -ERANGE; ++ ++ region->offset = (16 * section) + 2; ++ region->length = 14; ++ ++ return 0; ++} ++ ++static const struct mtd_ooblayout_ops w25n02kv_n04kv_ooblayout = { ++ .ecc = w25n02kv_n04kv_ooblayout_ecc, ++ .free = w25n02kv_n04kv_ooblayout_free, ++}; ++ + static int w25m02gv_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) + { +@@ -140,6 +180,58 @@ static int w25n02kv_ecc_get_status(struc + return -EINVAL; + } + ++static int w25n01kv_ecc_get_status(struct spinand_device *spinand, ++ u8 status) ++{ ++ switch (status & W25N01KV_STATUS_ECC_MASK) { ++ case W25N01KV_STATUS_ECC_NO_BITFLIPS: ++ return 0; ++ ++ case W25N01KV_STATUS_ECC_1_3_BITFLIPS: ++ return 3; ++ ++ case W25N01KV_STATUS_ECC_4_BITFLIPS: ++ return 4; ++ ++ case W25N01KV_STATUS_ECC_UNCOR_ERROR: ++ return -EBADMSG; ++ ++ default: ++ break; ++ } ++ ++ return -EINVAL; ++} ++ ++static int w25n02kv_n04kv_ecc_get_status(struct spinand_device *spinand, ++ u8 status) ++{ ++ switch (status & W25N02_N04KV_STATUS_ECC_MASK) { ++ case W25N02_N04KV_STATUS_ECC_NO_BITFLIPS: ++ return 0; ++ ++ case W25N02_N04KV_STATUS_ECC_1_4_BITFLIPS: ++ return 3; ++ ++ case W25N02_N04KV_STATUS_ECC_5_8_BITFLIPS: ++ return 4; ++ ++ /* W25N02_N04KV_use internal 8bit ECC algorithm. ++ * But the ECC strength is 4 bit requried. ++ * Return 3 if the bit bit flip count less than 5. ++ * Return 4 if the bit bit flip count more than 5 to 8. ++ */ ++ ++ case W25N02_N04KV_STATUS_ECC_UNCOR_ERROR: ++ return -EBADMSG; ++ ++ default: ++ break; ++ } ++ ++ return -EINVAL; ++} ++ + static const struct spinand_info winbond_spinand_table[] = { + SPINAND_INFO("W25M02GV", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xab, 0x21), +@@ -151,6 +243,16 @@ static const struct spinand_info winbond + 0, + SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL), + SPINAND_SELECT_TARGET(w25m02gv_select_target)), ++ SPINAND_INFO("W25N01KV", ++ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xae, 0x21), ++ NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1), ++ NAND_ECCREQ(4, 512), ++ SPINAND_INFO_OP_VARIANTS(&read_cache_variants, ++ &write_cache_variants, ++ &update_cache_variants), ++ 0, ++ SPINAND_ECCINFO(&w25n02kv_n04kv_ooblayout, ++ w25n01kv_ecc_get_status)), + SPINAND_INFO("W25N01GV", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa, 0x21), + NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1), +@@ -169,6 +271,19 @@ static const struct spinand_info winbond + &update_cache_variants), + 0, + SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)), ++ /* W25N04KV has 2-die(lun), however, it can select die automatically. ++ * Treat it as single die here and double block size. ++ */ ++ SPINAND_INFO("W25N04KV", ++ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xaa, 0x23), ++ NAND_MEMORG(1, 2048, 128, 64, 4096, 40, 2, 1, 1), ++ NAND_ECCREQ(8, 512), ++ SPINAND_INFO_OP_VARIANTS(&read_cache_variants, ++ &write_cache_variants, ++ &update_cache_variants), ++ 0, ++ SPINAND_ECCINFO(&w25n02kv_n04kv_ooblayout, ++ w25n02kv_n04kv_ecc_get_status)), + }; + + static int winbond_spinand_init(struct spinand_device *spinand) diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/br200-wp.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/br200-wp.dts index a4bc10ff388..f7d7b4cf08c 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/br200-wp.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/br200-wp.dts @@ -87,12 +87,16 @@ label = "hw-info"; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_hwinfo_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_hwinfo_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -167,43 +171,39 @@ reg = <1>; label = "lan1"; phy-handle = <&phy_port1>; - nvmem-cells = <&macaddr_hwinfo_0>; + nvmem-cells = <&macaddr_hwinfo_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; port@2 { reg = <2>; label = "lan2"; phy-handle = <&phy_port2>; - nvmem-cells = <&macaddr_hwinfo_0>; + nvmem-cells = <&macaddr_hwinfo_0 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; }; port@3 { reg = <3>; label = "lan3"; phy-handle = <&phy_port3>; - nvmem-cells = <&macaddr_hwinfo_0>; + nvmem-cells = <&macaddr_hwinfo_0 4>; nvmem-cell-names = "mac-address"; - mac-address-increment = <4>; }; port@4 { reg = <4>; label = "lan4"; phy-handle = <&phy_port4>; - nvmem-cells = <&macaddr_hwinfo_0>; + nvmem-cells = <&macaddr_hwinfo_0 5>; nvmem-cell-names = "mac-address"; - mac-address-increment = <5>; }; port@5 { reg = <5>; label = "wan"; phy-handle = <&phy_port5>; - nvmem-cells = <&macaddr_hwinfo_0>; + nvmem-cells = <&macaddr_hwinfo_0 0>; nvmem-cell-names = "mac-address"; }; @@ -232,7 +232,7 @@ enet0: ethernet@b0000 { status = "okay"; phy-connection-type = "rgmii-id"; - nvmem-cells = <&macaddr_hwinfo_0>; + nvmem-cells = <&macaddr_hwinfo_0 0>; nvmem-cell-names = "mac-address"; fixed-link { @@ -286,9 +286,8 @@ reg = <0x0000 0 0 0 0>; #gpio-cells = <2>; gpio-controller; - nvmem-cells = <&macaddr_hwinfo_0>; + nvmem-cells = <&macaddr_hwinfo_0 16>; nvmem-cell-names = "mac-address"; - mac-address-increment = <16>; }; }; }; @@ -326,7 +325,7 @@ / { chosen { - linux,stdout-path = "/soc@ffe00000/serial@4500"; + stdout-path = "/soc@ffe00000/serial@4500"; }; cpus { diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts index a807403a07a..f74aca58c0d 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts @@ -76,12 +76,16 @@ label = "hw-info"; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_hwinfo_0: macaddr@0 { - reg = <0x0 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_hwinfo_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; @@ -229,7 +233,7 @@ status = "okay"; phy-handle = <&phy0>; phy-connection-type = "rgmii-id"; - nvmem-cells = <&macaddr_hwinfo_0>; + nvmem-cells = <&macaddr_hwinfo_0 0>; nvmem-cell-names = "mac-address"; }; @@ -241,9 +245,8 @@ status = "okay"; phy-handle = <&phy1>; phy-connection-type = "rgmii-id"; - nvmem-cells = <&macaddr_hwinfo_0>; + nvmem-cells = <&macaddr_hwinfo_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; gpio0: gpio-controller@fc00 { diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts index c54cb53f945..ef46d8f14af 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts @@ -57,12 +57,14 @@ label = "u-boot"; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_4fc00: macaddr@4fc00 { - reg = <0x4fc00 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_4fc00: macaddr@4fc00 { + reg = <0x4fc00 0x6>; + }; }; }; diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3825i.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3825i.dts index a347900e5df..ef40a4d2a3d 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3825i.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3825i.dts @@ -20,7 +20,7 @@ chosen { bootargs-override = "console=ttyS0,115200"; - linux,stdout-path = &serial0; + stdout-path = &serial0; }; memory { diff --git a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network index 5c176d4963d..b9ac2bb1ae0 100644 --- a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network +++ b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network @@ -12,7 +12,8 @@ mvebu_setup_interfaces() local board="$1" case "$board" in - ctera,c200-v2) + ctera,c200-v2|\ + synology,ds213j) ucidef_set_interface_lan "eth0" "dhcp" ;; cznic,turris-omnia) diff --git a/target/linux/mvebu/cortexa9/config-5.15 b/target/linux/mvebu/cortexa9/config-5.15 index e666dd486fb..266596d6384 100644 --- a/target/linux/mvebu/cortexa9/config-5.15 +++ b/target/linux/mvebu/cortexa9/config-5.15 @@ -1,4 +1,7 @@ CONFIG_LED_TRIGGER_PHY=y CONFIG_MTD_SPLIT_SEIL_FW=y +CONFIG_MTD_SPLIT_UIMAGE_FW=y +CONFIG_MTD_VIRT_CONCAT=y CONFIG_PHY_MVEBU_A38X_COMPHY=y +CONFIG_POWER_RESET_QNAP=y CONFIG_RTC_DRV_MV=y diff --git a/target/linux/mvebu/cortexa9/config-6.1 b/target/linux/mvebu/cortexa9/config-6.1 index b2625c3b32e..7f825a806b1 100644 --- a/target/linux/mvebu/cortexa9/config-6.1 +++ b/target/linux/mvebu/cortexa9/config-6.1 @@ -4,6 +4,9 @@ CONFIG_CURRENT_POINTER_IN_TPIDRURO=y CONFIG_IRQSTACKS=y CONFIG_LED_TRIGGER_PHY=y CONFIG_MTD_SPLIT_SEIL_FW=y +CONFIG_MTD_SPLIT_UIMAGE_FW=y +CONFIG_MTD_VIRT_CONCAT=y CONFIG_PHY_MVEBU_A38X_COMPHY=y +CONFIG_POWER_RESET_QNAP=y CONFIG_RTC_DRV_MV=y CONFIG_THREAD_INFO_IN_TASK=y diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-380-iij-sa-w2.dts b/target/linux/mvebu/files/arch/arm/boot/dts/armada-380-iij-sa-w2.dts index d2483611ae6..09604e20176 100644 --- a/target/linux/mvebu/files/arch/arm/boot/dts/armada-380-iij-sa-w2.dts +++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-380-iij-sa-w2.dts @@ -352,7 +352,6 @@ }; partition@110000 { - compatible = "nvmem-cells"; reg = <0x110000 0xf0000>; label = "board_info"; read-only; diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-fortinet-fg-30e.dts b/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-fortinet-fg-30e.dts index da6db4755a9..8788f022f23 100644 --- a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-fortinet-fg-30e.dts +++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-fortinet-fg-30e.dts @@ -52,41 +52,36 @@ port@0 { reg = <0>; label = "wan"; - nvmem-cells = <&macaddr_bdinfo_d880>; + nvmem-cells = <&macaddr_bdinfo_d880 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; port@1 { reg = <1>; label = "lan4"; - nvmem-cells = <&macaddr_bdinfo_d880>; + nvmem-cells = <&macaddr_bdinfo_d880 5>; nvmem-cell-names = "mac-address"; - mac-address-increment = <5>; }; port@2 { reg = <2>; label = "lan3"; - nvmem-cells = <&macaddr_bdinfo_d880>; + nvmem-cells = <&macaddr_bdinfo_d880 4>; nvmem-cell-names = "mac-address"; - mac-address-increment = <4>; }; port@3 { reg = <3>; label = "lan2"; - nvmem-cells = <&macaddr_bdinfo_d880>; + nvmem-cells = <&macaddr_bdinfo_d880 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; }; port@4 { reg = <4>; label = "lan1"; - nvmem-cells = <&macaddr_bdinfo_d880>; + nvmem-cells = <&macaddr_bdinfo_d880 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; port@6 { diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-fortinet-fg-50e.dts b/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-fortinet-fg-50e.dts index 6030f4dabec..4deca093c2d 100644 --- a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-fortinet-fg-50e.dts +++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-fortinet-fg-50e.dts @@ -56,9 +56,8 @@ phy-connection-type = "sgmii"; buffer-manager = <&bm>; bm,pool-long = <2>; - nvmem-cells = <&macaddr_bdinfo_d880>; + nvmem-cells = <&macaddr_bdinfo_d880 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <1>; }; ð2 { @@ -68,9 +67,8 @@ phy-connection-type = "sgmii"; buffer-manager = <&bm>; bm,pool-long = <3>; - nvmem-cells = <&macaddr_bdinfo_d880>; + nvmem-cells = <&macaddr_bdinfo_d880 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <2>; }; &mdio { @@ -126,41 +124,36 @@ port@0 { reg = <0>; label = "lan5"; - nvmem-cells = <&macaddr_bdinfo_d880>; + nvmem-cells = <&macaddr_bdinfo_d880 7>; nvmem-cell-names = "mac-address"; - mac-address-increment = <7>; }; port@1 { reg = <1>; label = "lan4"; - nvmem-cells = <&macaddr_bdinfo_d880>; + nvmem-cells = <&macaddr_bdinfo_d880 6>; nvmem-cell-names = "mac-address"; - mac-address-increment = <6>; }; port@2 { reg = <2>; label = "lan3"; - nvmem-cells = <&macaddr_bdinfo_d880>; + nvmem-cells = <&macaddr_bdinfo_d880 5>; nvmem-cell-names = "mac-address"; - mac-address-increment = <5>; }; port@3 { reg = <3>; label = "lan2"; - nvmem-cells = <&macaddr_bdinfo_d880>; + nvmem-cells = <&macaddr_bdinfo_d880 4>; nvmem-cell-names = "mac-address"; - mac-address-increment = <4>; }; port@4 { reg = <4>; label = "lan1"; - nvmem-cells = <&macaddr_bdinfo_d880>; + nvmem-cells = <&macaddr_bdinfo_d880 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <3>; }; port@6 { diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-fortinet-fg-x0e.dtsi b/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-fortinet-fg-x0e.dtsi index 9b3b1f08fce..91458299a20 100644 --- a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-fortinet-fg-x0e.dtsi +++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-fortinet-fg-x0e.dtsi @@ -211,7 +211,7 @@ buffer-manager = <&bm>; bm,pool-long = <0>; bm,pool-short = <1>; - nvmem-cells = <&macaddr_bdinfo_d880>; + nvmem-cells = <&macaddr_bdinfo_d880 0>; nvmem-cell-names = "mac-address"; fixed-link { @@ -285,12 +285,16 @@ label = "board-info"; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_bdinfo_d880: macaddr@d880 { - reg = <0xd880 0x6>; + macaddr_bdinfo_d880: macaddr@d880 { + compatible = "mac-base"; + reg = <0xd880 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-nas1dual.dts b/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-nas1dual.dts index d14ea8b94e3..494487a8b41 100644 --- a/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-nas1dual.dts +++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-385-nas1dual.dts @@ -252,12 +252,14 @@ label = "u-boot"; read-only; - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_uboot_fffa8: macaddr@fffa8 { - reg = <0xfffa8 0x6>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_fffa8: macaddr@fffa8 { + reg = <0xfffa8 0x6>; + }; }; }; diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts index 8d163059a00..22dcbfac35f 100644 --- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts +++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts @@ -104,6 +104,20 @@ label = "factory"; reg = <0xf8000 0x8000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_factory_6: macaddr@6 { + reg = <0x6 0x6>; + }; + }; }; partition@100000 { @@ -231,17 +245,3 @@ full-duplex; }; }; - -&factory { - compatible = "nvmem-cells"; - #address-cells = <1>; - #size-cells = <1>; - - macaddr_factory_0: macaddr@0 { - reg = <0x0 0x6>; - }; - - macaddr_factory_6: macaddr@6 { - reg = <0x6 0x6>; - }; -}; diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk index 3bf8c55e191..a266897c1b5 100644 --- a/target/linux/mvebu/image/cortexa9.mk +++ b/target/linux/mvebu/image/cortexa9.mk @@ -388,3 +388,22 @@ define Device/solidrun_clearfog-pro-a1 SUPPORTED_DEVICES += armada-388-clearfog armada-388-clearfog-pro endef TARGET_DEVICES += solidrun_clearfog-pro-a1 + +define Device/synology_ds213j + DEVICE_VENDOR := Synology + DEVICE_MODEL := DS213j + KERNEL_SIZE := 6912k + IMAGE_SIZE := 7168k + FILESYSTEMS := squashfs ubifs + KERNEL := kernel-bin | append-dtb | uImage none + KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none + DEVICE_DTS := armada-370-synology-ds213j + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ + check-size | append-metadata + DEVICE_PACKAGES := \ + kmod-rtc-s35390a kmod-hwmon-gpiofan kmod-hwmon-drivetemp \ + kmod-md-raid0 kmod-md-raid1 kmod-md-mod e2fsprogs mdadm \ + -ppp -kmod-nft-offload -firewall4 -dnsmasq -odhcpd-ipv6only +endef +TARGET_DEVICES += synology_ds213j diff --git a/target/linux/mvebu/patches-5.15/320-arm-dts-armada-370-synology-ds213j-mtd-parts.patch b/target/linux/mvebu/patches-5.15/320-arm-dts-armada-370-synology-ds213j-mtd-parts.patch new file mode 100644 index 00000000000..280fc5957e4 --- /dev/null +++ b/target/linux/mvebu/patches-5.15/320-arm-dts-armada-370-synology-ds213j-mtd-parts.patch @@ -0,0 +1,134 @@ +--- a/arch/arm/boot/dts/armada-370-synology-ds213j.dts ++++ b/arch/arm/boot/dts/armada-370-synology-ds213j.dts +@@ -31,6 +31,7 @@ + + chosen { + stdout-path = "serial0:115200n8"; ++ append-rootblock = "nullparameter="; /* override the bootloader args */ + }; + + memory@0 { +@@ -94,6 +95,8 @@ + status = "okay"; + phy = <&phy1>; + phy-mode = "sgmii"; ++ nvmem-cells = <&macaddr_vendor_0>; ++ nvmem-cell-names = "mac-address"; + }; + + sata@a0000 { +@@ -175,6 +178,24 @@ + gpio = <&gpio1 30 GPIO_ACTIVE_HIGH>; + }; + }; ++ ++ virtual_flash { ++ compatible = "mtd-concat"; ++ ++ devices = <&mtd_kernel &mtd_gap &mtd_gap2>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ compatible = "openwrt,uimage", "denx,uimage"; ++ label = "firmware"; ++ reg = <0x0 0x0>; ++ }; ++ }; ++ }; + }; + + &mdio { +@@ -265,48 +286,52 @@ + reg = <0>; /* Chip select 0 */ + spi-max-frequency = <20000000>; + +- /* +- * Warning! +- * +- * Synology u-boot uses its compiled-in environment +- * and it seems Synology did not care to change u-boot +- * default configuration in order to allow saving a +- * modified environment at a sensible location. So, +- * if you do a 'saveenv' under u-boot, your modified +- * environment will be saved at 1MB after the start +- * of the flash, i.e. in the middle of the uImage. +- * For that reason, it is strongly advised not to +- * change the default environment, unless you know +- * what you are doing. +- */ +- partition@0 { /* u-boot */ +- label = "RedBoot"; +- reg = <0x00000000 0x000c0000>; /* 768KB */ +- }; ++ partitions { ++ compatible = "fixed-partitions"; + +- partition@c0000 { /* uImage */ +- label = "zImage"; +- reg = <0x000c0000 0x002d0000>; /* 2880KB */ +- }; ++ partition@0 { /* u-boot */ ++ label = "u-boot"; ++ reg = <0x00000000 0x000c0000>; /* 768KB */ ++ read-only; ++ }; + +- partition@390000 { /* uInitramfs */ +- label = "rd.gz"; +- reg = <0x00390000 0x00440000>; /* 4250KB */ +- }; ++ mtd_gap: partition@c0000 { /* gap */ ++ label = "gap"; ++ reg = <0x000c0000 0x00040000>; /* 256KB */ ++ }; + +- partition@7d0000 { /* MAC address and serial number */ +- label = "vendor"; +- reg = <0x007d0000 0x00010000>; /* 64KB */ +- }; ++ partition@100000 { /* u-boot-env */ ++ label = "u-boot-env"; ++ reg = <0x00100000 0x00010000>; /* 64KB */ ++ }; + +- partition@7e0000 { +- label = "RedBoot config"; +- reg = <0x007e0000 0x00010000>; /* 64KB */ +- }; ++ mtd_kernel: partition@110000 { ++ label = "kernel"; ++ reg = <0x00110000 0x006c0000>; /* 6912KB */ ++ }; + +- partition@7f0000 { +- label = "FIS directory"; +- reg = <0x007f0000 0x00010000>; /* 64KB */ ++ partition@7d0000 { /* MAC address and serial number */ ++ reg = <0x007d0000 0x00010000>; /* 64KB */ ++ label = "vendor"; ++ read-only; ++ ++ compatible = "nvmem-cells"; ++ ++ nvmem-layout { ++ compatible = "fixed-layout"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ macaddr_vendor_0: macaddr@0 { ++ reg = <0x0 0x6>; ++ }; ++ }; ++ }; ++ ++ mtd_gap2: partition@7e0000 { ++ label = "gap2"; ++ reg = <0x007e0000 0x00020000>; /* 128KB */ ++ }; + }; + }; + }; diff --git a/target/linux/mvebu/patches-6.1/320-arm-dts-armada-370-synology-ds213j-mtd-parts.patch b/target/linux/mvebu/patches-6.1/320-arm-dts-armada-370-synology-ds213j-mtd-parts.patch new file mode 100644 index 00000000000..280fc5957e4 --- /dev/null +++ b/target/linux/mvebu/patches-6.1/320-arm-dts-armada-370-synology-ds213j-mtd-parts.patch @@ -0,0 +1,134 @@ +--- a/arch/arm/boot/dts/armada-370-synology-ds213j.dts ++++ b/arch/arm/boot/dts/armada-370-synology-ds213j.dts +@@ -31,6 +31,7 @@ + + chosen { + stdout-path = "serial0:115200n8"; ++ append-rootblock = "nullparameter="; /* override the bootloader args */ + }; + + memory@0 { +@@ -94,6 +95,8 @@ + status = "okay"; + phy = <&phy1>; + phy-mode = "sgmii"; ++ nvmem-cells = <&macaddr_vendor_0>; ++ nvmem-cell-names = "mac-address"; + }; + + sata@a0000 { +@@ -175,6 +178,24 @@ + gpio = <&gpio1 30 GPIO_ACTIVE_HIGH>; + }; + }; ++ ++ virtual_flash { ++ compatible = "mtd-concat"; ++ ++ devices = <&mtd_kernel &mtd_gap &mtd_gap2>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ partition@0 { ++ compatible = "openwrt,uimage", "denx,uimage"; ++ label = "firmware"; ++ reg = <0x0 0x0>; ++ }; ++ }; ++ }; + }; + + &mdio { +@@ -265,48 +286,52 @@ + reg = <0>; /* Chip select 0 */ + spi-max-frequency = <20000000>; + +- /* +- * Warning! +- * +- * Synology u-boot uses its compiled-in environment +- * and it seems Synology did not care to change u-boot +- * default configuration in order to allow saving a +- * modified environment at a sensible location. So, +- * if you do a 'saveenv' under u-boot, your modified +- * environment will be saved at 1MB after the start +- * of the flash, i.e. in the middle of the uImage. +- * For that reason, it is strongly advised not to +- * change the default environment, unless you know +- * what you are doing. +- */ +- partition@0 { /* u-boot */ +- label = "RedBoot"; +- reg = <0x00000000 0x000c0000>; /* 768KB */ +- }; ++ partitions { ++ compatible = "fixed-partitions"; + +- partition@c0000 { /* uImage */ +- label = "zImage"; +- reg = <0x000c0000 0x002d0000>; /* 2880KB */ +- }; ++ partition@0 { /* u-boot */ ++ label = "u-boot"; ++ reg = <0x00000000 0x000c0000>; /* 768KB */ ++ read-only; ++ }; + +- partition@390000 { /* uInitramfs */ +- label = "rd.gz"; +- reg = <0x00390000 0x00440000>; /* 4250KB */ +- }; ++ mtd_gap: partition@c0000 { /* gap */ ++ label = "gap"; ++ reg = <0x000c0000 0x00040000>; /* 256KB */ ++ }; + +- partition@7d0000 { /* MAC address and serial number */ +- label = "vendor"; +- reg = <0x007d0000 0x00010000>; /* 64KB */ +- }; ++ partition@100000 { /* u-boot-env */ ++ label = "u-boot-env"; ++ reg = <0x00100000 0x00010000>; /* 64KB */ ++ }; + +- partition@7e0000 { +- label = "RedBoot config"; +- reg = <0x007e0000 0x00010000>; /* 64KB */ +- }; ++ mtd_kernel: partition@110000 { ++ label = "kernel"; ++ reg = <0x00110000 0x006c0000>; /* 6912KB */ ++ }; + +- partition@7f0000 { +- label = "FIS directory"; +- reg = <0x007f0000 0x00010000>; /* 64KB */ ++ partition@7d0000 { /* MAC address and serial number */ ++ reg = <0x007d0000 0x00010000>; /* 64KB */ ++ label = "vendor"; ++ read-only; ++ ++ compatible = "nvmem-cells"; ++ ++ nvmem-layout { ++ compatible = "fixed-layout"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ macaddr_vendor_0: macaddr@0 { ++ reg = <0x0 0x6>; ++ }; ++ }; ++ }; ++ ++ mtd_gap2: partition@7e0000 { ++ label = "gap2"; ++ reg = <0x007e0000 0x00020000>; /* 128KB */ ++ }; + }; + }; + }; diff --git a/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn7130_ubnt_edgerouter-4.dts b/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn7130_ubnt_edgerouter-4.dts index f8d511b5990..401aafe1674 100644 --- a/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn7130_ubnt_edgerouter-4.dts +++ b/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn7130_ubnt_edgerouter-4.dts @@ -14,7 +14,7 @@ status = "okay"; phy-mode = "sgmii"; phy-handle = <&phy4>; - nvmem-cells = <&macaddr_eeprom_0>; + nvmem-cells = <&macaddr_eeprom_0 0>; nvmem-cell-names = "mac-address"; }; }; diff --git a/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn7130_ubnt_edgerouter-6p.dts b/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn7130_ubnt_edgerouter-6p.dts index f354d08199a..270e2a32648 100644 --- a/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn7130_ubnt_edgerouter-6p.dts +++ b/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn7130_ubnt_edgerouter-6p.dts @@ -32,7 +32,7 @@ status = "okay"; phy-mode = "sgmii"; phy-handle = <&phy4>; - nvmem-cells = <&macaddr_eeprom_0>; + nvmem-cells = <&macaddr_eeprom_0 0>; nvmem-cell-names = "mac-address"; }; }; @@ -45,9 +45,8 @@ status = "okay"; phy-mode = "sgmii"; phy-handle = <&phy8>; - nvmem-cells = <&macaddr_eeprom_0>; + nvmem-cells = <&macaddr_eeprom_0 4>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(4)>; }; ethernet@1 { @@ -55,9 +54,8 @@ status = "okay"; phy-mode = "sgmii"; phy-handle = <&phy9>; - nvmem-cells = <&macaddr_eeprom_0>; + nvmem-cells = <&macaddr_eeprom_0 5>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(5)>; }; }; }; diff --git a/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn7130_ubnt_edgerouter-e300.dtsi b/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn7130_ubnt_edgerouter-e300.dtsi index 9be52f91759..ad73a08a1e2 100644 --- a/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn7130_ubnt_edgerouter-e300.dtsi +++ b/target/linux/octeon/files/arch/mips/boot/dts/cavium-octeon/cn7130_ubnt_edgerouter-e300.dtsi @@ -117,16 +117,20 @@ }; partition@400000 { - compatible = "nvmem-cells"; - reg = <0x400000 0x10000>; label = "eeprom"; read-only; + reg = <0x400000 0x10000>; - #address-cells = <1>; - #size-cells = <1>; + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; - macaddr_eeprom_0: macaddr@0 { - reg = <0x0 0x6>; + macaddr_eeprom_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; }; }; }; @@ -194,9 +198,8 @@ status = "okay"; phy-mode = "sgmii"; phy-handle = <&phy5>; - nvmem-cells = <&macaddr_eeprom_0>; + nvmem-cells = <&macaddr_eeprom_0 1>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(1)>; }; ethernet@2 { @@ -204,9 +207,8 @@ status = "okay"; phy-mode = "sgmii"; phy-handle = <&phy6>; - nvmem-cells = <&macaddr_eeprom_0>; + nvmem-cells = <&macaddr_eeprom_0 2>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(2)>; }; ethernet@3 { @@ -214,10 +216,8 @@ status = "okay"; phy-mode = "sgmii"; phy-handle = <&phy7>; - nvmem-cells = <&macaddr_eeprom_0>; + nvmem-cells = <&macaddr_eeprom_0 3>; nvmem-cell-names = "mac-address"; - mac-address-increment = <(3)>; }; }; }; - diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts index 3f19e4fee99..622b8662fa9 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts @@ -271,32 +271,11 @@ &switch { status = "okay"; - switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */ - switch_wan_bmp = ; /* wan port bitmap */ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ + switch_lan_bmp = ; /* lan port bitmap */ + switch_mac_mode = ; /* mac mode for uniphy instance0*/ qcom,port_phyinfo { - port@0 { - port_id = <1>; - phy_address = <0>; - }; - port@1 { - port_id = <2>; - phy_address = <1>; - }; - port@2 { - port_id = <3>; - phy_address = <2>; - }; - port@3 { - port_id = <4>; - phy_address = <3>; - }; - port@4 { + port@5 { port_id = <5>; phy_address = <4>; }; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi index 82a981b5faa..23b9121d5fc 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dtsi @@ -235,28 +235,24 @@ &switch { status = "okay"; - switch_lan_bmp = <(ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */ - switch_wan_bmp = ; /* wan port bitmap */ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ + switch_lan_bmp = <(ESS_PORT3 | ESS_PORT4 | ESS_PORT5)>; /* lan port bitmap */ + switch_wan_bmp = ; /* wan port bitmap */ + switch_mac_mode = ; /* mac mode for uniphy instance0*/ qcom,port_phyinfo { - port@1 { + port@2 { port_id = <2>; phy_address = <1>; }; - port@2 { + port@3 { port_id = <3>; phy_address = <2>; }; - port@3 { + port@4 { port_id = <4>; phy_address = <3>; }; - port@4 { + port@5 { port_id = <5>; phy_address = <4>; }; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts index e373af1ba82..7067f929687 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts @@ -343,21 +343,18 @@ &switch { status = "okay"; - switch_lan_bmp = ; /* lan port bitmap */ - switch_wan_bmp = ; /* wan port bitmap */ - switch_mac_mode = <0xff>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xf>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ + switch_lan_bmp = ; /* lan port bitmap */ + switch_wan_bmp = ; /* wan port bitmap */ + switch_mac_mode1 = ; /* mac mode for uniphy instance1*/ + switch_mac_mode2 = ; /* mac mode for uniphy instance2*/ qcom,port_phyinfo { - port@4 { + port@5 { port_id = <5>; phy_address = <24>; port_mac_sel = "QGMAC_PORT"; }; - port@5 { + port@6 { port_id = <6>; phy_address = <28>; port_mac_sel = "QGMAC_PORT"; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts index 245ec99cf7d..45fc448cd9f 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts @@ -167,20 +167,18 @@ switch_lan_bmp = ; /* lan port bitmap */ switch_wan_bmp = ; /* wan port bitmap */ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xf>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ + switch_mac_mode = ; /* mac mode for uniphy instance0*/ + switch_mac_mode1 = ; /* mac mode for uniphy instance1*/ + switch_mac_mode2 = ; /* mac mode for uniphy instance2*/ qcom,port_phyinfo { - port@4 { + port@5 { port_id = <5>; phy_address = <24>; port_mac_sel = "QGMAC_PORT"; }; - port@5 { + port@6 { port_id = <6>; phy_address = <28>; port_mac_sel = "QGMAC_PORT"; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts index ce82f24ae8a..a7d398ee0f1 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts @@ -321,13 +321,12 @@ &switch { status = "okay"; - switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT5)>; /* lan port bitmap */ - switch_wan_bmp = ; /* wan port bitmap */ - switch_mac_mode = <0xb>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xd>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xd>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ + switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT6)>; /* lan port bitmap */ + switch_wan_bmp = ; /* wan port bitmap */ + malibu_first_phy_addr = <16>; /* PHY addr of the first malibu PHY */ + switch_mac_mode = ; /* mac mode for uniphy instance0*/ + switch_mac_mode1 = ; /* mac mode for uniphy instance1*/ + switch_mac_mode2 = ; /* mac mode for uniphy instance2*/ qcom,port_phyinfo { port@0 { diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax880.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax880.dts index 4551e7b6b3c..73bc13cf320 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax880.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax880.dts @@ -325,21 +325,18 @@ &switch { status = "okay"; - switch_lan_bmp = ; /* lan port bitmap */ - switch_wan_bmp = ; /* wan port bitmap */ - switch_mac_mode = <0xff>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xf>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ + switch_lan_bmp = ; /* lan port bitmap */ + switch_wan_bmp = ; /* wan port bitmap */ + switch_mac_mode1 = ; /* mac mode for uniphy instance1*/ + switch_mac_mode2 = ; /* mac mode for uniphy instance2*/ qcom,port_phyinfo { - port@4 { + port@5 { port_id = <5>; phy_address = <24>; port_mac_sel = "QGMAC_PORT"; }; - port@5 { + port@6 { port_id = <6>; phy_address = <28>; port_mac_sel = "QGMAC_PORT"; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts index 338051ef48a..fbf5b41d85f 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts @@ -384,30 +384,27 @@ switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */ switch_wan_bmp = ; /* wan port bitmap */ - switch_mac_mode = <0xb>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xc>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ + switch_mac_mode = ; /* mac mode for uniphy instance0*/ + switch_mac_mode1 = ; /* mac mode for uniphy instance1*/ qcom,port_phyinfo { - port@0 { + port@1 { port_id = <1>; phy_address = <0>; }; - port@1 { + port@2 { port_id = <2>; phy_address = <1>; }; - port@2 { + port@3 { port_id = <3>; phy_address = <2>; }; - port@3 { + port@4 { port_id = <4>; phy_address = <3>; }; - port@4 { + port@5 { port_id = <5>; phy_address = <24>; port_mac_sel = "QGMAC_PORT"; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-dl-wrx36.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-dl-wrx36.dts index 165d788a4f6..a4548a77831 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-dl-wrx36.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-dl-wrx36.dts @@ -171,30 +171,27 @@ switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */ switch_wan_bmp = ; /* wan port bitmap */ - switch_mac_mode = <0xb>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xc>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ + switch_mac_mode = ; /* mac mode for uniphy instance0*/ + switch_mac_mode2 = ; /* mac mode for uniphy instance2*/ qcom,port_phyinfo { - port@0 { + port@1 { port_id = <1>; phy_address = <0>; }; - port@1 { + port@2 { port_id = <2>; phy_address = <1>; }; - port@2 { + port@3 { port_id = <3>; phy_address = <2>; }; - port@3 { + port@4 { port_id = <4>; phy_address = <3>; }; - port@5 { + port@6 { port_id = <6>; phy_address = <28>; port_mac_sel = "QGMAC_PORT"; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-haze.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-haze.dts index 81e647582ac..34499641596 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-haze.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-haze.dts @@ -188,30 +188,28 @@ switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */ switch_wan_bmp = ; /* wan port bitmap */ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xe>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xd>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ + switch_mac_mode = ; /* mac mode for uniphy instance0*/ + switch_mac_mode1 = ; /* mac mode for uniphy instance1*/ + switch_mac_mode2 = ; /* mac mode for uniphy instance2*/ qcom,port_phyinfo { - port@0 { + port@1 { port_id = <1>; phy_address = <0>; }; - port@1 { + port@2 { port_id = <2>; phy_address = <1>; }; - port@2 { + port@3 { port_id = <3>; phy_address = <2>; }; - port@3 { + port@4 { port_id = <4>; phy_address = <3>; }; - port@4 { + port@6 { port_id = <6>; phy_address = <8>; compatible = "ethernet-phy-ieee802.3-c45"; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax218.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax218.dts index 68be7b27783..33a618851c7 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax218.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax218.dts @@ -89,15 +89,12 @@ &switch { status = "okay"; - switch_wan_bmp = ; - switch_mac_mode = <0x00>; - switch_mac_mode1 = <0xff>; - switch_mac_mode2 = <0x0f>; - bm_tick_mode = <0>; - tm_tick_mode = <0>; + switch_lan_bmp = ; + switch_mac_mode = ; + switch_mac_mode2 = ; qcom,port_phyinfo { - port@5 { + port@6 { port_id = <6>; phy_address = <28>; port_mac_sel = "QGMAC_PORT"; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax620.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax620.dts index 6adf3933883..74dae6cbf3d 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax620.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax620.dts @@ -117,15 +117,12 @@ &switch { status = "okay"; - switch_wan_bmp = ; - switch_mac_mode = <0x00>; - switch_mac_mode1 = <0xff>; - switch_mac_mode2 = <0x0f>; - bm_tick_mode = <0x00>; - tm_tick_mode = <0x00>; + switch_lan_bmp = ; + switch_mac_mode = ; + switch_mac_mode2 = ; qcom,port_phyinfo { - port@5 { + port@6 { port_id = <6>; phy_address = <28>; port_mac_sel = "QGMAC_PORT"; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wpq873.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wpq873.dts index 8d1c3725a18..a450fbca25c 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wpq873.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wpq873.dts @@ -390,11 +390,9 @@ switch_lan_bmp = <(ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */ switch_wan_bmp = ; /* wan port bitmap */ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0x0f>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0x0f>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ + switch_mac_mode = ; /* mac mode for uniphy instance0*/ + switch_mac_mode1 = ; /* mac mode for uniphy instance1*/ + switch_mac_mode2 = ; /* mac mode for uniphy instance2*/ qcom,port_phyinfo { port@2 { @@ -409,7 +407,7 @@ port_id = <4>; phy_address = <3>; }; - port@5 { + port@6 { port_id = <6>; phy_address = <28>; port_mac_sel = "QGMAC_PORT"; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-ess.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-ess.dtsi index 597f7f1ff98..d3f4211ecf9 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-ess.dtsi +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-ess.dtsi @@ -23,6 +23,24 @@ switch_access_mode = "local bus"; switch_cpu_bmp = ; /* cpu port bitmap */ switch_inner_bmp = ; /*inner port bitmap*/ + /* This is a special binding that controls how the malibu PHY are + * init. This value reflect the PHY addr of the first malibu PHY. + * Malibu PHY are in a bundle of 5 PHY. + * Some device might have some port not connected. + * SSDK still needs the addrs of the first PHY (even if not connected) + * to correctly setup the malibu PHY. + * + * This is needed as previously SSDK based this on the port bmp, but + * this can be problematic now that we specify correct bmp. + * + * Most common configuration have the malibu PHY placed at 0. + * But some device might have it placed at address 16. + * To drive the correct value, check the port id of the malibu PHY + * and try to understand what is the first one in devices where some + * port are missing. port_phyinfo is normally the way to go to derive + * this value in the few special cases. + */ + malibu_first_phy_addr = <0>; clocks = <&gcc GCC_CMN_12GPLL_AHB_CLK>, <&gcc GCC_CMN_12GPLL_SYS_CLK>, <&gcc GCC_UNIPHY0_AHB_CLK>, @@ -140,6 +158,14 @@ "nss_port4_rst", "nss_port5_rst", "nss_port6_rst"; mdio-bus = <&mdio>; + + switch_mac_mode = ; /* MAC mode for UNIPHY instance 0 */ + switch_mac_mode1 = ; /* MAC mode for UNIPHY instance 1 */ + switch_mac_mode2 = ; /* MAC mode for UNIPHY instance 2 */ + + bm_tick_mode = <0>; /* bm tick mode */ + tm_tick_mode = <0>; /* tm tick mode */ + status = "disabled"; port_scheduler_resource { @@ -443,7 +469,7 @@ status = "disabled"; }; - dp1: dp1 { + dp1: dp1@3a001000 { device_type = "network"; compatible = "qcom,nss-dp"; qcom,id = <1>; @@ -454,7 +480,7 @@ status = "disabled"; }; - dp2: dp2 { + dp2: dp2@3a001200 { device_type = "network"; compatible = "qcom,nss-dp"; qcom,id = <2>; @@ -465,7 +491,7 @@ status = "disabled"; }; - dp3: dp3 { + dp3: dp3@3a001400 { device_type = "network"; compatible = "qcom,nss-dp"; qcom,id = <3>; @@ -476,7 +502,7 @@ status = "disabled"; }; - dp4: dp4 { + dp4: dp4@3a001600 { device_type = "network"; compatible = "qcom,nss-dp"; qcom,id = <4>; @@ -487,7 +513,7 @@ status = "disabled"; }; - dp5: dp5 { + dp5: dp5@3a001800 { device_type = "network"; compatible = "qcom,nss-dp"; qcom,id = <5>; @@ -498,7 +524,7 @@ status = "disabled"; }; - dp6: dp6 { + dp6: dp6@3a001a00 { device_type = "network"; compatible = "qcom,nss-dp"; qcom,id = <6>; @@ -509,7 +535,7 @@ status = "disabled"; }; - dp5_syn: dp5-syn { + dp5_syn: dp5-syn@3a003000 { device_type = "network"; compatible = "qcom,nss-dp"; qcom,id = <5>; @@ -520,7 +546,7 @@ status = "disabled"; }; - dp6_syn: dp6-syn { + dp6_syn: dp6-syn@3a007000 { device_type = "network"; compatible = "qcom,nss-dp"; qcom,id = <6>; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts index 62e256b4252..5fb8f3b4de4 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts @@ -298,42 +298,40 @@ &switch { status = "okay"; - switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT5)>; - switch_wan_bmp = ; - switch_mac_mode = <0x0>; - switch_mac_mode1 = <0xf>; - switch_mac_mode2 = <0xd>; - bm_tick_mode = <0>; - tm_tick_mode = <0>; + switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT6)>; + switch_wan_bmp = ; + switch_mac_mode = ; + switch_mac_mode1 = ; + switch_mac_mode2 = ; qcom,port_phyinfo { - port@0 { + port@1 { port_id = <1>; phy_address = <0>; }; - port@1 { + port@2 { port_id = <2>; phy_address = <1>; }; - port@2 { + port@3 { port_id = <3>; phy_address = <2>; }; - port@3 { + port@4 { port_id = <4>; phy_address = <3>; }; - port@4 { + port@5 { port_id = <5>; phy_address = <28>; port_mac_sel = "QGMAC_PORT"; }; - port@5 { + port@6 { port_id = <6>; ethernet-phy-ieee802.3-c45; phy_address = <8>; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rax120v2.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rax120v2.dts index 4e756867f29..0a5bbb4c35d 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rax120v2.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rax120v2.dts @@ -195,13 +195,10 @@ &switch { status = "okay"; - switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT5)>; /* lan port bitmap */ - switch_wan_bmp = ; /* wan port bitmap */ - switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/ - switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/ - switch_mac_mode2 = <0xd>; /* mac mode for uniphy instance2*/ - bm_tick_mode = <0>; /* bm tick mode */ - tm_tick_mode = <0>; /* tm tick mode */ + switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT6)>; /* lan port bitmap */ + switch_wan_bmp = ; /* wan port bitmap */ + switch_mac_mode = ; /* mac mode for uniphy instance0*/ + switch_mac_mode2 = ; /* mac mode for uniphy instance2*/ qcom,port_phyinfo { port@1 { diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wax630.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wax630.dts index 99cb8df116a..685e4243ddb 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wax630.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wax630.dts @@ -151,21 +151,17 @@ &switch { status = "okay"; - switch_lan_bmp = ; - switch_wan_bmp = ; - switch_mac_mode = <0x00>; - switch_mac_mode1 = <0xff>; - switch_mac_mode2 = <0x0d>; - bm_tick_mode = <0x00>; - tm_tick_mode = <0x00>; + switch_lan_bmp = <(ESS_PORT4 | ESS_PORT6)>; + switch_mac_mode = ; + switch_mac_mode2 = ; qcom,port_phyinfo { - port@3 { + port@4 { port_id = <4>; phy_address = <3>; }; - port@5 { + port@6 { port_id = <6>; phy_address = <28>; port_mac_sel = "QGMAC_PORT"; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts index 51af034c344..18386c766c3 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts @@ -267,42 +267,40 @@ &switch { status = "okay"; - switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT5)>; - switch_wan_bmp = ; - switch_mac_mode = <0xb>; - switch_mac_mode1 = <0xd>; - switch_mac_mode2 = <0xd>; - bm_tick_mode = <0>; - tm_tick_mode = <0>; + switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT6)>; + switch_wan_bmp = ; + switch_mac_mode = ; + switch_mac_mode1 = ; + switch_mac_mode2 = ; qcom,port_phyinfo { - port@0 { + port@1 { port_id = <1>; phy_address = <0x18>; }; - port@1 { + port@2 { port_id = <2>; phy_address = <0x19>; }; - port@2 { + port@3 { port_id = <3>; phy_address = <0x1a>; }; - port@3 { + port@4 { port_id = <4>; phy_address = <0x1b>; }; - port@4 { + port@5 { port_id = <5>; ethernet-phy-ieee802.3-c45; phy_address = <0x0>; }; - port@5 { + port@6 { port_id = <6>; ethernet-phy-ieee802.3-c45; phy_address = <0x8>; diff --git a/target/linux/qualcommax/files/include/dt-bindings/net/qcom-ipq-ess.h b/target/linux/qualcommax/files/include/dt-bindings/net/qcom-ipq-ess.h index 3a1bcd252ef..baa7c895648 100644 --- a/target/linux/qualcommax/files/include/dt-bindings/net/qcom-ipq-ess.h +++ b/target/linux/qualcommax/files/include/dt-bindings/net/qcom-ipq-ess.h @@ -12,4 +12,31 @@ #define ESS_PORT6 0x40 #define ESS_PORT7 0x80 +/* SSDK MAC/UNIPHY modes */ +#define MAC_MODE_PSGMII 0x0 +#define MAC_MODE_PSGMII_RGMII5 0x1 +#define MAC_MODE_SGMII0_RGMII5 0x2 +#define MAC_MODE_SGMII1_RGMII5 0x3 +#define MAC_MODE_PSGMII_RMII0 0x4 +#define MAC_MODE_PSGMII_RMII1 0x5 +#define MAC_MODE_PSGMII_RMII0_RMII1 0x6 +#define MAC_MODE_PSGMII_RGMII4 0x7 +#define MAC_MODE_SGMII0_RGMII4 0x8 +#define MAC_MODE_SGMII1_RGMII4 0x9 +#define MAC_MODE_SGMII4_RGMII4 0xa +#define MAC_MODE_QSGMII 0xb +#define MAC_MODE_SGMII_PLUS 0xc +#define MAC_MODE_USXGMII 0xd +#define MAC_MODE_10GBASE_R 0xe +#define MAC_MODE_SGMII_CHANNEL0 0xf +#define MAC_MODE_SGMII_CHANNEL1 0x10 +#define MAC_MODE_SGMII_CHANNEL4 0x11 +#define MAC_MODE_RGMII 0x12 +#define MAC_MODE_PSGMII_FIBER 0x13 +#define MAC_MODE_SGMII_FIBER 0x14 +#define MAC_MODE_UQXGMII 0x15 +#define MAC_MODE_UDXGMII 0x16 +#define MAC_MODE_UQXGMII_3CHANNELS 0x17 +#define MAC_MODE_DISABLED 0xff + #endif /* _DT_BINDINGS_NET_QCOM_IPQ_ESS_H */ diff --git a/target/linux/ramips/dts/mt7621_dlink_covr-x1860-a1.dts b/target/linux/ramips/dts/mt7621_dlink_covr-x1860-a1.dts new file mode 100644 index 00000000000..c06c5e36baa --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dlink_covr-x1860-a1.dts @@ -0,0 +1,186 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "dlink,covr-x1860-a1", "mediatek,mt7621-soc"; + model = "D-Link COVR-X1860 A1"; + + aliases { + led-boot = &status_orange; + led-failsafe = &status_red; + led-running = &status_white; + led-upgrade = &status_red; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + status_white: power { + label = "white:status"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + status_orange: status_orange { + label = "orange:status"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + status_red: status_red { + label = "red:status"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + }; + + virtual_flash { + compatible = "mtd-concat"; + + devices = <&fwconcat0 &fwconcat1>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "ubi"; + reg = <0x0 0x0>; + }; + }; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "config"; + reg = <0x80000 0x80000>; + read-only; + }; + + factory: partition@100000 { + label = "factory"; + reg = <0x100000 0x80000>; + read-only; + }; + + partition@180000 { + label = "config2"; + reg = <0x180000 0x40000>; + read-only; + }; + + partition@1c0000 { + label = "kernel"; + reg = <0x1c0000 0x800000>; + }; + + fwconcat0: partition@9c0000 { + label = "fwconcat0"; + reg = <0x9c0000 0x2000000>; + }; + + partition@29c0000 { + label = "kernel2"; + reg = <0x29c0000 0x800000>; + read-only; + }; + + fwconcat1: partition@31c0000 { + label = "fwconcat1"; + reg = <0x31c0000 0x2a00000>; + }; + + partition@5bc0000 { + label = "private"; + reg = <0x5bc0000 0x1400000>; + read-only; + }; + + partition@6fc0000 { + label = "mydlink"; + reg = <0x6fc0000 0x600000>; + read-only; + }; + + partition@75c0000 { + label = "myconfig"; + reg = <0x75c0000 0xa00000>; + read-only; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + mediatek,disable-radar-background; + }; +}; + +&gmac1 { + status = "okay"; + phy-handle = <ðphy4>; +}; + +&mdio { + ethphy4: ethernet-phy@4 { + reg = <4>; + }; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "internet"; + }; + + port@2 { + status = "okay"; + label = "ethernet"; + }; + }; +}; diff --git a/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v6.dts b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v6.dts new file mode 100644 index 00000000000..86cefbc2309 --- /dev/null +++ b/target/linux/ramips/dts/mt7628an_tplink_archer-c50-v6.dts @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7628an_tplink_8m-split-uboot.dtsi" + +/ { + compatible = "tplink,archer-c50-v6", "mediatek,mt7628an-soc"; + model = "TP-Link Archer C50 v6 (CA/EU/RU)"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 38 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + rfkill { + label = "rfkill"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + wlan2 { + label = "green:wlan2g"; + gpios = <&gpio 44 GPIO_ACTIVE_LOW>; + }; + + wlan5 { + label = "green:wlan5g"; + gpios = <&gpio 42 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "green:lan"; + gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "green:wan"; + gpios = <&gpio 39 GPIO_ACTIVE_LOW>; + }; + + wan_orange { + label = "orange:wan"; + gpios = <&gpio 40 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + +&state_default { + gpio { + groups = "i2c", "p0led_an", "p1led_an", "p2led_an", + "p3led_an", "p4led_an", "wdt", "wled_an"; + function = "gpio"; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <5000000 6000000>; + nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100>; + nvmem-cell-names = "eeprom", "mac-address"; + mac-address-increment = <(-1)>; + }; +}; + +&eeprom_radio_8000 { + /* V2 has different eeprom size '0x4da8' for MT7613 */ + reg = <0x8000 0x4da8>; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index e1d7e881c27..89a80228d8e 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -9,6 +9,14 @@ DEFAULT_SOC := mt7621 DEVICE_VARS += ELECOM_HWNAME LINKSYS_HWNAME DLINK_HWID +define Build/append-dlink-covr-metadata + echo -ne '{"supported_devices": "$(1)", "firmware": "' > $@metadata.tmp + $(MKHASH) md5 "$@" | head -c32 >> $@metadata.tmp + echo '"}' >> $@metadata.tmp + fwtool -I $@metadata.tmp $@ + rm $@metadata.tmp +endef + define Build/arcadyan-trx echo -ne "hsqs" > $@.hsqs $(eval trx_magic=$(word 1,$(1))) @@ -642,16 +650,39 @@ define Device/cudy_x6-v2 endef TARGET_DEVICES += cudy_x6-v2 +define Device/dlink_covr-x1860-a1 + $(Device/dsa-migration) + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 8192k + IMAGE_SIZE := 40960k + DEVICE_VENDOR := D-Link + DEVICE_MODEL := COVR-X1860 + DEVICE_VARIANT := A1 + DEVICE_PACKAGES := kmod-mt7915-firmware + UBINIZE_OPTS := -E 5 + KERNEL_LOADADDR := 0x82000000 + KERNEL := kernel-bin | relocate-kernel 0x80001000 | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | \ + append-squashfs4-fakeroot + IMAGES += factory.bin recovery.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGE/recovery.bin := append-kernel | pad-to $$(KERNEL_SIZE) | \ + append-ubi | check-size + IMAGE/factory.bin := $$(IMAGE/recovery.bin) | \ + append-dlink-covr-metadata $$(DEVICE_MODEL) | \ + dlink-sge-image $$(DEVICE_MODEL) +endef +TARGET_DEVICES += dlink_covr-x1860-a1 + define Device/dlink_dxx-1xx0-x1 DEVICE_VENDOR := D-Link - DEVICE_PACKAGES := kmod-mt7615-firmware rssileds + DEVICE_PACKAGES := kmod-mt7615-firmware rssileds -uboot-envtools IMAGE_SIZE := 16064k IMAGES += factory.bin - IMAGE/factory.bin := $$(sysupgrade_bin) | \ - check-size 11009992 | pad-to 11009992 | \ - append-md5sum-ascii-salted ffff | \ - append-string $$(DLINK_HWID) | \ - check-size + IMAGE/factory.bin := append-kernel | append-rootfs | \ + pad-rootfs -x 60 | append-md5sum-ascii-salted ffff | \ + append-string $$$$(DLINK_HWID) | check-size endef define Device/dlink_dap-1620-b1 diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index cf9743ffeec..b325829cf08 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -596,6 +596,20 @@ define Device/tplink_archer-c50-v4 endef TARGET_DEVICES += tplink_archer-c50-v4 +define Device/tplink_archer-c50-v6 + $(Device/tplink-v2) + IMAGE_SIZE := 7616k + DEVICE_MODEL := Archer C50 + DEVICE_VARIANT := v6 (CA/EU/RU) + TPLINK_FLASHLAYOUT := 8MSUmtk + TPLINK_HWID := 0x0C500006 + TPLINK_HWREVADD := 0x6 + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7663-firmware-ap + IMAGES := sysupgrade.bin + DEFAULT := n +endef +TARGET_DEVICES += tplink_archer-c50-v6 + define Device/tplink_re200-v2 $(Device/tplink-safeloader) IMAGE_SIZE := 7808k diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index c0086bb6d24..d53a6f3dbe5 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -100,6 +100,9 @@ ramips_setup_interfaces() zyxel,nr7101) ucidef_set_interfaces_lan_wan "lan" "wan" ;; + dlink,covr-x1860-a1) + ucidef_set_interfaces_lan_wan "ethernet" "internet" + ;; gnubee,gb-pc1) ucidef_set_interface_lan "ethblack ethblue" ;; @@ -221,6 +224,11 @@ ramips_setup_macs() label_mac=$lan_mac wan_mac=$(macaddr_add "$lan_mac" 1) ;; + dlink,covr-x1860-a1) + label_mac=$(mtd_get_mac_ascii config2 factory_mac) + wan_mac=$(macaddr_add "$label_mac" 3) + lan_mac=$label_mac + ;; dlink,dir-860l-b1) lan_mac=$(mtd_get_mac_ascii factory lanmac) wan_mac=$(mtd_get_mac_ascii factory wanmac) diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 96b49ff00ae..b6cf9052df1 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -46,6 +46,13 @@ case "$board" in [ "$PHYNBR" = "1" ] && \ macaddr_add $lan_mac_addr 2 > /sys${DEVPATH}/macaddress ;; + dlink,covr-x1860-a1) + label_mac=$(mtd_get_mac_ascii config2 factory_mac) + [ "$PHYNBR" = "0" ] && \ + macaddr_add $label_mac 1 > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && \ + macaddr_add $label_mac 2 > /sys${DEVPATH}/macaddress + ;; dlink,dap-x1860-a1) hw_mac_addr="$(mtd_get_mac_binary factory 0x4)" [ "$PHYNBR" = "0" ] && \ diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index bd178bdc03b..f61961fee75 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -63,6 +63,7 @@ platform_do_upgrade() { beeline,smartbox-turbo|\ beeline,smartbox-turbo-plus|\ belkin,rt1800|\ + dlink,covr-x1860-a1|\ dlink,dap-x1860-a1|\ dlink,dir-1960-a1|\ dlink,dir-2640-a1|\ diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds index 792bd13ebc1..0b109feb6c5 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/01_leds @@ -76,7 +76,8 @@ tplink,tl-wr850n-v2) ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01" ;; tplink,archer-c50-v3|\ -tplink,archer-c50-v4) +tplink,archer-c50-v4|\ +tplink,archer-c50-v6) ucidef_set_led_switch "lan" "lan" "green:lan" "switch0" "0x1e" ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x01" ucidef_set_led_wlan "wlan2g" "wlan2g" "green:wlan2g" "phy0tpt" diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network index 6bcdea971b2..2ec41fe2549 100644 --- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network @@ -46,6 +46,7 @@ ramips_setup_interfaces() tplink,archer-c20-v5|\ tplink,archer-c50-v3|\ tplink,archer-c50-v4|\ + tplink,archer-c50-v6|\ tplink,tl-mr3420-v5|\ tplink,tl-wr840n-v4|\ tplink,tl-wr840n-v5|\ @@ -294,7 +295,8 @@ ramips_setup_macs() wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0xf100)" 1) ;; tplink,archer-c20-v5|\ - tplink,archer-c50-v4) + tplink,archer-c50-v4|\ + tplink,archer-c50-v6) wan_mac=$(macaddr_add "$(mtd_get_mac_binary rom 0xf100)" 1) ;; wavlink,wl-wn570ha1|\ diff --git a/target/linux/ramips/mt76x8/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt76x8/base-files/lib/upgrade/platform.sh index 20adfafc3dd..427de8406ff 100755 --- a/target/linux/ramips/mt76x8/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt76x8/base-files/lib/upgrade/platform.sh @@ -29,7 +29,8 @@ platform_do_upgrade() { default_do_upgrade "$1" ;; tplink,archer-c20-v5|\ - tplink,archer-c50-v4) + tplink,archer-c50-v4|\ + tplink,archer-c50-v6) MTD_ARGS="-t romfile" default_do_upgrade "$1" ;; diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network index d23cca63e1f..1f3d8ef8336 100644 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network @@ -52,6 +52,7 @@ rockchip_setup_macs() case "$board" in ezpro,mrkaio-m68s|\ + friendlyarm,nanopc-t6|\ friendlyarm,nanopi-r2c|\ friendlyarm,nanopi-r2s|\ lunzn,fastrhino-r66s|\ @@ -64,7 +65,6 @@ rockchip_setup_macs() wan_mac=$(macaddr_generate_from_mmc_cid mmcblk*) lan_mac=$(macaddr_add "$wan_mac" 1) ;; - friendlyarm,nanopc-t6|\ friendlyarm,nanopi-r2c-plus|\ friendlyarm,nanopi-r4s|\ friendlyarm,nanopi-r5s|\ diff --git a/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts b/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts deleted file mode 100644 index 7f01611b45e..00000000000 --- a/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts +++ /dev/null @@ -1,1105 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT -/* - * Copyright (c) 2022 FriendlyElec Computer Tech. Co., Ltd. - * (http://www.friendlyelec.com) - * - * Copyright (c) 2023 Thomas McKahan - * Copyright (c) 2023 Tianling Shen - */ - -/dts-v1/; - -#include -#include -#include -#include -#include -#include "rk3588.dtsi" - -/ { - model = "FriendlyElec NanoPC T6"; - compatible = "friendlyarm,nanopc-t6", "rockchip,rk3588"; - - aliases { - mmc0 = &sdmmc; - mmc1 = &sdhci; - serial2 = &uart2; - - led-boot = &power_led; - led-failsafe = &power_led; - led-running = &power_led; - led-upgrade = &power_led; - }; - - chosen { - stdout-path = "serial2:1500000n8"; - }; - - analog-sound { - compatible = "audio-graph-card"; - label = "realtek,rt5616-codec"; - - - widgets = "Headphone", "Headphones", - "Microphone", "Mic Jack"; - - routing = "Headphones", "HPOL", - "Headphones", "HPOR", - "MIC1", "Mic Jack", - "Mic Jack", "MICBIAS1"; - - dais = <&i2s0_8ch_p0>; - hp-det-gpio = <&gpio1 RK_PC4 GPIO_ACTIVE_LOW>; - pinctrl-names = "default"; - pinctrl-0 = <&hp_detect>; - }; - - gpio-leds { - compatible = "gpio-leds"; - pinctrl-names = "default"; - pinctrl-0 = <&power_led_pin>, <&wan_led_pin>; - - power_led: led-power { - label = "red:power"; - gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>; - }; - - led-wan { - label = "green:wan"; - gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>; - }; - }; - - vcc5v0_sys: vcc5v0-sys-regulator { - compatible = "regulator-fixed"; - regulator-name = "vcc5v0_sys"; - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - }; - - vcc5v0_usb: vcc5v0-usb-regulator { - compatible = "regulator-fixed"; - regulator-name = "vcc5v0_usb"; - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - vin-supply = <&vcc5v0_sys>; - }; - - vcc5v0_host_30: vcc5v0-host-30-regulator { - compatible = "regulator-fixed"; - regulator-name = "vcc5v0_host_30"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - enable-active-high; - gpio = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>; - vin-supply = <&vcc5v0_usb>; - pinctrl-names = "default"; - pinctrl-0 = <&vcc5v0_host30_en>; - }; - - vcc3v3_pcie2x1l0: vcc3v3-pcie2x1l0-regulator { - compatible = "regulator-fixed"; - regulator-name = "vcc3v3_pcie2x1l0"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - enable-active-high; - gpio = <&gpio4 RK_PC2 GPIO_ACTIVE_HIGH>; - vin-supply = <&vcc5v0_sys>; - pinctrl-names = "default"; - pinctrl-0 = <&pcie2_0_vcc3v3_en>; - }; - - vcc3v3_pcie30: vcc3v3-pcie30-regulator { - compatible = "regulator-fixed"; - regulator-name = "vcc3v3_pcie30"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - enable-active-high; - gpios = <&gpio2 RK_PC5 GPIO_ACTIVE_HIGH>; - vin-supply = <&vcc5v0_sys>; - pinctrl-names = "default"; - pinctrl-0 = <&pcie3_vcc3v3_en>; - }; - - vcc_1v1_nldo_s3: vcc-1v1-nldo-s3-regulator { - compatible = "regulator-fixed"; - regulator-name = "vcc_1v1_nldo_s3"; - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <1100000>; - regulator-max-microvolt = <1100000>; - vin-supply = <&vcc5v0_sys>; - }; - - vcc_3v3_pcie20: vcc3v3-pcie20-regulator { - compatible = "regulator-fixed"; - regulator-name = "vcc_3v3_pcie20"; - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - vin-supply = <&vcc_3v3_s3>; - }; - - vcc_3v3_sd_s0: vcc-3v3-sd-s0-regulator { - compatible = "regulator-fixed"; - regulator-always-on; - regulator-boot-on; - regulator-max-microvolt = <3000000>; - regulator-min-microvolt = <3000000>; - regulator-name = "vcc_3v3_sd_s0"; - enable-active-high; - gpio = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>; - vin-supply = <&vcc_3v3_s3>; - pinctrl-names = "default"; - pinctrl-0 = <&vcc3v3_sd_en>; - }; - - vbus5v0_typec: vbus5v0-typec-regulator { - compatible = "regulator-fixed"; - regulator-name = "vbus5v0_typec"; - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5000000>; - enable-active-high; - gpio = <&gpio1 RK_PD2 GPIO_ACTIVE_HIGH>; - vin-supply = <&vcc5v0_usb>; - pinctrl-names = "default"; - pinctrl-0 = <&vbus5v0_typec_en>; - }; - - vdd_4glte_3v3: vdd-4glte-3v3-regulator { - compatible = "regulator-fixed"; - regulator-always-on; - regulator-boot-on; - regulator-name = "vdd_4glte_3v3"; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - enable-active-high; - gpio = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>; - startup-delay-us = <10000>; - vin-supply = <&vcc5v0_sys>; - }; - -}; - -&combphy0_ps { - status = "okay"; -}; - -&combphy1_ps { - status = "okay"; -}; - -&combphy2_psu { - status = "okay"; -}; - -&cpu_l0 { - cpu-supply = <&vdd_cpu_lit_s0>; - mem-supply = <&vdd_cpu_lit_mem_s0>; -}; - -&cpu_b0 { - cpu-supply = <&vdd_cpu_big0_s0>; - mem-supply = <&vdd_cpu_big0_mem_s0>; -}; - -&cpu_b2 { - cpu-supply = <&vdd_cpu_big1_s0>; - mem-supply = <&vdd_cpu_big1_mem_s0>; -}; - -&gpio0 { - gpio-line-names = /* GPIO0 A0-A7 */ - "", "", "", "", - "", "", "", "", - /* GPIO0 B0-B7 */ - "", "", "", "", - "", "", "", "", - /* GPIO0 C0-C7 */ - "", "", "", "", - "HEADER_10", "HEADER_08", "HEADER_32", "", - /* GPIO0 D0-D7 */ - "", "", "", "", - "", "", "", ""; -}; - -&gpio1 { - gpio-line-names = /* GPIO1 A0-A7 */ - "HEADER_27", "HEADER_28", "", "", - "", "", "", "HEADER_15", - /* GPIO1 B0-B7 */ - "HEADER_26", "HEADER_21", "HEADER_19", "HEADER_23", - "HEADER_24", "HEADER_22", "", "", - /* GPIO1 C0-C7 */ - "", "", "", "", - "", "", "", "", - /* GPIO1 D0-D7 */ - "", "", "", "", - "", "", "HEADER_05", "HEADER_03"; -}; - -&gpio2 { - gpio-line-names = /* GPIO2 A0-A7 */ - "", "", "", "", - "", "", "", "", - /* GPIO2 B0-B7 */ - "", "", "", "", - "", "", "", "", - /* GPIO2 C0-C7 */ - "", "CSI1_11", "CSI1_12", "", - "", "", "", "", - /* GPIO2 D0-D7 */ - "", "", "", "", - "", "", "", ""; -}; - -&gpio3 { - gpio-line-names = /* GPIO3 A0-A7 */ - "HEADER_35", "HEADER_38", "HEADER_40", "HEADER_36", - "HEADER_37", "", "DSI0_12", "", - /* GPIO3 B0-B7 */ - "HEADER_33", "DSI0_10", "HEADER_07", "HEADER_16", - "HEADER_18", "HEADER_29", "HEADER_31", "HEADER_12", - /* GPIO3 C0-C7 */ - "DSI0_08", "DSI0_14", "HEADER_11", "HEADER_13", - "", "", "", "", - /* GPIO3 D0-D7 */ - "", "", "", "", - "", "DSI1_10", "", ""; -}; - -&gpio4 { - gpio-line-names = /* GPIO4 A0-A7 */ - "DSI1_08", "DSI1_14", "", "DSI1_12", - "", "", "", "", - /* GPIO4 B0-B7 */ - "", "", "", "", - "", "", "", "", - /* GPIO4 C0-C7 */ - "", "", "", "", - "CSI0_11", "CSI0_12", "", "", - /* GPIO4 D0-D7 */ - "", "", "", "", - "", "", "", ""; -}; - -&i2c0 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c0m2_xfer>; - status = "okay"; - - vdd_cpu_big0_s0: vdd_cpu_big0_mem_s0: regulator@42 { - compatible = "rockchip,rk8602"; - reg = <0x42>; - fcs,suspend-voltage-selector = <1>; - regulator-name = "vdd_cpu_big0_s0"; - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <550000>; - regulator-max-microvolt = <1050000>; - regulator-ramp-delay = <2300>; - vin-supply = <&vcc5v0_sys>; - - regulator-state-mem { - regulator-off-in-suspend; - }; - }; - - vdd_cpu_big1_s0: vdd_cpu_big1_mem_s0: regulator@43 { - compatible = "rockchip,rk8603", "rockchip,rk8602"; - reg = <0x43>; - fcs,suspend-voltage-selector = <1>; - regulator-name = "vdd_cpu_big1_s0"; - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <550000>; - regulator-max-microvolt = <1050000>; - regulator-ramp-delay = <2300>; - vin-supply = <&vcc5v0_sys>; - - regulator-state-mem { - regulator-off-in-suspend; - }; - }; -}; - -&i2c6 { - clock-frequency = <200000>; - status = "okay"; - - hym8563: rtc@51 { - compatible = "haoyu,hym8563"; - reg = <0x51>; - #clock-cells = <0>; - clock-frequency = <32768>; - clock-output-names = "hym8563"; - pinctrl-names = "default"; - pinctrl-0 = <&hym8563_int>; - interrupt-parent = <&gpio0>; - interrupts = ; - wakeup-source; - }; - - usbc0: fusb302@22 { - compatible = "fcs,fusb302"; - reg = <0x22>; - interrupt-parent = <&gpio0>; - interrupts = ; - pinctrl-names = "default"; - pinctrl-0 = <&usbc0_int>; - vbus-supply = <&vbus5v0_typec>; - status = "okay"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - usbc0_role_sw: endpoint@0 { - remote-endpoint = <&dwc3_0_role_switch>; - }; - }; - }; - - usb_con: connector { - compatible = "usb-c-connector"; - label = "USB-C"; - data-role = "dual"; - power-role = "dual"; - try-power-role = "sink"; - op-sink-microwatt = <1000000>; - sink-pdos = - ; - source-pdos = - ; - - altmodes { - #address-cells = <1>; - #size-cells = <0>; - - altmode@0 { - reg = <0>; - svid = <0xff01>; - vdo = <0xffffffff>; - }; - }; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - usbc0_orien_sw: endpoint { - remote-endpoint = <&usbdp_phy0_orientation_switch>; - }; - }; - - port@1 { - reg = <1>; - dp_altmode_mux: endpoint { - remote-endpoint = <&usbdp_phy0_dp_altmode_mux>; - }; - }; - }; - }; - }; -}; - -&i2c7 { - clock-frequency = <200000>; - status = "okay"; - - rt5616: audio-codec@1b { - compatible = "realtek,rt5616"; - reg = <0x1b>; - clocks = <&cru I2S0_8CH_MCLKOUT>; - clock-names = "mclk"; - assigned-clocks = <&cru I2S0_8CH_MCLKOUT>; - assigned-clock-rates = <12288000>; - #sound-dai-cells = <0>; - - port { - rt5616_p0_0: endpoint { - remote-endpoint = <&i2s0_8ch_p0_0>; - }; - }; - }; -}; - -&i2s0_8ch { - pinctrl-names = "default"; - pinctrl-0 = <&i2s0_lrck - &i2s0_mclk - &i2s0_sclk - &i2s0_sdi0 - &i2s0_sdo0>; - status = "okay"; - - i2s0_8ch_p0: port { - i2s0_8ch_p0_0: endpoint { - dai-format = "i2s"; - mclk-fs = <256>; - remote-endpoint = <&rt5616_p0_0>; - }; - }; -}; - -&pcie2x1l0 { - reset-gpios = <&gpio4 RK_PB3 GPIO_ACTIVE_HIGH>; - vpcie3v3-supply = <&vcc_3v3_pcie20>; - status = "okay"; - - pcie@0,0 { - reg = <0x00300000 0 0 0 0>; - #address-cells = <3>; - #size-cells = <2>; - - rtl8125_2: pcie@30,0 { - reg = <0x000000 0 0 0 0>; - label = "eth2"; - }; - }; -}; - -&pcie2x1l1 { - reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_HIGH>; - vpcie3v3-supply = <&vcc3v3_pcie2x1l0>; - status = "okay"; -}; - -&pcie2x1l2 { - reset-gpios = <&gpio4 RK_PA4 GPIO_ACTIVE_HIGH>; - vpcie3v3-supply = <&vcc_3v3_pcie20>; - status = "okay"; - - pcie@0,0 { - reg = <0x00400000 0 0 0 0>; - #address-cells = <3>; - #size-cells = <2>; - - rtl8125_1: pcie@40,0 { - reg = <0x000000 0 0 0 0>; - label = "eth1"; - }; - }; -}; - -&pcie30phy { - status = "okay"; -}; - -&pcie3x4 { - reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>; - vpcie3v3-supply = <&vcc3v3_pcie30>; - status = "okay"; -}; - -&pinctrl { - gpio-leds { - power_led_pin: power-led-pin { - rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; - }; - - wan_led_pin: wan-led-pin { - rockchip,pins = <2 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>; - }; - }; - - hym8563 { - hym8563_int: hym8563-int { - rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>; - }; - }; - - pcie2 { - pcie2_0_vcc3v3_en: pcie2-0-vcc-en { - rockchip,pins = <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>; - }; - }; - - pcie3 { - pcie3_vcc3v3_en: pcie3-vcc3v3-en { - rockchip,pins = <2 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>; - }; - }; - - rockchip-key { - reset_button_pin: reset-button-pin { - rockchip,pins = <1 RK_PC0 RK_FUNC_GPIO &pcfg_pull_up>; - }; - }; - - sdmmc { - vcc3v3_sd_en: vcc3v3-sd-en { - rockchip,pins = <4 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>; - }; - }; - - sound { - hp_detect: hp-detect { - rockchip,pins = <1 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>; - }; - }; - - usb { - usbc0_int: usbc0-int { - rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>; - }; - - vbus5v0_typec_en: vbus5v0-typec-en { - rockchip,pins = <1 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; - }; - - vcc5v0_host30_en: vcc5v0-host30-en { - rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; - }; - - }; -}; - -&rng { - status = "okay"; -}; - -&saradc { - vref-supply = <&avcc_1v8_s0>; - status = "okay"; -}; - -&sdhci { - bus-width = <8>; - cap-mmc-highspeed; - max-frequency = <200000000>; - mmc-hs200-1_8v; - no-sdio; - no-sd; - non-removable; - status = "okay"; -}; - -&sdmmc { - bus-width = <4>; - cap-mmc-highspeed; - cap-sd-highspeed; - disable-wp; - max-frequency = <150000000>; - no-sdio; - no-mmc; - pinctrl-names = "default"; - pinctrl-0 = <&sdmmc_bus4 &sdmmc_clk &sdmmc_cmd &sdmmc_det>; - vmmc-supply = <&vcc_3v3_sd_s0>; - vqmmc-supply = <&vccio_sd_s0>; - status = "okay"; -}; - -&spi2 { - status = "okay"; - assigned-clocks = <&cru CLK_SPI2>; - assigned-clock-rates = <200000000>; - pinctrl-names = "default"; - pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>; - num-cs = <1>; - - rk806single: rk806single@0 { - compatible = "rockchip,rk806"; - spi-max-frequency = <1000000>; - reg = <0x0>; - - interrupt-parent = <&gpio0>; - interrupts = <7 IRQ_TYPE_LEVEL_LOW>; - - pinctrl-names = "default"; - pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>, <&rk806_dvs2_null>, <&rk806_dvs3_null>; - - vcc1-supply = <&vcc5v0_sys>; - vcc2-supply = <&vcc5v0_sys>; - vcc3-supply = <&vcc5v0_sys>; - vcc4-supply = <&vcc5v0_sys>; - vcc5-supply = <&vcc5v0_sys>; - vcc6-supply = <&vcc5v0_sys>; - vcc7-supply = <&vcc5v0_sys>; - vcc8-supply = <&vcc5v0_sys>; - vcc9-supply = <&vcc5v0_sys>; - vcc10-supply = <&vcc5v0_sys>; - vcc11-supply = <&vcc_2v0_pldo_s3>; - vcc12-supply = <&vcc5v0_sys>; - vcc13-supply = <&vcc_1v1_nldo_s3>; - vcc14-supply = <&vcc_1v1_nldo_s3>; - vcca-supply = <&vcc5v0_sys>; - - gpio-controller; - #gpio-cells = <2>; - - rk806_dvs1_null: dvs1-null-pins { - pins = "gpio_pwrctrl2"; - function = "pin_fun0"; - }; - - rk806_dvs1_slp: dvs1-slp-pins { - pins = "gpio_pwrctrl1"; - function = "pin_fun1"; - }; - - rk806_dvs1_pwrdn: dvs1-pwrdn-pins { - pins = "gpio_pwrctrl1"; - function = "pin_fun2"; - }; - - rk806_dvs1_rst: dvs1-rst-pins { - pins = "gpio_pwrctrl1"; - function = "pin_fun3"; - }; - - rk806_dvs2_null: dvs2-null-pins { - pins = "gpio_pwrctrl2"; - function = "pin_fun0"; - }; - - rk806_dvs2_slp: dvs2-slp-pins { - pins = "gpio_pwrctrl2"; - function = "pin_fun1"; - }; - - rk806_dvs2_pwrdn: dvs2-pwrdn-pins { - pins = "gpio_pwrctrl2"; - function = "pin_fun2"; - }; - - rk806_dvs2_rst: dvs2-rst-pins { - pins = "gpio_pwrctrl2"; - function = "pin_fun3"; - }; - - rk806_dvs2_dvs: dvs2-dvs-pins { - pins = "gpio_pwrctrl2"; - function = "pin_fun4"; - }; - - rk806_dvs2_gpio: dvs2-gpio-pins { - pins = "gpio_pwrctrl2"; - function = "pin_fun5"; - }; - - rk806_dvs3_null: dvs3-null-pins { - pins = "gpio_pwrctrl3"; - function = "pin_fun0"; - }; - - rk806_dvs3_slp: dvs3-slp-pins { - pins = "gpio_pwrctrl3"; - function = "pin_fun1"; - }; - - rk806_dvs3_pwrdn: dvs3-pwrdn-pins { - pins = "gpio_pwrctrl3"; - function = "pin_fun2"; - }; - - rk806_dvs3_rst: dvs3-rst-pins { - pins = "gpio_pwrctrl3"; - function = "pin_fun3"; - }; - - rk806_dvs3_dvs: dvs3-dvs-pins { - pins = "gpio_pwrctrl3"; - function = "pin_fun4"; - }; - - rk806_dvs3_gpio: dvs3-gpio-pins { - pins = "gpio_pwrctrl3"; - function = "pin_fun5"; - }; - - regulators { - vdd_gpu_s0: vdd_gpu_mem_s0: dcdc-reg1 { - regulator-boot-on; - regulator-min-microvolt = <550000>; - regulator-max-microvolt = <950000>; - regulator-ramp-delay = <12500>; - regulator-name = "vdd_gpu_s0"; - regulator-enable-ramp-delay = <400>; - - regulator-state-mem { - regulator-off-in-suspend; - }; - }; - - vdd_cpu_lit_s0: vdd_cpu_lit_mem_s0: dcdc-reg2 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <550000>; - regulator-max-microvolt = <950000>; - regulator-ramp-delay = <12500>; - regulator-name = "vdd_cpu_lit_s0"; - regulator-state-mem { - regulator-off-in-suspend; - }; - }; - - vdd_log_s0: dcdc-reg3 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <675000>; - regulator-max-microvolt = <750000>; - regulator-ramp-delay = <12500>; - regulator-name = "vdd_log_s0"; - - regulator-state-mem { - regulator-off-in-suspend; - regulator-suspend-microvolt = <750000>; - }; - }; - - vdd_vdenc_s0: vdd_vdenc_mem_s0: dcdc-reg4 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <550000>; - regulator-max-microvolt = <950000>; - regulator-init-microvolt = <750000>; - regulator-ramp-delay = <12500>; - regulator-name = "vdd_vdenc_s0"; - - regulator-state-mem { - regulator-off-in-suspend; - }; - }; - - vdd_ddr_s0: dcdc-reg5 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <675000>; - regulator-max-microvolt = <900000>; - regulator-ramp-delay = <12500>; - regulator-name = "vdd_ddr_s0"; - - regulator-state-mem { - regulator-off-in-suspend; - regulator-suspend-microvolt = <850000>; - }; - }; - - vdd2_ddr_s3: dcdc-reg6 { - regulator-always-on; - regulator-boot-on; - regulator-name = "vdd2_ddr_s3"; - - regulator-state-mem { - regulator-on-in-suspend; - }; - }; - - vcc_2v0_pldo_s3: dcdc-reg7 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <2000000>; - regulator-max-microvolt = <2000000>; - regulator-ramp-delay = <12500>; - regulator-name = "vdd_2v0_pldo_s3"; - - regulator-state-mem { - regulator-on-in-suspend; - regulator-suspend-microvolt = <2000000>; - }; - }; - - vcc_3v3_s3: dcdc-reg8 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-name = "vcc_3v3_s3"; - - regulator-state-mem { - regulator-on-in-suspend; - regulator-suspend-microvolt = <3300000>; - }; - }; - - vddq_ddr_s0: dcdc-reg9 { - regulator-always-on; - regulator-boot-on; - regulator-name = "vddq_ddr_s0"; - - regulator-state-mem { - regulator-off-in-suspend; - }; - }; - - vcc_1v8_s3: dcdc-reg10 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-name = "vcc_1v8_s3"; - - regulator-state-mem { - regulator-on-in-suspend; - regulator-suspend-microvolt = <1800000>; - }; - }; - - avcc_1v8_s0: pldo-reg1 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-name = "avcc_1v8_s0"; - - regulator-state-mem { - regulator-off-in-suspend; - }; - }; - - vcc_1v8_s0: pldo-reg2 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-name = "vcc_1v8_s0"; - - regulator-state-mem { - regulator-off-in-suspend; - regulator-suspend-microvolt = <1800000>; - }; - }; - - avdd_1v2_s0: pldo-reg3 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <1200000>; - regulator-max-microvolt = <1200000>; - regulator-name = "avdd_1v2_s0"; - - regulator-state-mem { - regulator-off-in-suspend; - }; - }; - - vcc_3v3_s0: pldo-reg4 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-ramp-delay = <12500>; - regulator-name = "vcc_3v3_s0"; - - regulator-state-mem { - regulator-off-in-suspend; - }; - }; - - vccio_sd_s0: pldo-reg5 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3300000>; - regulator-ramp-delay = <12500>; - regulator-name = "vccio_sd_s0"; - - regulator-state-mem { - regulator-off-in-suspend; - }; - }; - - pldo6_s3: pldo-reg6 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; - regulator-name = "pldo6_s3"; - - regulator-state-mem { - regulator-on-in-suspend; - regulator-suspend-microvolt = <1800000>; - }; - }; - - vdd_0v75_s3: nldo-reg1 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <750000>; - regulator-max-microvolt = <750000>; - regulator-name = "vdd_0v75_s3"; - - regulator-state-mem { - regulator-on-in-suspend; - regulator-suspend-microvolt = <750000>; - }; - }; - - vdd_ddr_pll_s0: nldo-reg2 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <850000>; - regulator-max-microvolt = <850000>; - regulator-name = "vdd_ddr_pll_s0"; - - regulator-state-mem { - regulator-off-in-suspend; - regulator-suspend-microvolt = <850000>; - }; - }; - - avdd_0v75_s0: nldo-reg3 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <750000>; - regulator-max-microvolt = <750000>; - regulator-name = "avdd_0v75_s0"; - - regulator-state-mem { - regulator-off-in-suspend; - }; - }; - - vdd_0v85_s0: nldo-reg4 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <850000>; - regulator-max-microvolt = <850000>; - regulator-name = "vdd_0v85_s0"; - - regulator-state-mem { - regulator-off-in-suspend; - }; - }; - - vdd_0v75_s0: nldo-reg5 { - regulator-always-on; - regulator-boot-on; - regulator-min-microvolt = <750000>; - regulator-max-microvolt = <750000>; - regulator-name = "vdd_0v75_s0"; - - regulator-state-mem { - regulator-off-in-suspend; - }; - }; - }; - }; -}; - -&tsadc { - status = "okay"; -}; - -&uart2 { - pinctrl-0 = <&uart2m0_xfer>; - status = "okay"; -}; - -&u2phy0 { - status = "okay"; -}; - -&u2phy0_otg { - status = "okay"; -}; - -&u2phy1 { - status = "okay"; -}; - -&u2phy1_otg { - phy-supply = <&vcc5v0_host_30>; - status = "okay"; -}; - -&u2phy2 { - status = "okay"; -}; - -&u2phy2_host { - status = "okay"; -}; - -&u2phy3 { - status = "okay"; -}; - -&u2phy3_host { - status = "okay"; -}; - -&usbdp_phy0 { - orientation-switch; - mode-switch; - rockchip,dp-lane-mux = <0 1 2 3>; - svid = <0xff01>; - sbu1-dc-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>; - sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>; - status = "okay"; - - port { - #address-cells = <1>; - #size-cells = <0>; - - usbdp_phy0_orientation_switch: endpoint@0 { - reg = <0>; - remote-endpoint = <&usbc0_orien_sw>; - }; - - usbdp_phy0_dp_altmode_mux: endpoint@1 { - reg = <1>; - remote-endpoint = <&dp_altmode_mux>; - }; - }; -}; - -&usbdp_phy0_dp { - status = "okay"; -}; - -&usbdp_phy0_u3 { - status = "okay"; -}; - -&usbdp_phy1 { - status = "okay"; -}; - -&usbdp_phy1_u3 { - status = "okay"; -}; - -&usb_host0_ehci { - status = "okay"; -}; - -&usb_host0_ohci { - status = "okay"; -}; - -&usb_host0_xhci { - dr_mode = "host"; - usb-role-switch; - status = "okay"; - - port { - #address-cells = <1>; - #size-cells = <0>; - dwc3_0_role_switch: endpoint@0 { - reg = <0>; - remote-endpoint = <&usbc0_role_sw>; - }; - }; -}; - -&usb_host1_ehci { - status = "okay"; -}; - -&usb_host1_ohci { - status = "okay"; -}; - -&usb_host1_xhci { - status = "okay"; -}; diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk index f7f9a6d136f..ff4f2743173 100644 --- a/target/linux/rockchip/image/armv8.mk +++ b/target/linux/rockchip/image/armv8.mk @@ -122,7 +122,7 @@ define Device/friendlyarm_nanopi-r5c DEVICE_MODEL := NanoPi R5C SOC := rk3568 BOOT_FLOW := pine64-img - DEVICE_PACKAGES := kmod-r8125 kmod-rtw88 rtl8822ce-firmware wpad-basic-openssl + DEVICE_PACKAGES := kmod-r8125 kmod-rtw88-8822ce rtl8822ce-firmware wpad-basic-openssl endef TARGET_DEVICES += friendlyarm_nanopi-r5c @@ -204,7 +204,7 @@ define Device/radxa_rock-5a SOC := rk3588s UBOOT_DEVICE_NAME := rock5a-rk3588s BOOT_FLOW := pine64-img - DEVICE_PACKAGES := kmod-r8125 + DEVICE_PACKAGES := kmod-r8125 kmod-hwmon-pwmfan endef TARGET_DEVICES += radxa_rock-5a @@ -214,7 +214,7 @@ define Device/radxa_rock-5b SOC := rk3588 UBOOT_DEVICE_NAME := rock5b-rk3588 BOOT_FLOW := pine64-img - DEVICE_PACKAGES := kmod-r8125 + DEVICE_PACKAGES := kmod-r8125 kmod-hwmon-pwmfan endef TARGET_DEVICES += radxa_rock-5b diff --git a/target/linux/rockchip/patches-6.1/054-01-v6.6-arm64-dts-rockchip-Add-NanoPC-T6.patch b/target/linux/rockchip/patches-6.1/054-01-v6.6-arm64-dts-rockchip-Add-NanoPC-T6.patch new file mode 100644 index 00000000000..20ed7f95e7c --- /dev/null +++ b/target/linux/rockchip/patches-6.1/054-01-v6.6-arm64-dts-rockchip-Add-NanoPC-T6.patch @@ -0,0 +1,874 @@ +From 893c17716d0cf68f5ff4dc71c90e0c2bd1f7da46 Mon Sep 17 00:00:00 2001 +From: Thomas McKahan +Date: Wed, 9 Aug 2023 07:21:17 -0400 +Subject: [PATCH] arm64: dts: rockchip: Add NanoPC T6 + +Add the NanoPC T6, a single board computer from FriendlyElec based on +the RK3588. + +Initial device tree supports debug UART, SD, eMMC, PCIe 3, PMIC, +and 40 pin GPIO assignments. + +Signed-off-by: Thomas McKahan +Link: https://lore.kernel.org/r/20230809112120.99-3-tmckahan@singleboardsolutions.com +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/Makefile | 1 + + .../boot/dts/rockchip/rk3588-nanopc-t6.dts | 842 ++++++++++++++++++ + 2 files changed, 843 insertions(+) + create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts + +--- a/arch/arm64/boot/dts/rockchip/Makefile ++++ b/arch/arm64/boot/dts/rockchip/Makefile +@@ -82,5 +82,6 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-na + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-roc-pc.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-rock-3a.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-evb1-v10.dtb ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-rock-5b.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-rock-5a.dtb +--- /dev/null ++++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts +@@ -0,0 +1,842 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2021 Rockchip Electronics Co., Ltd. ++ * Copyright (c) 2023 Thomas McKahan ++ * ++ */ ++ ++/dts-v1/; ++ ++#include ++#include ++#include ++#include "rk3588.dtsi" ++ ++/ { ++ model = "FriendlyElec NanoPC-T6"; ++ compatible = "friendlyarm,nanopc-t6", "rockchip,rk3588"; ++ ++ aliases { ++ mmc0 = &sdhci; ++ mmc1 = &sdmmc; ++ serial2 = &uart2; ++ }; ++ ++ chosen { ++ stdout-path = "serial2:1500000n8"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ sys_led: led-0 { ++ gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>; ++ label = "system-led"; ++ linux,default-trigger = "heartbeat"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sys_led_pin>; ++ }; ++ ++ usr_led: led-1 { ++ gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>; ++ label = "user-led"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usr_led_pin>; ++ }; ++ }; ++ ++ sound { ++ compatible = "simple-audio-card"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hp_det>; ++ ++ simple-audio-card,name = "realtek,rt5616-codec"; ++ simple-audio-card,format = "i2s"; ++ simple-audio-card,mclk-fs = <256>; ++ ++ simple-audio-card,hp-det-gpio = <&gpio1 RK_PC4 GPIO_ACTIVE_LOW>; ++ simple-audio-card,hp-pin-name = "Headphones"; ++ ++ simple-audio-card,widgets = ++ "Headphone", "Headphones", ++ "Microphone", "Microphone Jack"; ++ simple-audio-card,routing = ++ "Headphones", "HPOL", ++ "Headphones", "HPOR", ++ "MIC1", "Microphone Jack", ++ "Microphone Jack", "micbias1"; ++ ++ simple-audio-card,cpu { ++ sound-dai = <&i2s0_8ch>; ++ }; ++ simple-audio-card,codec { ++ sound-dai = <&rt5616>; ++ }; ++ }; ++ ++ vcc12v_dcin: vcc12v-dcin-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc12v_dcin"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <12000000>; ++ regulator-max-microvolt = <12000000>; ++ }; ++ ++ /* vcc5v0_sys powers peripherals */ ++ vcc5v0_sys: vcc5v0-sys-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&vcc12v_dcin>; ++ }; ++ ++ /* vcc4v0_sys powers the RK806, RK860's */ ++ vcc4v0_sys: vcc4v0-sys-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc4v0_sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <4000000>; ++ regulator-max-microvolt = <4000000>; ++ vin-supply = <&vcc12v_dcin>; ++ }; ++ ++ vcc_1v1_nldo_s3: vcc-1v1-nldo-s3-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc-1v1-nldo-s3"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1100000>; ++ regulator-max-microvolt = <1100000>; ++ vin-supply = <&vcc4v0_sys>; ++ }; ++ ++ vbus5v0_typec: vbus5v0-typec-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio1 RK_PD2 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&typec5v_pwren>; ++ regulator-name = "vbus5v0_typec"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&vcc5v0_sys>; ++ }; ++ ++ vcc3v3_pcie30: vcc3v3-pcie30-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpios = <&gpio2 RK_PC5 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pcie_m2_0_pwren>; ++ regulator-name = "vcc3v3_pcie30"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&vcc5v0_sys>; ++ }; ++}; ++ ++&cpu_l0 { ++ cpu-supply = <&vdd_cpu_lit_s0>; ++}; ++ ++&cpu_l1 { ++ cpu-supply = <&vdd_cpu_lit_s0>; ++}; ++ ++&cpu_l2 { ++ cpu-supply = <&vdd_cpu_lit_s0>; ++}; ++ ++&cpu_l3 { ++ cpu-supply = <&vdd_cpu_lit_s0>; ++}; ++ ++&cpu_b0{ ++ cpu-supply = <&vdd_cpu_big0_s0>; ++}; ++ ++&cpu_b1{ ++ cpu-supply = <&vdd_cpu_big0_s0>; ++}; ++ ++&cpu_b2{ ++ cpu-supply = <&vdd_cpu_big1_s0>; ++}; ++ ++&cpu_b3{ ++ cpu-supply = <&vdd_cpu_big1_s0>; ++}; ++ ++&gpio0 { ++ gpio-line-names = /* GPIO0 A0-A7 */ ++ "", "", "", "", ++ "", "", "", "", ++ /* GPIO0 B0-B7 */ ++ "", "", "", "", ++ "", "", "", "", ++ /* GPIO0 C0-C7 */ ++ "", "", "", "", ++ "HEADER_10", "HEADER_08", "HEADER_32", "", ++ /* GPIO0 D0-D7 */ ++ "", "", "", "", ++ "", "", "", ""; ++}; ++ ++&gpio1 { ++ gpio-line-names = /* GPIO1 A0-A7 */ ++ "HEADER_27", "HEADER_28", "", "", ++ "", "", "", "HEADER_15", ++ /* GPIO1 B0-B7 */ ++ "HEADER_26", "HEADER_21", "HEADER_19", "HEADER_23", ++ "HEADER_24", "HEADER_22", "", "", ++ /* GPIO1 C0-C7 */ ++ "", "", "", "", ++ "", "", "", "", ++ /* GPIO1 D0-D7 */ ++ "", "", "", "", ++ "", "", "HEADER_05", "HEADER_03"; ++}; ++ ++&gpio2 { ++ gpio-line-names = /* GPIO2 A0-A7 */ ++ "", "", "", "", ++ "", "", "", "", ++ /* GPIO2 B0-B7 */ ++ "", "", "", "", ++ "", "", "", "", ++ /* GPIO2 C0-C7 */ ++ "", "CSI1_11", "CSI1_12", "", ++ "", "", "", "", ++ /* GPIO2 D0-D7 */ ++ "", "", "", "", ++ "", "", "", ""; ++}; ++ ++&gpio3 { ++ gpio-line-names = /* GPIO3 A0-A7 */ ++ "HEADER_35", "HEADER_38", "HEADER_40", "HEADER_36", ++ "HEADER_37", "", "DSI0_12", "", ++ /* GPIO3 B0-B7 */ ++ "HEADER_33", "DSI0_10", "HEADER_07", "HEADER_16", ++ "HEADER_18", "HEADER_29", "HEADER_31", "HEADER_12", ++ /* GPIO3 C0-C7 */ ++ "DSI0_08", "DSI0_14", "HEADER_11", "HEADER_13", ++ "", "", "", "", ++ /* GPIO3 D0-D7 */ ++ "", "", "", "", ++ "", "DSI1_10", "", ""; ++}; ++ ++&gpio4 { ++ gpio-line-names = /* GPIO4 A0-A7 */ ++ "DSI1_08", "DSI1_14", "", "DSI1_12", ++ "", "", "", "", ++ /* GPIO4 B0-B7 */ ++ "", "", "", "", ++ "", "", "", "", ++ /* GPIO4 C0-C7 */ ++ "", "", "", "", ++ "CSI0_11", "CSI0_12", "", "", ++ /* GPIO4 D0-D7 */ ++ "", "", "", "", ++ "", "", "", ""; ++}; ++ ++&i2c0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c0m2_xfer>; ++ status = "okay"; ++ ++ vdd_cpu_big0_s0: regulator@42 { ++ compatible = "rockchip,rk8602"; ++ reg = <0x42>; ++ fcs,suspend-voltage-selector = <1>; ++ regulator-name = "vdd_cpu_big0_s0"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <550000>; ++ regulator-max-microvolt = <1050000>; ++ regulator-ramp-delay = <2300>; ++ vin-supply = <&vcc4v0_sys>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_cpu_big1_s0: regulator@43 { ++ compatible = "rockchip,rk8603", "rockchip,rk8602"; ++ reg = <0x43>; ++ fcs,suspend-voltage-selector = <1>; ++ regulator-name = "vdd_cpu_big1_s0"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <550000>; ++ regulator-max-microvolt = <1050000>; ++ regulator-ramp-delay = <2300>; ++ vin-supply = <&vcc4v0_sys>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++}; ++ ++&i2c2 { ++ status = "okay"; ++ ++ vdd_npu_s0: regulator@42 { ++ compatible = "rockchip,rk8602"; ++ reg = <0x42>; ++ rockchip,suspend-voltage-selector = <1>; ++ regulator-name = "vdd_npu_s0"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <550000>; ++ regulator-max-microvolt = <950000>; ++ regulator-ramp-delay = <2300>; ++ vin-supply = <&vcc4v0_sys>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++}; ++ ++&i2c6 { ++ clock-frequency = <200000>; ++ status = "okay"; ++ ++ fusb302: typec-portc@22 { ++ compatible = "fcs,fusb302"; ++ reg = <0x22>; ++ interrupt-parent = <&gpio0>; ++ interrupts = ; ++ pinctrl-0 = <&usbc0_int>; ++ pinctrl-names = "default"; ++ vbus-supply = <&vbus5v0_typec>; ++ ++ connector { ++ compatible = "usb-c-connector"; ++ data-role = "dual"; ++ label = "USB-C"; ++ power-role = "dual"; ++ try-power-role = "sink"; ++ source-pdos = ; ++ sink-pdos = ; ++ op-sink-microwatt = <1000000>; ++ }; ++ }; ++ ++ hym8563: rtc@51 { ++ compatible = "haoyu,hym8563"; ++ reg = <0x51>; ++ #clock-cells = <0>; ++ clock-output-names = "hym8563"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hym8563_int>; ++ interrupt-parent = <&gpio0>; ++ interrupts = ; ++ wakeup-source; ++ }; ++}; ++ ++&i2c7 { ++ clock-frequency = <200000>; ++ status = "okay"; ++ ++ rt5616: codec@1b { ++ compatible = "realtek,rt5616"; ++ reg = <0x1b>; ++ clocks = <&cru I2S0_8CH_MCLKOUT>; ++ clock-names = "mclk"; ++ #sound-dai-cells = <0>; ++ assigned-clocks = <&cru I2S0_8CH_MCLKOUT>; ++ assigned-clock-rates = <12288000>; ++ ++ port { ++ rt5616_p0_0: endpoint { ++ remote-endpoint = <&i2s0_8ch_p0_0>; ++ }; ++ }; ++ }; ++ ++ /* connected with MIPI-CSI1 */ ++}; ++ ++&i2c8 { ++ pinctrl-0 = <&i2c8m2_xfer>; ++}; ++ ++&i2s0_8ch { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2s0_lrck ++ &i2s0_mclk ++ &i2s0_sclk ++ &i2s0_sdi0 ++ &i2s0_sdo0>; ++ status = "okay"; ++ ++ i2s0_8ch_p0: port { ++ i2s0_8ch_p0_0: endpoint { ++ dai-format = "i2s"; ++ mclk-fs = <256>; ++ remote-endpoint = <&rt5616_p0_0>; ++ }; ++ }; ++}; ++ ++&pcie30phy { ++ status = "okay"; ++}; ++ ++&pcie3x4 { ++ reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>; ++ vpcie3v3-supply = <&vcc3v3_pcie30>; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ gpio-leds { ++ sys_led_pin: sys-led-pin { ++ rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ usr_led_pin: usr-led-pin { ++ rockchip,pins = <2 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ headphone { ++ hp_det: hp-det { ++ rockchip,pins = <1 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ hym8563 { ++ hym8563_int: hym8563-int { ++ rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ pcie { ++ pcie_m2_0_pwren: pcie-m20-pwren { ++ rockchip,pins = <2 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ usb { ++ typec5v_pwren: typec5v-pwren { ++ rockchip,pins = <1 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ usbc0_int: usbc0-int { ++ rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++}; ++ ++&pwm1 { ++ pinctrl-0 = <&pwm1m1_pins>; ++ status = "okay"; ++}; ++ ++&saradc { ++ vref-supply = <&avcc_1v8_s0>; ++ status = "okay"; ++}; ++ ++&sdhci { ++ bus-width = <8>; ++ no-sdio; ++ no-sd; ++ non-removable; ++ max-frequency = <200000000>; ++ mmc-hs400-1_8v; ++ mmc-hs400-enhanced-strobe; ++ status = "okay"; ++}; ++ ++&sdmmc { ++ max-frequency = <200000000>; ++ no-sdio; ++ no-mmc; ++ bus-width = <4>; ++ cap-mmc-highspeed; ++ cap-sd-highspeed; ++ disable-wp; ++ sd-uhs-sdr104; ++ vmmc-supply = <&vcc_3v3_s3>; ++ vqmmc-supply = <&vccio_sd_s0>; ++ status = "okay"; ++}; ++ ++&spi2 { ++ status = "okay"; ++ assigned-clocks = <&cru CLK_SPI2>; ++ assigned-clock-rates = <200000000>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>; ++ num-cs = <1>; ++ ++ pmic@0 { ++ compatible = "rockchip,rk806"; ++ spi-max-frequency = <1000000>; ++ reg = <0x0>; ++ ++ interrupt-parent = <&gpio0>; ++ interrupts = <7 IRQ_TYPE_LEVEL_LOW>; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>, ++ <&rk806_dvs2_null>, <&rk806_dvs3_null>; ++ ++ vcc1-supply = <&vcc4v0_sys>; ++ vcc2-supply = <&vcc4v0_sys>; ++ vcc3-supply = <&vcc4v0_sys>; ++ vcc4-supply = <&vcc4v0_sys>; ++ vcc5-supply = <&vcc4v0_sys>; ++ vcc6-supply = <&vcc4v0_sys>; ++ vcc7-supply = <&vcc4v0_sys>; ++ vcc8-supply = <&vcc4v0_sys>; ++ vcc9-supply = <&vcc4v0_sys>; ++ vcc10-supply = <&vcc4v0_sys>; ++ vcc11-supply = <&vcc_2v0_pldo_s3>; ++ vcc12-supply = <&vcc4v0_sys>; ++ vcc13-supply = <&vcc_1v1_nldo_s3>; ++ vcc14-supply = <&vcc_1v1_nldo_s3>; ++ vcca-supply = <&vcc4v0_sys>; ++ ++ gpio-controller; ++ #gpio-cells = <2>; ++ ++ rk806_dvs1_null: dvs1-null-pins { ++ pins = "gpio_pwrctrl2"; ++ function = "pin_fun0"; ++ }; ++ ++ rk806_dvs2_null: dvs2-null-pins { ++ pins = "gpio_pwrctrl2"; ++ function = "pin_fun0"; ++ }; ++ ++ rk806_dvs3_null: dvs3-null-pins { ++ pins = "gpio_pwrctrl3"; ++ function = "pin_fun0"; ++ }; ++ ++ regulators { ++ vdd_gpu_s0: vdd_gpu_mem_s0: dcdc-reg1 { ++ regulator-boot-on; ++ regulator-min-microvolt = <550000>; ++ regulator-max-microvolt = <950000>; ++ regulator-ramp-delay = <12500>; ++ regulator-name = "vdd_gpu_s0"; ++ regulator-enable-ramp-delay = <400>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_cpu_lit_s0: vdd_cpu_lit_mem_s0: dcdc-reg2 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <550000>; ++ regulator-max-microvolt = <950000>; ++ regulator-ramp-delay = <12500>; ++ regulator-name = "vdd_cpu_lit_s0"; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_log_s0: dcdc-reg3 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <675000>; ++ regulator-max-microvolt = <750000>; ++ regulator-ramp-delay = <12500>; ++ regulator-name = "vdd_log_s0"; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ regulator-suspend-microvolt = <750000>; ++ }; ++ }; ++ ++ vdd_vdenc_s0: vdd_vdenc_mem_s0: dcdc-reg4 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <550000>; ++ regulator-max-microvolt = <950000>; ++ regulator-init-microvolt = <750000>; ++ regulator-ramp-delay = <12500>; ++ regulator-name = "vdd_vdenc_s0"; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_ddr_s0: dcdc-reg5 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <675000>; ++ regulator-max-microvolt = <900000>; ++ regulator-ramp-delay = <12500>; ++ regulator-name = "vdd_ddr_s0"; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ regulator-suspend-microvolt = <850000>; ++ }; ++ }; ++ ++ vdd2_ddr_s3: dcdc-reg6 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-name = "vdd2_ddr_s3"; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vcc_2v0_pldo_s3: dcdc-reg7 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <2000000>; ++ regulator-max-microvolt = <2000000>; ++ regulator-ramp-delay = <12500>; ++ regulator-name = "vdd_2v0_pldo_s3"; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <2000000>; ++ }; ++ }; ++ ++ vcc_3v3_s3: dcdc-reg8 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc_3v3_s3"; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3300000>; ++ }; ++ }; ++ ++ vddq_ddr_s0: dcdc-reg9 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-name = "vddq_ddr_s0"; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_1v8_s3: dcdc-reg10 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "vcc_1v8_s3"; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ avcc_1v8_s0: pldo-reg1 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "avcc_1v8_s0"; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_1v8_s0: pldo-reg2 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "vcc_1v8_s0"; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ avdd_1v2_s0: pldo-reg3 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1200000>; ++ regulator-max-microvolt = <1200000>; ++ regulator-name = "avdd_1v2_s0"; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_3v3_s0: pldo-reg4 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-ramp-delay = <12500>; ++ regulator-name = "vcc_3v3_s0"; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vccio_sd_s0: pldo-reg5 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-ramp-delay = <12500>; ++ regulator-name = "vccio_sd_s0"; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ pldo6_s3: pldo-reg6 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "pldo6_s3"; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vdd_0v75_s3: nldo-reg1 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <750000>; ++ regulator-max-microvolt = <750000>; ++ regulator-name = "vdd_0v75_s3"; ++ ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <750000>; ++ }; ++ }; ++ ++ vdd_ddr_pll_s0: nldo-reg2 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <850000>; ++ regulator-max-microvolt = <850000>; ++ regulator-name = "vdd_ddr_pll_s0"; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ regulator-suspend-microvolt = <850000>; ++ }; ++ }; ++ ++ avdd_0v75_s0: nldo-reg3 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <750000>; ++ regulator-max-microvolt = <750000>; ++ regulator-name = "avdd_0v75_s0"; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_0v85_s0: nldo-reg4 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <850000>; ++ regulator-max-microvolt = <850000>; ++ regulator-name = "vdd_0v85_s0"; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_0v75_s0: nldo-reg5 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <750000>; ++ regulator-max-microvolt = <750000>; ++ regulator-name = "vdd_0v75_s0"; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++&tsadc { ++ status = "okay"; ++}; ++ ++&uart2 { ++ pinctrl-0 = <&uart2m0_xfer>; ++ status = "okay"; ++}; ++ ++&u2phy2_host { ++ status = "okay"; ++}; ++ ++&u2phy3_host { ++ status = "okay"; ++}; ++ ++&u2phy2 { ++ status = "okay"; ++}; ++ ++&u2phy3 { ++ status = "okay"; ++}; ++ ++&usb_host0_ehci { ++ status = "okay"; ++}; ++ ++&usb_host0_ohci { ++ status = "okay"; ++}; ++ ++&usb_host1_ehci { ++ status = "okay"; ++}; ++ ++&usb_host1_ohci { ++ status = "okay"; ++}; diff --git a/target/linux/rockchip/patches-6.1/054-02-v6.6-arm64-dts-rockchip-Add-NanoPC-T6-PCIe-Ethernet-support.patch b/target/linux/rockchip/patches-6.1/054-02-v6.6-arm64-dts-rockchip-Add-NanoPC-T6-PCIe-Ethernet-support.patch new file mode 100644 index 00000000000..6715de1223b --- /dev/null +++ b/target/linux/rockchip/patches-6.1/054-02-v6.6-arm64-dts-rockchip-Add-NanoPC-T6-PCIe-Ethernet-support.patch @@ -0,0 +1,90 @@ +From a721e28dfad2dec895a5aada85fb0fac0223e2d2 Mon Sep 17 00:00:00 2001 +From: John Clark +Date: Thu, 10 Aug 2023 00:31:56 +0000 +Subject: [PATCH] arm64: dts: rockchip: Add NanoPC T6 PCIe Ethernet support + +Device tree entries for PCIe 2.5G Ethernet NICs + +Signed-off-by: John Clark +Link: https://lore.kernel.org/r/20230810003156.22123-1-inindev@gmail.com +Signed-off-by: Heiko Stuebner +--- + .../boot/dts/rockchip/rk3588-nanopc-t6.dts | 46 +++++++++++++++++++ + 1 file changed, 46 insertions(+) + +--- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts +@@ -115,6 +115,16 @@ + vin-supply = <&vcc4v0_sys>; + }; + ++ vcc_3v3_pcie20: vcc3v3-pcie20-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc_3v3_pcie20"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&vcc_3v3_s3>; ++ }; ++ + vbus5v0_typec: vbus5v0-typec-regulator { + compatible = "regulator-fixed"; + enable-active-high; +@@ -140,6 +150,18 @@ + }; + }; + ++&combphy0_ps { ++ status = "okay"; ++}; ++ ++&combphy1_ps { ++ status = "okay"; ++}; ++ ++&combphy2_psu { ++ status = "okay"; ++}; ++ + &cpu_l0 { + cpu-supply = <&vdd_cpu_lit_s0>; + }; +@@ -391,6 +413,22 @@ + }; + }; + ++&pcie2x1l0 { ++ reset-gpios = <&gpio4 RK_PB3 GPIO_ACTIVE_HIGH>; ++ vpcie3v3-supply = <&vcc_3v3_pcie20>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pcie2_0_rst>; ++ status = "okay"; ++}; ++ ++&pcie2x1l2 { ++ reset-gpios = <&gpio4 RK_PA4 GPIO_ACTIVE_HIGH>; ++ vpcie3v3-supply = <&vcc_3v3_pcie20>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pcie2_2_rst>; ++ status = "okay"; ++}; ++ + &pcie30phy { + status = "okay"; + }; +@@ -425,6 +463,14 @@ + }; + + pcie { ++ pcie2_0_rst: pcie2-0-rst { ++ rockchip,pins = <4 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ pcie2_2_rst: pcie2-2-rst { ++ rockchip,pins = <4 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ + pcie_m2_0_pwren: pcie-m20-pwren { + rockchip,pins = <2 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>; + }; diff --git a/target/linux/rockchip/patches-6.1/054-03-v6.7-arm64-dts-rockchip-Add-NanoPC-T6-PCIe-e-key-support.patch b/target/linux/rockchip/patches-6.1/054-03-v6.7-arm64-dts-rockchip-Add-NanoPC-T6-PCIe-e-key-support.patch new file mode 100644 index 00000000000..f5cda50f817 --- /dev/null +++ b/target/linux/rockchip/patches-6.1/054-03-v6.7-arm64-dts-rockchip-Add-NanoPC-T6-PCIe-e-key-support.patch @@ -0,0 +1,88 @@ +From ac76b786cc370b000c76f3115a5d2ee76ff05c08 Mon Sep 17 00:00:00 2001 +From: John Clark +Date: Wed, 6 Sep 2023 01:23:05 +0000 +Subject: [PATCH] arm64: dts: rockchip: Add NanoPC T6 PCIe e-key support + +before +~~~~ +0000:00:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01) +0002:20:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01) +0002:21:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05) +0004:40:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01) +0004:41:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05) + +after +~~~ +0000:00:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01) +0002:20:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01) +0002:21:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05) +0003:30:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01) +0003:31:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8822CE 802.11ac PCIe Wireless Network Adapter +0004:40:00.0 PCI bridge: Rockchip Electronics Co., Ltd RK3588 (rev 01) +0004:41:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 05) + +Signed-off-by: John Clark +Link: https://lore.kernel.org/r/20230906012305.7113-1-inindev@gmail.com +Signed-off-by: Heiko Stuebner +--- + .../boot/dts/rockchip/rk3588-nanopc-t6.dts | 28 +++++++++++++++++++ + 1 file changed, 28 insertions(+) + +--- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts +@@ -137,6 +137,18 @@ + vin-supply = <&vcc5v0_sys>; + }; + ++ vcc3v3_pcie2x1l0: vcc3v3-pcie2x1l0-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio4 RK_PC2 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pcie_m2_1_pwren>; ++ regulator-name = "vcc3v3_pcie2x1l0"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&vcc5v0_sys>; ++ }; ++ + vcc3v3_pcie30: vcc3v3-pcie30-regulator { + compatible = "regulator-fixed"; + enable-active-high; +@@ -421,6 +433,14 @@ + status = "okay"; + }; + ++&pcie2x1l1 { ++ reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_HIGH>; ++ vpcie3v3-supply = <&vcc3v3_pcie2x1l0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pcie2_1_rst>; ++ status = "okay"; ++}; ++ + &pcie2x1l2 { + reset-gpios = <&gpio4 RK_PA4 GPIO_ACTIVE_HIGH>; + vpcie3v3-supply = <&vcc_3v3_pcie20>; +@@ -467,6 +487,10 @@ + rockchip,pins = <4 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>; + }; + ++ pcie2_1_rst: pcie2-1-rst { ++ rockchip,pins = <4 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ + pcie2_2_rst: pcie2-2-rst { + rockchip,pins = <4 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; + }; +@@ -474,6 +498,10 @@ + pcie_m2_0_pwren: pcie-m20-pwren { + rockchip,pins = <2 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>; + }; ++ ++ pcie_m2_1_pwren: pcie-m21-pwren { ++ rockchip,pins = <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; + }; + + usb { diff --git a/target/linux/rockchip/patches-6.1/100-rockchip-use-system-LED-for-OpenWrt.patch b/target/linux/rockchip/patches-6.1/100-rockchip-use-system-LED-for-OpenWrt.patch index 0955438b7af..8e99d9c8d19 100644 --- a/target/linux/rockchip/patches-6.1/100-rockchip-use-system-LED-for-OpenWrt.patch +++ b/target/linux/rockchip/patches-6.1/100-rockchip-use-system-LED-for-OpenWrt.patch @@ -336,6 +336,45 @@ Signed-off-by: David Bauer rockchip,pins = <1 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; }; }; +--- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts +@@ -20,6 +20,11 @@ + mmc0 = &sdhci; + mmc1 = &sdmmc; + serial2 = &uart2; ++ ++ led-boot = &sys_led; ++ led-failsafe = &sys_led; ++ led-running = &sys_led; ++ led-upgrade = &sys_led; + }; + + chosen { +@@ -28,20 +33,17 @@ + + leds { + compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sys_led_pin>, <&usr_led_pin>; + + sys_led: led-0 { ++ label = "red:system"; + gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>; +- label = "system-led"; +- linux,default-trigger = "heartbeat"; +- pinctrl-names = "default"; +- pinctrl-0 = <&sys_led_pin>; + }; + + usr_led: led-1 { ++ label = "green:wan"; + gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>; +- label = "user-led"; +- pinctrl-names = "default"; +- pinctrl-0 = <&usr_led_pin>; + }; + }; + --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts @@ -15,6 +15,11 @@ diff --git a/target/linux/rockchip/patches-6.1/103-arm64-dts-rockchip-lower-mmc-speed.patch b/target/linux/rockchip/patches-6.1/103-arm64-dts-rockchip-lower-mmc-speed.patch index b784bf1fc29..18b93f9c79d 100644 --- a/target/linux/rockchip/patches-6.1/103-arm64-dts-rockchip-lower-mmc-speed.patch +++ b/target/linux/rockchip/patches-6.1/103-arm64-dts-rockchip-lower-mmc-speed.patch @@ -34,6 +34,27 @@ Signed-off-by: David Bauer &u2phy0_host { phy-supply = <&vdd_5v>; }; +--- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts +@@ -533,8 +533,7 @@ + no-sd; + non-removable; + max-frequency = <200000000>; +- mmc-hs400-1_8v; +- mmc-hs400-enhanced-strobe; ++ mmc-hs200-1_8v; + status = "okay"; + }; + +@@ -546,7 +545,7 @@ + cap-mmc-highspeed; + cap-sd-highspeed; + disable-wp; +- sd-uhs-sdr104; ++ sd-uhs-sdr50; + vmmc-supply = <&vcc_3v3_s3>; + vqmmc-supply = <&vccio_sd_s0>; + status = "okay"; --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts @@ -360,8 +360,7 @@ diff --git a/target/linux/rockchip/patches-6.1/104-fix-io-power-domain-for-orangepi-r1-plus-lts.patch b/target/linux/rockchip/patches-6.1/104-fix-io-power-domain-for-orangepi-r1-plus-lts.patch new file mode 100644 index 00000000000..aac83101218 --- /dev/null +++ b/target/linux/rockchip/patches-6.1/104-fix-io-power-domain-for-orangepi-r1-plus-lts.patch @@ -0,0 +1,10 @@ +--- a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +@@ -38,3 +38,7 @@ + }; + }; + }; ++ ++&io_domains { ++ vccio4-supply = <&vcc_18>; ++}; diff --git a/target/linux/rockchip/patches-6.1/120-06-arm64-dts-rockchip-enable-RK3588-tsadc-by-default.patch b/target/linux/rockchip/patches-6.1/120-06-arm64-dts-rockchip-enable-RK3588-tsadc-by-default.patch new file mode 100644 index 00000000000..2db6bd32b1f --- /dev/null +++ b/target/linux/rockchip/patches-6.1/120-06-arm64-dts-rockchip-enable-RK3588-tsadc-by-default.patch @@ -0,0 +1,22 @@ +From efdf918a1667bf01b167eb98d582d75e14147903 Mon Sep 17 00:00:00 2001 +From: Sebastian Reichel +Date: Thu, 25 May 2023 19:45:02 +0200 +Subject: [PATCH] arm64: dts: rockchip: enable RK3588 tsadc by default + +Enable the thermal ADC for all boards. + +Signed-off-by: Sebastian Reichel +--- + arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 1 - + 1 file changed, 1 deletion(-) + +--- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi +@@ -2617,7 +2617,6 @@ + pinctrl-1 = <&tsadc_shut>; + pinctrl-names = "gpio", "otpout"; + #thermal-sensor-cells = <1>; +- status = "disabled"; + }; + + saradc: adc@fec10000 { diff --git a/target/linux/rockchip/patches-6.1/124-01-arm64-dts-rockchip-nanopc-t6-cpu-mem-regulator-info.patch b/target/linux/rockchip/patches-6.1/124-01-arm64-dts-rockchip-nanopc-t6-cpu-mem-regulator-info.patch new file mode 100644 index 00000000000..b522ca1fb30 --- /dev/null +++ b/target/linux/rockchip/patches-6.1/124-01-arm64-dts-rockchip-nanopc-t6-cpu-mem-regulator-info.patch @@ -0,0 +1,45 @@ +--- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts +@@ -178,34 +178,42 @@ + + &cpu_l0 { + cpu-supply = <&vdd_cpu_lit_s0>; ++ mem-supply = <&vdd_cpu_lit_mem_s0>; + }; + + &cpu_l1 { + cpu-supply = <&vdd_cpu_lit_s0>; ++ mem-supply = <&vdd_cpu_lit_mem_s0>; + }; + + &cpu_l2 { + cpu-supply = <&vdd_cpu_lit_s0>; ++ mem-supply = <&vdd_cpu_lit_mem_s0>; + }; + + &cpu_l3 { + cpu-supply = <&vdd_cpu_lit_s0>; ++ mem-supply = <&vdd_cpu_lit_mem_s0>; + }; + + &cpu_b0{ + cpu-supply = <&vdd_cpu_big0_s0>; ++ mem-supply = <&vdd_cpu_big0_s0>; + }; + + &cpu_b1{ + cpu-supply = <&vdd_cpu_big0_s0>; ++ mem-supply = <&vdd_cpu_big0_s0>; + }; + + &cpu_b2{ + cpu-supply = <&vdd_cpu_big1_s0>; ++ mem-supply = <&vdd_cpu_big1_s0>; + }; + + &cpu_b3{ + cpu-supply = <&vdd_cpu_big1_s0>; ++ mem-supply = <&vdd_cpu_big1_s0>; + }; + + &gpio0 { diff --git a/target/linux/rockchip/patches-6.1/124-02-arm64-dts-rockchip-nanopc-t6-add-lower-USB3-port.patch b/target/linux/rockchip/patches-6.1/124-02-arm64-dts-rockchip-nanopc-t6-add-lower-USB3-port.patch new file mode 100644 index 00000000000..7c729ee81a7 --- /dev/null +++ b/target/linux/rockchip/patches-6.1/124-02-arm64-dts-rockchip-nanopc-t6-add-lower-USB3-port.patch @@ -0,0 +1,88 @@ +--- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts +@@ -107,6 +107,28 @@ + vin-supply = <&vcc12v_dcin>; + }; + ++ vcc5v0_usb: vcc5v0-usb-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_usb"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&vcc5v0_sys>; ++ }; ++ ++ vcc5v0_host_30: vcc5v0-host-30-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_host_30"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ enable-active-high; ++ gpio = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>; ++ vin-supply = <&vcc5v0_usb>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v0_host30_en>; ++ }; ++ + vcc_1v1_nldo_s3: vcc-1v1-nldo-s3-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc-1v1-nldo-s3"; +@@ -522,6 +544,10 @@ + usbc0_int: usbc0-int { + rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>; + }; ++ ++ vcc5v0_host30_en: vcc5v0-host30-en { ++ rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; + }; + }; + +@@ -892,6 +918,11 @@ + status = "okay"; + }; + ++&u2phy1_otg { ++ phy-supply = <&vcc5v0_host_30>; ++ status = "okay"; ++}; ++ + &u2phy2_host { + status = "okay"; + }; +@@ -900,6 +931,10 @@ + status = "okay"; + }; + ++&u2phy1 { ++ status = "okay"; ++}; ++ + &u2phy2 { + status = "okay"; + }; +@@ -908,6 +943,14 @@ + status = "okay"; + }; + ++&usbdp_phy1 { ++ status = "okay"; ++}; ++ ++&usbdp_phy1_u3 { ++ status = "okay"; ++}; ++ + &usb_host0_ehci { + status = "okay"; + }; +@@ -923,3 +966,7 @@ + &usb_host1_ohci { + status = "okay"; + }; ++ ++&usb_host1_xhci { ++ status = "okay"; ++}; diff --git a/target/linux/rockchip/patches-6.1/124-03-arm64-dts-rockchip-nanopc-t6-add-USB-C-support.patch b/target/linux/rockchip/patches-6.1/124-03-arm64-dts-rockchip-nanopc-t6-add-USB-C-support.patch new file mode 100644 index 00000000000..be094f69f32 --- /dev/null +++ b/target/linux/rockchip/patches-6.1/124-03-arm64-dts-rockchip-nanopc-t6-add-USB-C-support.patch @@ -0,0 +1,129 @@ +--- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts +@@ -396,6 +396,48 @@ + source-pdos = ; + sink-pdos = ; + op-sink-microwatt = <1000000>; ++ ++ altmodes { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ altmode@0 { ++ reg = <0>; ++ svid = <0xff01>; ++ vdo = <0xffffffff>; ++ }; ++ }; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ usbc0_orien_sw: endpoint { ++ remote-endpoint = <&usbdp_phy0_orientation_switch>; ++ }; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ dp_altmode_mux: endpoint { ++ remote-endpoint = <&usbdp_phy0_dp_altmode_mux>; ++ }; ++ }; ++ }; ++ }; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ usbc0_role_sw: endpoint@0 { ++ remote-endpoint = <&usb_host0_xhci_role_switch>; ++ }; ++ }; + }; + }; + +@@ -918,6 +960,10 @@ + status = "okay"; + }; + ++&u2phy0_otg { ++ status = "okay"; ++}; ++ + &u2phy1_otg { + phy-supply = <&vcc5v0_host_30>; + status = "okay"; +@@ -931,6 +977,10 @@ + status = "okay"; + }; + ++&u2phy0 { ++ status = "okay"; ++}; ++ + &u2phy1 { + status = "okay"; + }; +@@ -943,6 +993,33 @@ + status = "okay"; + }; + ++&usbdp_phy0 { ++ orientation-switch; ++ rockchip,dp-lane-mux = <0 1 2 3 >; ++ svid = <0xff01>; ++ sbu1-dc-gpios = <&gpio4 RK_PA6 GPIO_ACTIVE_HIGH>; ++ sbu2-dc-gpios = <&gpio4 RK_PA7 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++ ++ port { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ usbdp_phy0_orientation_switch: endpoint@0 { ++ reg = <0>; ++ remote-endpoint = <&usbc0_orien_sw>; ++ }; ++ ++ usbdp_phy0_dp_altmode_mux: endpoint@1 { ++ reg = <1>; ++ remote-endpoint = <&dp_altmode_mux>; ++ }; ++ }; ++}; ++ ++&usbdp_phy0_u3 { ++ status = "okay"; ++}; ++ + &usbdp_phy1 { + status = "okay"; + }; +@@ -959,6 +1036,21 @@ + status = "okay"; + }; + ++&usb_host0_xhci { ++ dr_mode = "host"; ++ usb-role-switch; ++ status = "okay"; ++ ++ port { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ usb_host0_xhci_role_switch: endpoint { ++ remote-endpoint = <&usbc0_role_sw>; ++ }; ++ }; ++}; ++ + &usb_host1_ehci { + status = "okay"; + }; diff --git a/target/linux/rockchip/patches-6.1/601-net-phy-motorcomm-add-LED-configuration-for-yt8521.patch b/target/linux/rockchip/patches-6.1/601-net-phy-motorcomm-add-LED-configuration-for-yt8521.patch deleted file mode 100644 index a4409e25713..00000000000 --- a/target/linux/rockchip/patches-6.1/601-net-phy-motorcomm-add-LED-configuration-for-yt8521.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- a/drivers/net/phy/motorcomm.c -+++ b/drivers/net/phy/motorcomm.c -@@ -224,6 +224,12 @@ - #define YTPHY_WCR_INTR_SEL BIT(6) - #define YTPHY_WCR_ENABLE BIT(3) - -+#define YTPHY_LED_NUM_CONFIG 5 -+/* LED_GENERAL_CFG: 0xA00B, LED0_CFG: 0xA00C, LED1_CFG: 0xA00D -+ * LED2_CFG: 0xA00E, LED_BLINK_CFG: 0xA00F -+ */ -+#define YTPHY_LED_CONFIG_REG(x) (0xA00B + x) -+ - /* 2b00 84ms - * 2b01 168ms *default* - * 2b10 336ms -@@ -1459,6 +1465,7 @@ static int yt8521_resume(struct phy_devi - static int yt8521_config_init(struct phy_device *phydev) - { - struct device_node *node = phydev->mdio.dev.of_node; -+ u32 led_data[YTPHY_LED_NUM_CONFIG]; - int old_page; - int ret = 0; - -@@ -1488,6 +1495,16 @@ static int yt8521_config_init(struct phy - if (ret < 0) - goto err_restore_page; - } -+ -+ if (!of_property_read_u32_array(node, "motorcomm,led-data", -+ led_data, YTPHY_LED_NUM_CONFIG)) { -+ for (int i = 0; i < YTPHY_LED_NUM_CONFIG; i++) { -+ ret = ytphy_write_ext(phydev, YTPHY_LED_CONFIG_REG(i), -+ led_data[i]); -+ if (ret < 0) -+ goto err_restore_page; -+ } -+ } - err_restore_page: - return phy_restore_page(phydev, old_page, ret); - } diff --git a/target/linux/rockchip/patches-6.1/601-net-phy-motorcomm-add-LED-configuration-for-yt85xx.patch b/target/linux/rockchip/patches-6.1/601-net-phy-motorcomm-add-LED-configuration-for-yt85xx.patch new file mode 100644 index 00000000000..d175abe3b1b --- /dev/null +++ b/target/linux/rockchip/patches-6.1/601-net-phy-motorcomm-add-LED-configuration-for-yt85xx.patch @@ -0,0 +1,63 @@ +--- a/drivers/net/phy/motorcomm.c ++++ b/drivers/net/phy/motorcomm.c +@@ -224,6 +224,12 @@ + #define YTPHY_WCR_INTR_SEL BIT(6) + #define YTPHY_WCR_ENABLE BIT(3) + ++#define YTPHY_LED_NUM_CONFIG 5 ++/* LED_GENERAL_CFG: 0xA00B, LED0_CFG: 0xA00C, LED1_CFG: 0xA00D ++ * LED2_CFG: 0xA00E, LED_BLINK_CFG: 0xA00F ++ */ ++#define YTPHY_LED_CONFIG_REG(x) (0xA00B + x) ++ + /* 2b00 84ms + * 2b01 168ms *default* + * 2b10 336ms +@@ -1450,6 +1456,27 @@ static int yt8521_resume(struct phy_devi + return yt8521_modify_utp_fiber_bmcr(phydev, BMCR_PDOWN, 0); + } + ++static int ytphy_config_led(struct phy_device *phydev) ++{ ++ struct device_node *node = phydev->mdio.dev.of_node; ++ u32 led_data[YTPHY_LED_NUM_CONFIG]; ++ int ret; ++ ++ ret = of_property_read_u32_array(node, "motorcomm,led-data", ++ led_data, YTPHY_LED_NUM_CONFIG); ++ if (ret) ++ return 0; ++ ++ for (int i = 0; i < YTPHY_LED_NUM_CONFIG; i++) { ++ ret = ytphy_write_ext(phydev, YTPHY_LED_CONFIG_REG(i), ++ led_data[i]); ++ if (ret < 0) ++ return ret; ++ } ++ ++ return 0; ++} ++ + /** + * yt8521_config_init() - called to initialize the PHY + * @phydev: a pointer to a &struct phy_device +@@ -1488,6 +1515,10 @@ static int yt8521_config_init(struct phy + if (ret < 0) + goto err_restore_page; + } ++ ++ ret = ytphy_config_led(phydev); ++ if (ret < 0) ++ goto err_restore_page; + err_restore_page: + return phy_restore_page(phydev, old_page, ret); + } +@@ -1519,7 +1550,7 @@ static int yt8531_config_init(struct phy + return ret; + } + +- return 0; ++ return ytphy_config_led(phydev); + } + + /** diff --git a/target/linux/rockchip/patches-6.1/610-arm64-rockchip-add-OF-node-for-eth.patch b/target/linux/rockchip/patches-6.1/610-arm64-rockchip-add-OF-node-for-eth.patch index ec02ce80712..f43e9b2e2e6 100644 --- a/target/linux/rockchip/patches-6.1/610-arm64-rockchip-add-OF-node-for-eth.patch +++ b/target/linux/rockchip/patches-6.1/610-arm64-rockchip-add-OF-node-for-eth.patch @@ -72,9 +72,9 @@ Signed-off-by: David Bauer pinctrl-0 = <ð_phy_reset_pin>; pinctrl-names = "default"; -@@ -38,3 +39,7 @@ - }; - }; +@@ -42,3 +43,7 @@ + &io_domains { + vccio4-supply = <&vcc_18>; }; + +&rtl8153 { @@ -174,3 +174,41 @@ Signed-off-by: David Bauer }; }; +--- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts +@@ -505,6 +505,17 @@ + pinctrl-names = "default"; + pinctrl-0 = <&pcie2_0_rst>; + status = "okay"; ++ ++ pcie@0,0 { ++ reg = <0x00200000 0 0 0 0>; ++ #address-cells = <3>; ++ #size-cells = <2>; ++ ++ rtl8125_2: pcie@20,0 { ++ reg = <0x000000 0 0 0 0>; ++ label = "eth2"; ++ }; ++ }; + }; + + &pcie2x1l1 { +@@ -521,6 +532,17 @@ + pinctrl-names = "default"; + pinctrl-0 = <&pcie2_2_rst>; + status = "okay"; ++ ++ pcie@0,0 { ++ reg = <0x00400000 0 0 0 0>; ++ #address-cells = <3>; ++ #size-cells = <2>; ++ ++ rtl8125_1: pcie@40,0 { ++ reg = <0x000000 0 0 0 0>; ++ label = "eth1"; ++ }; ++ }; + }; + + &pcie30phy { diff --git a/target/linux/rockchip/patches-6.1/801-07-arm64-dts-rockchip-enable-hwrng-for-rockchip-boards.patch b/target/linux/rockchip/patches-6.1/801-07-arm64-dts-rockchip-enable-hwrng-for-rockchip-boards.patch index 8d6c651db3f..c65128dfa87 100644 --- a/target/linux/rockchip/patches-6.1/801-07-arm64-dts-rockchip-enable-hwrng-for-rockchip-boards.patch +++ b/target/linux/rockchip/patches-6.1/801-07-arm64-dts-rockchip-enable-hwrng-for-rockchip-boards.patch @@ -50,6 +50,19 @@ &saradc { vref-supply = <&vcca_1v8>; status = "okay"; +--- a/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588-nanopc-t6.dts +@@ -620,6 +620,10 @@ + status = "okay"; + }; + ++&rng { ++ status = "okay"; ++}; ++ + &saradc { + vref-supply = <&avcc_1v8_s0>; + status = "okay"; --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts @@ -431,6 +431,10 @@ @@ -63,3 +76,16 @@ &saradc { vref-supply = <&avcc_1v8_s0>; status = "okay"; +--- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5a.dts +@@ -358,6 +358,10 @@ + status = "okay"; + }; + ++&rng { ++ status = "okay"; ++}; ++ + &saradc { + vref-supply = <&avcc_1v8_s0>; + status = "okay"; diff --git a/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch b/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch index 98fc7ca0b47..d3096b4f802 100644 --- a/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch +++ b/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch @@ -16,7 +16,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4s-enterprise.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pinebook-pro.dtb -@@ -77,10 +79,14 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bp +@@ -77,6 +79,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bp dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb1-v10.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-fastrhino-r66s.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-fastrhino-r68s.dtb @@ -24,9 +24,9 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-nanopi-r5c.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-nanopi-r5s.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-roc-pc.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-rock-3a.dtb +@@ -84,4 +87,6 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-ro dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-evb1-v10.dtb -+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-rock-5b.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-nanopi-r6c.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-nanopi-r6s.dtb diff --git a/target/linux/sifiveu/config-6.1 b/target/linux/sifiveu/config-6.1 index 98968317453..aef00066934 100644 --- a/target/linux/sifiveu/config-6.1 +++ b/target/linux/sifiveu/config-6.1 @@ -68,7 +68,6 @@ CONFIG_DEBUG_INFO=y CONFIG_DECOMPRESS_GZIP=y CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y -# CONFIG_DEVTMPFS_SAFE is not set CONFIG_DMA_DIRECT_REMAP=y CONFIG_DNOTIFY=y CONFIG_DTC=y diff --git a/target/linux/x86/base-files.mk b/target/linux/x86/base-files.mk new file mode 100644 index 00000000000..88ba97d38a3 --- /dev/null +++ b/target/linux/x86/base-files.mk @@ -0,0 +1,8 @@ +GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL)) +ifeq ($(GRUB_SERIAL),) +$(error This platform requires CONFIG_GRUB_SERIAL be set!) +endif + +define Package/base-files/install-target + $(SED) "s#@GRUB_SERIAL@#$(GRUB_SERIAL)#" $(1)/etc/inittab +endef diff --git a/target/linux/x86/base-files/etc/inittab b/target/linux/x86/base-files/etc/inittab index f4747f200d0..9daf2ce2f0f 100644 --- a/target/linux/x86/base-files/etc/inittab +++ b/target/linux/x86/base-files/etc/inittab @@ -1,5 +1,5 @@ ::sysinit:/etc/init.d/rcS S boot ::shutdown:/etc/init.d/rcS K shutdown -ttyS0::askfirst:/usr/libexec/login.sh +@GRUB_SERIAL@::askfirst:/usr/libexec/login.sh hvc0::askfirst:/usr/libexec/login.sh tty1::askfirst:/usr/libexec/login.sh diff --git a/target/linux/x86/config-6.1 b/target/linux/x86/config-6.1 index 4a612c51a82..c467cdde3bf 100644 --- a/target/linux/x86/config-6.1 +++ b/target/linux/x86/config-6.1 @@ -117,7 +117,6 @@ CONFIG_DEBUG_MISC=y # CONFIG_DEBUG_TLBFLUSH is not set CONFIG_DECOMPRESS_BZIP2=y CONFIG_DECOMPRESS_GZIP=y -# CONFIG_DEVTMPFS_SAFE is not set CONFIG_DMADEVICES=y CONFIG_DMA_ACPI=y CONFIG_DMA_SHARED_BUFFER=y diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile index 677b758e01c..84b111ec7fd 100644 --- a/target/linux/x86/image/Makefile +++ b/target/linux/x86/image/Makefile @@ -18,15 +18,11 @@ endif GRUB_SERIAL:=$(call qstrip,$(CONFIG_GRUB_SERIAL)) -ifneq ($(GRUB_SERIAL),) - GRUB_CONSOLE_CMDLINE += console=$(GRUB_SERIAL),$(CONFIG_GRUB_BAUDRATE)n8$(if $(CONFIG_GRUB_FLOWCONTROL),r,) - GRUB_SERIAL_CONFIG := serial --unit=0 --speed=$(CONFIG_GRUB_BAUDRATE) --word=8 --parity=no --stop=1 --rtscts=$(if $(CONFIG_GRUB_FLOWCONTROL),on,off) - GRUB_TERMINALS += serial -endif +GRUB_CONSOLE_CMDLINE += console=$(GRUB_SERIAL),$(CONFIG_GRUB_BAUDRATE)n8$(if $(CONFIG_GRUB_FLOWCONTROL),r,) +GRUB_SERIAL_CONFIG := serial --unit=0 --speed=$(CONFIG_GRUB_BAUDRATE) --word=8 --parity=no --stop=1 --rtscts=$(if $(CONFIG_GRUB_FLOWCONTROL),on,off) +GRUB_TERMINALS += serial -ifneq ($(GRUB_TERMINALS),) - GRUB_TERMINAL_CONFIG := terminal_input $(GRUB_TERMINALS); terminal_output $(GRUB_TERMINALS) -endif +GRUB_TERMINAL_CONFIG := terminal_input $(GRUB_TERMINALS); terminal_output $(GRUB_TERMINALS) ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME)) ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(IMG_PART_SIGNATURE)-02) diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 66eca147668..6dc77621ea3 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -11,9 +11,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git -PKG_SOURCE_DATE:=2023-11-03 -PKG_SOURCE_VERSION:=ba5bc4e1ae9d3e7b41d3bed39ce505670dc95078 -PKG_MIRROR_HASH:=f14e0153443493c2908a2145c206798e01c66d985a81e259187007c464574b72 +PKG_SOURCE_DATE:=2023-11-21 +PKG_SOURCE_VERSION:=12bf1a99bd6eebae90caa144bb4d8b0cd763ff8f +PKG_MIRROR_HASH:=f711bf80123a6f14737da27ab8dfff87a4d429c74057de355b1693e89f223abc include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk